ODAM is an Experiment Data Table Management System (EDTMS) that gives you an open access to your data and make them ready to be mined - A data explorer as bonus
mkdir /opt/DataRepos
Note: Adapt the value of the variables GETDATA_PORT, DATAEXPLORER_PORT, GETDATA_URL_PROXY and GETDATA_DATAREPOS according to your site.
#!/bin/bash
MYDIR=`dirname $0` && [ ! `echo "$0" | grep '^\/'` ] && MYDIR=`pwd`/$MYDIR
# Indicate if we are behind a VPN
VPN=0
# GetData Container
GETDATA_PORT=8081
GETDATA_IMAGE=odam/getdata:latest
GETDATA_CONTAINER=gdata
# Dataexplorer Container
DATAEXPLORER_PORT=8080
DATAEXPLORER_IMAGE=odam/dataexplorer:latest
DATAEXPLORER_CONTAINER=dataexplorer
# URL Proxy for the "getdata" web-services
GETDATA_URL_PROXY=http://my_host.com:$GETDATA_PORT/
# Path root of the data repository
GETDATA_DATAREPOS=/opt/DataRepos/
CMD=$1
# Use a local directory to share the datasets within the container
VOLS="-v $GETDATA_DATAREPOS:/opt/data"
usage() { echo "usage: sh $0 start|stop|restart|ps|pull"; exit 1; }
case "$CMD" in
start)
# run getData
sudo docker run -d -e "GETDATA_URL_PROXY="$GETDATA_URL_PROXY $VOLS \
-e "VPN="$VPN \
-p $GETDATA_PORT:80 \
--name $GETDATA_CONTAINER $GETDATA_IMAGE
# run dataexplorer
sudo docker run -d -e "GETDATA_URL_PROXY="$GETDATA_URL_PROXY \
-e "VPN="$VPN \
-p $DATAEXPLORER_PORT:3838 \
--name $DATAEXPLORER_CONTAINER $DATAEXPLORER_IMAGE
# show logs
sudo docker logs $GETDATA_CONTAINER
sudo docker logs $DATAEXPLORER_CONTAINER
;;
stop)
sudo docker rm -f $GETDATA_CONTAINER $DATAEXPLORER_CONTAINER
;;
restart)
( sh $0 stop ; sh $0 start )
;;
ps)
sudo docker ps | head -1
sudo docker ps | grep "odam/"
;;
pull)
sudo docker pull $GETDATA_IMAGE
sudo docker pull $DATAEXPLORER_IMAGE
;;
*) usage
exit 2
esac
sh ./odam pull
cd /opt/DataRepos
wget https://data.inra.fr/api/access/datafile/:persistentId/?persistentId=doi:10.15454/95JUTK/P0ZJMJ -O frim1.zip
unzip frim1.zip
rm -f frim1.zip
sh ./odam start
Then, launch into your web browser, the data explorer: http://my_host.com:8080/?ds=frim1
To query using the API : http://my_host.com:8081/query/frim1/
sh ./odam ps
sh ./odam stop
For avanced users: In case you would like to use a proxy server, the better is to install and set NGINX, an HTTP and reverse proxy server.
In the /etc/nginx/conf.d/my-site.conf, you should add two 'location' sections as shown below:
server {
listen 80 default;
server_name $host;
...
location /getdata/ {
proxy_pass http://$host:8081;
}
location /dataexplorer/ {
proxy_pass http://$host:8080;
}
...
}
In this way, you can use the URL http://my_host.com/getdata/... for API and the URL http://my_host.com/dataexplorer/... for the data explorer
Content type
Image
Digest
sha256:b852c9163…
Size
321 MB
Last updated
over 1 year ago
docker pull odam/getdata