Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds docker #50

Merged
merged 12 commits into from
Jan 26, 2022
Merged

Adds docker #50

merged 12 commits into from
Jan 26, 2022

Conversation

dbernstein
Copy link
Member

@dbernstein dbernstein commented Nov 8, 2021

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:

  • sentinel
  • audit-worker
  • bit-worker
  • dup-worker
  • storage-stats-worker
  • bit-report-worker

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.

docker/Dockerfile Outdated Show resolved Hide resolved
docker/Dockerfile Outdated Show resolved Hide resolved
docker/Dockerfile Outdated Show resolved Hide resolved
Copy link
Member

@bbranan bbranan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me @dbernstein, sorry it took so long to get to a review. I'd only suggest dropping the dockerhub script (to avoid future confusion) before a merge.

@dbernstein
Copy link
Member Author

@bbranan : this should be good to go.

@bbranan bbranan merged commit ef4ba4a into duracloud:develop Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants