Skip to content

Enabling docker universe.

Maiken requested to merge (removed):htcondor_docker into master

Add possibility to submit jobs that run in docker container in htcondor.

To test out:

0)

Install and enable dockerand condor, and add user submitting the ARC job to the docker-group

1)

Map docker user in arc.conf e.g. like this if you have called your docker user dockerroot and the docker group dockerroot

[authgroups:alloweddockerusers]
subject=<your-openssl-identity>

[mapping]
unixmap=dockerroot:dockerroot authgroup alloweddockerusers

2)

Create a runtime environment file called DOCKER and place it in /ENV/DOCKER.

#!/bin/bash
export DOCKER_UNIVERSE=docker
export DOCKER_IMAGE=$2

Enable it with

arcctl rte enable ENV/DOCKER

3)

Create a job description file e.g. like this:

&(executable=runhello.sh)
(jobname=hello_docker)
(runtimeenvironment="ENV/DOCKER" "debian")
(stdout=std.out)
(stderr=std.err)
(cpuTime="1 hours")
(memory="1")
(inputfiles=(""))
(outputfiles=("output.txt" "" ))

With some executable runhello.sh e.g. like so:

#!/bin/sh
echo "Hello! Am sleeping for 120 seconds" >> output.txt
sleep 120
exit 

4)

Submit the job with e.g. arcsub

5)

Check that the docker container is running for the job sudo docker ps

Edited by Maiken

Merge request reports

Loading