duracloud / mill

The Duplication project provides the tools and pieces with which together manage the process of duplicating files between storage providers in DuraCloud.
Apache License 2.0
2 stars 7 forks source link

Adds docker #50

Closed dbernstein closed 2 years ago

dbernstein commented 3 years ago

This update includes all changes required to run the mill in docker.

The docker image contains all the binaries and scripts required to run all of the various nodes that comprise the mill. Which node the docker container is running as depends on the $NODE_TYPE environment variable which can be set to any of the following values:

To build the docker container:

platforms=linux/amd64; docker buildx build  --build-arg VERSION=4.1.0-SNAPSHOT -f docker/Dockerfile --platform ${platforms}  -t duracloud/mill .

This is how I'm running it in duracloud-aws-deployer:

#!/bin/bash
millHome=/tmp/mill-home
mkdir -p $millHome

#copy configuration bucket contents to mill home
aws s3 cp --recursive s3://${mill_s3_config_location} $millHome/

instanceId=`ls /var/lib/cloud/instances`

docker run -d -it -v /sys/fs/cgroup/:/sys/fs/cgroup:ro --cap-add SYS_ADMIN -e HOST_NAME="${instance_prefix}-${node_type}-$instanceId" -e DOMAIN=${domain} -e NODE_TYPE="${node_type}" -e AWS_REGION="${aws_region}" -v $millHome:/mill-home  -v /efs:/efs --name=duracloud-mill  ${mill_docker_container}:${mill_version};

Notice -v /sys/fs/cgroup/:/sys/fs/cgroup:ro --cap-add SYS_ADMIN:

This is necessary to get cron to work on the nodes that require it (namely the sentinel). It should be noted that the volume mapping is specific to debian.

dbernstein commented 2 years ago

@bbranan : this should be good to go.