Sign inSign up

odam/getdata

By odam

•Updated over 1 year ago

Image
1

1.7K

odam/getdata repository overview

⁠ODAM - Open Data for Access and Mining

⁠Give an open access to your data and make them ready to be mined
  • 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

  • See ODAM: Deployment and User's Guide⁠


⁠How to use this image

⁠1- Create your local data repository :
  • Example
mkdir /opt/DataRepos
.
⁠2- Create a small script
  • Create a small script called 'odam' containing the following code:

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
⁠.
⁠3 - Get the docker images from DockerHub
  • (may take a while depending on your network speed and the traffic)
sh ./odam pull
⁠.
⁠4 - Get the complete FRIM dataset as an example
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
⁠.
⁠5 - Start the application
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/

⁠.
⁠6 - Status of the application
sh ./odam ps
⁠.
⁠7 - When finished, stop the application
sh ./odam stop

⁠NGINX configuration (Linux)

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

⁠Information on this Docker image

Tag summary

Content type

Image

Digest

sha256:b852c9163…

Size

321 MB

Last updated

over 1 year ago

docker pull odam/getdata