Wiki

Clone wiki

go-docker / Usertutorial

Job submission

godocker_tuto1.png

godocker_tuto2.png

Interactive access

To be interactive eligible, the container image must have sshd installed.

To connect to the container, one must login with user id at container IP and port (see task details). If root access is asked, then user log with root user.

By default, connection is done using the public SSH key given in the user profile. User can also connect with login/password using his API Key (see in profile) as password.

Job properties

Once job is running (or over), one can view its properties by clicking on its job identifier (or using godjob command line).

Among other things, one can get the container id (for debug), the available volumes with their local path and their path in the container.

Job data directory

A per job directory is created and available in the container. User can write in this directory and download files via the web interface or the godjob command (during job run or after). The location of this directory is available in job properties and at $GODOCKER_PWD environment variable (its host location can be seen in job properties, to be copied later on for example).

When job is archived, job data directory is deleted. Archive time is a global configuration parameter (administrator).

When root access is required, all directories, but the job data directory, are available as read-only, for security and access reasons (as root in container, all data would be written as root in user home directory for example). User should write in this temporary directory then download or copy them.

Job results

The standard output and error of the task are available in the job data directory (god.log and god.err). An additional file named god.info contains the exact start and stop unix timestamp of the task (not the container start/stop but the process itself).

Executing a script to execute multiple jobs

If it possible to jobs/scripts from a container.

  • install godocker_CLI via pip (you may need to install pip first)
  • in your script execute jobs with the --wait option

Installing pip and godocker_CLI on CentOS7:

rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
yum install -y python-pip
pip install godocker_CLI

Example, launch a job with this kind of script, mounting your home directory:

#!/bin/bash
godlogin -a MYAPIKEY -l MYUSERID
# Execute a job, mounting home directory and wait for its completion
godjob create -n job_name -d "example job" -i centos:latest --cmd "touch $GODOCKER_HOME/over.txt && sleep 60" --wait -v home
if [ -e $GODOCKER_HOME/over.txt ]; then
    godjob create -n job_name2 -d "example job 2" -i centos:latest --cmd "touch $GODOCKER_HOME/overagain.txt && sleep 60" --wait -v home
else
    echo "job failed"
fi

Updated