Commit 9805c82f authored by Stavros Sachtouris's avatar Stavros Sachtouris

Fix dockerization process and document accordingly

parent 10f732f6
...@@ -113,7 +113,27 @@ Install **snf-occi** API translation server by cloning our latest source code: ...@@ -113,7 +113,27 @@ Install **snf-occi** API translation server by cloning our latest source code:
cp snfOCCI/config.py.template snfOCCI/config.py cp snfOCCI/config.py.template snfOCCI/config.py
python setup.py install python setup.py install
**NOTE**: edit the **config.py** before running the service **NOTE**: edit the **config.py** before running the service. In the following
example, we replicate the settings of the hellasgrid service, but you can set
your own cloud and astavoms settings in your own deployment
::
# Copy this file as config.py and fill in the appropriate values
COMPUTE = {
'arch': 'x86',
}
KAMAKI = {
'compute_url': 'https://cyclades.okeanos.grnet.gr/compute/v2.0/',
'astakos_url': 'https://accounts.okeanos.grnet.gr/identity/v2.0',
'network_url': 'https://cyclades.okeanos.grnet.gr/network/v2.0'
}
KEYSTONE_URL = 'https://okeanos-astavoms.hellasgrid.gr'
HOSTNAME = 'https://okeanos-occi2.hellasgrid.gr:9000'
PASTEDEPLOY = '/home/user/src/snf-occi/snfOCCI/paste_deploy/snf-occi-paste.ini'
snf-occi is a simple WSGI python application with basic paste support. A full scale deployment is out of the scope of this document, but it is expected to use standard tools like apache and gunicorn to setup the service. snf-occi is a simple WSGI python application with basic paste support. A full scale deployment is out of the scope of this document, but it is expected to use standard tools like apache and gunicorn to setup the service.
...@@ -152,23 +172,27 @@ For the examples below we assume server is running on localhost (port 8888) and ...@@ -152,23 +172,27 @@ For the examples below we assume server is running on localhost (port 8888) and
Testing Testing
------- -------
Here is how to run a local paste server. This is useful only for experimenting Here is how to run a local paste server. This is useful only for experimenting
and development and should not be used in production. and development and should not be used in production. We suggest to run this
test in a sandboxed environment e.g., virtualenv
:: ::
sudo apt-get install python-pastedeploy virtualenv mytest
source mytest/bin/activate
pip install Paste PasteDeploy
cp snfOCCI/paste_deploy/test-server.py . cp snfOCCI/paste_deploy/test-server.py .
python test-server.py python test-server.py
server is running on 127.0.0.1:8080 server is running on 127.0.0.1:8080
Follow the test/README.md instructions to setup a client e.g., with docker, and Follow the test/README.md instructions to setup a client e.g., with docker, and
test the application with the prepared queries or the examples bellow. test the application with the prepared queries or the examples of the current
document.
A smart way to test the application is by using the `egifedcloud/fedcloud-userinterface`. Make sure you have valid and authorized proxy certificates in your ${HOME}/.globus directory, and then start a cointainer shell loaded with all necessary client tools. E.g., to perform a "list servers" operation: A smart way to test the application is by using the `egifedcloud/fedcloud-userinterface`. Make sure you have valid and authorized proxy certificates in your ${HOME}/.globus directory, and then start a cointainer shell loaded with all necessary client tools. E.g., to perform a "list servers" operation:
:: ::
$ docker run -v /home/saxtouri/.globus:/root/.globus -it egifedcloud/fedcloud-userinterface /bin/bash $ docker run -v /home/user/.globus:/root/.globus -it egifedcloud/fedcloud-userinterface /bin/bash
# fetch-crl -p 20 # fetch-crl -p 20
# voms-proxy-init --voms fedcloud.egi.eu -rfc # voms-proxy-init --voms fedcloud.egi.eu -rfc
Your proxy is stored at /tmp/x509up_u0 Your proxy is stored at /tmp/x509up_u0
......
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
FROM egifedcloud/fedcloud-userinterface:latest FROM egifedcloud/fedcloud-userinterface:latest
MAINTAINER Stavros Sachtouris <saxtouri@grnet.gr> MAINTAINER Stavros Sachtouris <saxtouri@grnet.gr>
RUN fetch-crl -p 20 | echo "Failed to fetch-crl -p 20" RUN echo "$ fetch-crl -p 20" && \
echo "... this may take a minute ..." && \
fetch-crl -p 20 || \
echo "... OK"
COPY run_functional_tests.sh /data/ COPY run_functional_tests.sh /data/
CMD /bin/bash CMD /bin/bash
Build the image Build the image
--------------- ---------------
$ docker build -t snf-occi-manual-ci:<version>
::
$ docker build -t snf-occi-client:<version> .
This will build a new image, which can be pushed or kept local. This will build a new image, which can be pushed or kept local.
Alternatively, you can, of course, use the grnet repository to build the image:
::
$ docker build -t snf-occi-client:<version> https://github.com/grnet/snf-occi.git#master:test
Run a new container Run a new container
------------------- -------------------
You need either a client proxy or a pair of keys. You need either a client proxy or a pair of keys.
...@@ -11,13 +20,17 @@ You need either a client proxy or a pair of keys. ...@@ -11,13 +20,17 @@ You need either a client proxy or a pair of keys.
If you have a pair of keys, load the directory containing them as /root/.globus If you have a pair of keys, load the directory containing them as /root/.globus
Then run the appropriate commands to generate a proxy Then run the appropriate commands to generate a proxy
$ docker run -v ${HOME}/.globus:/root/.globus -ti snf-occi-manual-ci:latest ::
# fetch -p 20
# voms-proxy-init -voms fedcloud.egi.eu -rfc
If you have a valid proxy, load it somewhere on the machine $ docker run -v ${HOME}/.globus:/root/.globus -ti snf-occi-client:latest
# fetch-crl -p 20
# voms-proxy-init -voms fedcloud.egi.eu -rfc
$ docker run -v my_proxy:/data/my_proxy -ti snf-occi-manual-ci:latest If you already have a valid proxy, load it somewhere on the machine
::
$ docker run -v my_proxy:/data/my_proxy -ti snf-occi-client:latest
What is in the container What is in the container
------------------------ ------------------------
...@@ -27,15 +40,20 @@ a shell script to test the snf-occi application. ...@@ -27,15 +40,20 @@ a shell script to test the snf-occi application.
To run the script, you must set some variables, either when you RUN the To run the script, you must set some variables, either when you RUN the
container or while you are inside the container. container or while you are inside the container.
OCCI_ENDPOINT ::
USER_PROXY
OS_TPL OCCI_ENDPOINT
RESOURCE_TPL USER_PROXY
OS_TPL
RESOURCE_TPL
For instance, if you have a proxy, you may want to run something like: For instance, if you have a proxy, you may want to run something like:
$ docker run -v my_proxy:/data/my_proxy \ ::
$ docker run -v my_proxy:/data/my_proxy \
-e OCCI_ENDPOINT="https://okeanos-occi2.hellasgrid.gr:9000" \ -e OCCI_ENDPOINT="https://okeanos-occi2.hellasgrid.gr:9000" \
-e USER_PROXY="/data/my_proxy" \ -e USER_PROXY="/data/my_proxy" \
-e OS_TPL="debian_base" -e RESOURCE_TPL="c2r2048d20drbd" \ -e OS_TPL="debian_base" -e RESOURCE_TPL="c2r2048d20drbd" \
-ti snf-occi-manual-ci:latest -ti snf-occi-client:latest
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment