Difference between revisions of "WCS Wrapper Installation LinuxOP"
(→PyNIO) |
|||
(20 intermediate revisions by 2 users not shown) | |||
Line 23: | Line 23: | ||
/usr/local | /usr/local | ||
− | Installing to this directory, you will make the software packages available for everyone in that computer. It will also overwrite older versions, which is usually desirable but contains risks, or overwrite newer versions, which is usually not desirable. | + | Installing to this directory, you will make the software packages available for everyone in that computer. It will also overwrite older versions, which is usually desirable but contains risks, or overwrite newer versions, which is usually not desirable. You need root privileges to install to /usr/local |
Anyway, overwriting anything may break some other software, so in that case it is recommended to install somewhere else and not make the package automatically public. In that case, you don't need root privileges. | Anyway, overwriting anything may break some other software, so in that case it is recommended to install somewhere else and not make the package automatically public. In that case, you don't need root privileges. | ||
Line 35: | Line 35: | ||
Since python is usually installed in posix-like systems, this step may be skipped. Other versions of python 2.x may work, but python 3.x won't yet. | Since python is usually installed in posix-like systems, this step may be skipped. Other versions of python 2.x may work, but python 3.x won't yet. | ||
− | + | 32 bit as well as 64 bit installations have been done and work as expected. This is more of an issue for 3rd party software in any case, so make sure you install the correct versions of the required packages (as far as they contain compiled code) or python might not be able to load them. | |
Install with command | Install with command | ||
Line 49: | Line 49: | ||
# sh setuptools-0.6c11-py2.6.egg | # sh setuptools-0.6c11-py2.6.egg | ||
− | == | + | == Get the Datafed WCS Wrapper == |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | A good place to install is /usr/local/OWS but any other is OK. | |
If you have modified the default '''OWS/web/static/index.html'', make sure '''not to overwrite''' it. Keep the main copy elsewhere and copy it back. | If you have modified the default '''OWS/web/static/index.html'', make sure '''not to overwrite''' it. Keep the main copy elsewhere and copy it back. | ||
Line 77: | Line 61: | ||
ows-point-1.3.1.zip = (linux-ows-1.3.1.zip) - (netcdf support) + (sample point provider) | ows-point-1.3.1.zip = (linux-ows-1.3.1.zip) - (netcdf support) + (sample point provider) | ||
− | + | Issue command | |
+ | |||
+ | unzip linux-ows-1.3.1.zip | ||
+ | |||
+ | Move the contents of the directory linux-ows-1.3.1 to '''OWS'''. You can install to other directories, this is just used as an example. | ||
You will to have directories '''OWS/datafed''' and '''OWS/web''' | You will to have directories '''OWS/datafed''' and '''OWS/web''' | ||
− | The | + | The directory datafed contains ''datafed'' package, which contains tools for ISO 8601 time |
parsing and some other utilities. ''Web'' is the WCS framework. | parsing and some other utilities. ''Web'' is the WCS framework. | ||
Line 127: | Line 115: | ||
cd numpy-1.5.1 | cd numpy-1.5.1 | ||
python setup.py install | python setup.py install | ||
+ | |||
+ | If you don't have a fortran compiler installed, for example ''gfortran'' on Debian, you will get warnings. You can ignore them, since fortran is not used. | ||
=== PyNIO === | === PyNIO === | ||
Line 132: | Line 122: | ||
[http://www.pyngl.ucar.edu/Nio.shtml PyNIO Home page] | [http://www.pyngl.ucar.edu/Nio.shtml PyNIO Home page] | ||
− | + | Choose your operating system from [http://www.pyngl.ucar.edu/Download/list_pynio_binaries.shtml list of PyNIO binaries], write down the file name you want to download. | |
− | Start at [http://www.pyngl.ucar.edu/Download/ download] and follow the instructions. You need to request an account. Then you need to go to [http://www.earthsystemgrid.org/] and click on | + | Start at [http://www.pyngl.ucar.edu/Download/ download] and follow the instructions. You need to request an account. Then you need to go to [http://www.earthsystemgrid.org/] and click on |
− | + | [[Image:NCL_download.png]] | |
− | + | Then download '''PyNIO Version 1.4.0''', Choose '''PyNIO Version 1.4.0 precompiled binaries, OPeNDAP-enabled'''. Click on '''Download files for this collection''' and Accept license. You'll get a list of different supported systems, | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | This version of PyNIO is compiled with 4.1.1 which has a known bug which occurs if all of the following conditions are true: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | * writing a variable of any type with more than 2**32 values | |
− | + | * the variable must have 2 or more dimensions | |
− | * | + | * the platform on which the file is written must be 32-bit |
+ | * the file can be either classic format or 64-bit offset format | ||
+ | * the values to be written must begin beyond the first 2**32 values | ||
− | + | In this case, a file offset is computed for writing using 32-bit arithmetic for a multiply, but it should be using 64-bit arithmetic. This results in an undetected integer overflow and can overwrite data earlier in the file, without an error or warning. | |
− | + | This has been fixed in 4.1.2 beta 1. If you need to process very large files, you need to compile PyNIO yourself using [ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.1.2-beta1.tar.gz netcdf-4.1.2-beta1] or later. | |
+ | |||
+ | === wsgilog === | ||
+ | |||
+ | [http://pypi.python.org/pypi/wsgilog/ WsgiLog] (0.1) is optional, only if you want to log webpy output to a file. | ||
+ | |||
+ | easy_install wsgilog | ||
+ | |||
+ | == Install and Start the OWS Server == | ||
+ | |||
+ | === Install === | ||
+ | |||
+ | * Unpack to your desired working directory. These instructions assume that your working directory is ''/usr/local/'', and these instructions assume you unzipped to ''/usr/local/OWS'' directory. | ||
+ | * Add the path of the extracted ''OWS'' directory to your ''PYTHONPATH'' environment variable. | ||
+ | ** IIf you followed the above example, ''PYTHONPATH'' should contain ''/usr/local/OWS'' to find the OWS/datafed package. | ||
+ | * Go to ''OWS/web'' and execute ''python ows.py'' and a server should be running on http://localhost:8080/ ready to be used. | ||
+ | ** A different port can be passed to the server as an argument, ''python ows.py 8601'' is used in the test code, don't use it. | ||
+ | ** You will have to create the log directory ''/var/log/ows'' (lowercase ows!) before running the server for the first time. | ||
+ | ** If the server is not being run as root, the user that runs it needs write access to the log directory. | ||
+ | * You can stop the server by pressing ctrl-c in the console window. | ||
+ | * To make the server available automatically at boot time, you can use an init script, an example script that starts the OWS server in a screen session as another user is available [http://repositories.icg.kfa-juelich.de/downloads/ows.sh here]. | ||
+ | * Typescript of installation on fresh and minimal [http://debian.org Debian] stable is [http://repositories.icg.kfa-juelich.de/downloads/debian_typescript.txt here]. | ||
+ | |||
+ | === Putting your data into CF Compatible NetCDF Files === | ||
+ | |||
+ | ''(Not required in point)'' This is for getting the demo run only. | ||
+ | |||
+ | How to use the wrapper libraries can be found in related page | ||
+ | [http://wiki.esipfed.org/index.php/Creating_NetCDF_CF_Files Creating NetCDF-CF Files]. | ||
+ | |||
+ | Setting up the demo dataset: | ||
+ | |||
+ | '''OWS/web/static/testprovider/''' contains files: | ||
+ | * [http://localhost:8080/static/testprovider/CubeA.ncml CubeA.ncml] and [http://localhost:8080/static/testprovider/CubeA.nc CubeA.nc] | ||
+ | * [http://localhost:8080/static/testprovider/CubeB.ncml CubeB.ncml] and [http://localhost:8080/static/testprovider/CubeB.nc CubeB.nc] | ||
+ | * [http://localhost:8080/static/testprovider/CubeB.ncml H5D.ncml] and [http://localhost:8080/static/testprovider/CubeB.nc H5D.nc] | ||
+ | * [http://localhost:8080/static/testprovider/create_all.py create_all.py] | ||
+ | |||
+ | * [http://localhost:8080/static/testprovider/index.html index.html] | ||
+ | * [http://localhost:8080/static/testprovider/wcs_capabilities.conf wcs_capabilities.conf] | ||
+ | |||
+ | *'''CubeA.ncml''' is a [http://www.unidata.ucar.edu/software/netcdf/ncml/v2.2/Tutorial.html NetCDF Markup Language] description of the test coverage, same for teh rest of the .ncml files. The .nc files are files that are created from using the ncml as instructions. | ||
+ | *'''create_all.py''' is a script that creates the empty cube files and then fills it with test data. It servers as an example code how to create your own CF 1.0 compatible files. It has no user interface, just run it. | ||
+ | |||
+ | So do the following: | ||
− | + | cd /usr/local/OWS/web/static/testprovider | |
− | + | python create_all.py | |
− | |||
− | |||
− | |||
− | + | Now you have data to serve. | |
− | + | === Creating Metadata === | |
− | + | The metadata queries of WCS, '''GetCoverage''' and '''DescribeCoverage''' need to be precompiled. | |
− | + | Run the following commands: | |
− | + | cd /usr/local/OWS/web | |
+ | python owsadmin.py wcs_prepare -o testprovider | ||
− | + | or to extract metadata for all the providers: | |
− | |||
− | + | python owsadmin.py wcs_prepare -ao | |
− | + | -o is for optimize, -a prepares every provider | |
− | + | it will create file '''/usr/local/OWS/web/static/testprovider/metadata.dat'''. | |
− | + | Try now test queries [http://localhost:8080/testprovider?service=WCS&acceptversions=1.1.2&Request=GetCapabilities GetCapabilities] and [http://localhost:8080/testprovider?service=WCS&version=1.1.2&Request=DescribeCoverage&identifier=CubeA DescribeCoverage CubeA] | |
− | + | Press ctrl+C to terminate the server. Although this server is intended for development and debugging only, you can use it to server data from your own workstation just fine. For high load sites, look [http://webpy.org/install webpy.org/install] documentation how to set up a high load site. | |
− | + | == Where to go next == | |
− | : | + | See [http://wiki.esipfed.org/index.php/WCS_Wrapper_Installation_WindowsOP#Put_your_own_data_online Windows Installation] for some platform-neutral information about installation. |
− | + | How to create data for serving is documented at [[WCS_Wrapper_Configuration| WCS Wrapper Configuration]] |
Latest revision as of 09:20, December 23, 2010
Questions and comments should go to sourceforge discussions, bug reports to sourceforge tickets. Urgent issues can be asked from Kari Hoijarvi 314-935-6099(w) or 314-843-6436(h)
Last updated 2010-12-13
Things to Consider About Security
The web.py framework and WCS service code has been written with security in mind, and there are no known security bugs. There is little code that writes on the disk, so running this service should not put your computer in danger.
To maximize the security of your computer, consider the following.
- Every file in every directory you put under OWS/web/static becomes readable by anybody. This is by design, since the whole framework is meant to publish public data. Do not put confidential information under OWS folder!
- Don't run the process as root. Create a low-rights account like WCS_RUNNER and use that.
Do you want to install as public or private?
The place to install is usually by default:
/usr/local
Installing to this directory, you will make the software packages available for everyone in that computer. It will also overwrite older versions, which is usually desirable but contains risks, or overwrite newer versions, which is usually not desirable. You need root privileges to install to /usr/local
Anyway, overwriting anything may break some other software, so in that case it is recommended to install somewhere else and not make the package automatically public. In that case, you don't need root privileges.
Get Python 2.6.6
We recommend latest python 2.6.6 from ActiveState Python download page or ActiveState Direct Download or you can download from official site.
Since python is usually installed in posix-like systems, this step may be skipped. Other versions of python 2.x may work, but python 3.x won't yet.
32 bit as well as 64 bit installations have been done and work as expected. This is more of an issue for 3rd party software in any case, so make sure you install the correct versions of the required packages (as far as they contain compiled code) or python might not be able to load them.
Install with command
# ./install.sh -I /usr/local
Warning: This will overwrite your existing python. It may or may not be OK to upgrade, but hardly good to downgrade. You can install several versions of python in the same machine and then edit your environment variables to use the desired version.
Get easy_install for python
Follow instructions at easy_install. In this case download was setuptools-0.6c11-py2.6.egg and the next command installed it:
# sh setuptools-0.6c11-py2.6.egg
Get the Datafed WCS Wrapper
A good place to install is /usr/local/OWS but any other is OK.
If you have modified the default OWS/web/static/index.html, make sure not to overwrite' it. Keep the main copy elsewhere and copy it back.
Open the download page in another tab.
If you are serving cubes from NetCDF files, get linux-ows-1.3.1.zip or later. This distribution contains point data support also. If you are serving only point data, you can just download ows-point-1.3.1.zip.
ows-point-1.3.1.zip = (linux-ows-1.3.1.zip) - (netcdf support) + (sample point provider)
Issue command
unzip linux-ows-1.3.1.zip
Move the contents of the directory linux-ows-1.3.1 to OWS. You can install to other directories, this is just used as an example.
You will to have directories OWS/datafed and OWS/web
The directory datafed contains datafed package, which contains tools for ISO 8601 time parsing and some other utilities. Web is the WCS framework.
Notice:
Using C based libraries enables delivering large amounts of data efficiently. Python is used only for query parsing, making minimal impact in speed.
Although the built-in webserver is intended mainly for development, you can use it to serve data from your own workstation just fine. For high load sites, look webpy.org/install documentation how to integrate webpy with apache server etc.
Get 3rd Party Components
WebPy
Install webpy 0.34 or newer.
easy_install web.py
More detailed instructions are at webpy download.
lxml
Install lxml 2.2.8 or 2.3.x
easy_install lxml
In this case, Red Hat 4.1.1-52, the command installed 2.3.beta1
More detailed instructions are at lxml installation instructions.
NumPy
Install numpy 1.5.1 from Numpy Files. Currently there is no easy_install.
Linux testing is done with 1.5.1, but if you have 1.4.1 installed, it should work. The commands issued were:
wget http://sourceforge.net/projects/numpy/files/NumPy/1.5.1/numpy-1.5.1.tar.gz/download tar xvf numpy-1.5.1.tar.gz cd numpy-1.5.1 python setup.py install
If you don't have a fortran compiler installed, for example gfortran on Debian, you will get warnings. You can ignore them, since fortran is not used.
PyNIO
Choose your operating system from list of PyNIO binaries, write down the file name you want to download.
Start at download and follow the instructions. You need to request an account. Then you need to go to [1] and click on
Then download PyNIO Version 1.4.0, Choose PyNIO Version 1.4.0 precompiled binaries, OPeNDAP-enabled. Click on Download files for this collection and Accept license. You'll get a list of different supported systems,
This version of PyNIO is compiled with 4.1.1 which has a known bug which occurs if all of the following conditions are true:
- writing a variable of any type with more than 2**32 values
- the variable must have 2 or more dimensions
- the platform on which the file is written must be 32-bit
- the file can be either classic format or 64-bit offset format
- the values to be written must begin beyond the first 2**32 values
In this case, a file offset is computed for writing using 32-bit arithmetic for a multiply, but it should be using 64-bit arithmetic. This results in an undetected integer overflow and can overwrite data earlier in the file, without an error or warning.
This has been fixed in 4.1.2 beta 1. If you need to process very large files, you need to compile PyNIO yourself using netcdf-4.1.2-beta1 or later.
wsgilog
WsgiLog (0.1) is optional, only if you want to log webpy output to a file.
easy_install wsgilog
Install and Start the OWS Server
Install
- Unpack to your desired working directory. These instructions assume that your working directory is /usr/local/, and these instructions assume you unzipped to /usr/local/OWS directory.
- Add the path of the extracted OWS directory to your PYTHONPATH environment variable.
- IIf you followed the above example, PYTHONPATH should contain /usr/local/OWS to find the OWS/datafed package.
- Go to OWS/web and execute python ows.py and a server should be running on http://localhost:8080/ ready to be used.
- A different port can be passed to the server as an argument, python ows.py 8601 is used in the test code, don't use it.
- You will have to create the log directory /var/log/ows (lowercase ows!) before running the server for the first time.
- If the server is not being run as root, the user that runs it needs write access to the log directory.
- You can stop the server by pressing ctrl-c in the console window.
- To make the server available automatically at boot time, you can use an init script, an example script that starts the OWS server in a screen session as another user is available here.
- Typescript of installation on fresh and minimal Debian stable is here.
Putting your data into CF Compatible NetCDF Files
(Not required in point) This is for getting the demo run only.
How to use the wrapper libraries can be found in related page Creating NetCDF-CF Files.
Setting up the demo dataset:
OWS/web/static/testprovider/ contains files:
- CubeA.ncml and CubeA.nc
- CubeB.ncml and CubeB.nc
- H5D.ncml and H5D.nc
- create_all.py
- CubeA.ncml is a NetCDF Markup Language description of the test coverage, same for teh rest of the .ncml files. The .nc files are files that are created from using the ncml as instructions.
- create_all.py is a script that creates the empty cube files and then fills it with test data. It servers as an example code how to create your own CF 1.0 compatible files. It has no user interface, just run it.
So do the following:
cd /usr/local/OWS/web/static/testprovider python create_all.py
Now you have data to serve.
Creating Metadata
The metadata queries of WCS, GetCoverage and DescribeCoverage need to be precompiled.
Run the following commands:
cd /usr/local/OWS/web python owsadmin.py wcs_prepare -o testprovider
or to extract metadata for all the providers:
python owsadmin.py wcs_prepare -ao
-o is for optimize, -a prepares every provider
it will create file /usr/local/OWS/web/static/testprovider/metadata.dat.
Try now test queries GetCapabilities and DescribeCoverage CubeA
Press ctrl+C to terminate the server. Although this server is intended for development and debugging only, you can use it to server data from your own workstation just fine. For high load sites, look webpy.org/install documentation how to set up a high load site.
Where to go next
See Windows Installation for some platform-neutral information about installation.
How to create data for serving is documented at WCS Wrapper Configuration