Skip to content

Commit

Permalink
Fix building with docker backend
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSimpson committed Feb 2, 2018
1 parent 37d92ea commit 652604f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
25 changes: 19 additions & 6 deletions Builder/scripts/docker-builder-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,33 @@ case ${i} in
esac
done

# Provide read-only access to gitlab registry and dockerhub
docker ${DEBUG_FLAG} login code.ornl.gov:4567 -u ${GITLAB_READONLY_USERNAME} -p ${GITLAB_READONLY_TOKEN}
docker ${DEBUG_FLAG} login code.ornl.gov:4567 -u ${DOCKERHUB_READONLY_USERNAME} -p ${DOCKERHUB_READONLY_TOKEN}
# Provide read only access to the private gitlab docker repository if using the container-recipes docker registry
grep 'FROM code.ornl.gov:4567' ./container.def
GREP_RC=$?
if [[ ${GREP_RC} -eq 0 ]] ; then
echo "Using OLCF Gitlab registry login credentials"
docker ${DEBUG_FLAG} login code.ornl.gov:4567 -u ${GITLAB_READONLY_USERNAME} -p ${GITLAB_READONLY_TOKEN}
fi

# provide read only access to the private olcf dockerhub repository
grep 'FROM olcf/' ./container.def
GREP_RC=$?
if [[ ${GREP_RC} -eq 0 ]] ; then
echo "Using OLCF Dockerhub registry login credentials"
docker ${DEBUG_FLAG} login code.ornl.gov:4567 -u ${DOCKERHUB_READONLY_USERNAME} -p ${DOCKERHUB_READONLY_TOKEN}
fi

# Spin up local registry
docker ${DEBUG_FLAG} run -d -p 5000:5000 --restart=always --name registry registry:2

# Build the Dockerfile docker image in the current directory
mv ./container.def Dockerfile
docker ${DEBUG_FLAG} build -t localhost:5000/docker_image .
docker ${DEBUG_FLAG} build -t localhost:5000/docker_image:latest .

# Push to the local registry
docker ${DEBUG_FLAG} push localhost:5000/docker_image
docker ${DEBUG_FLAG} push localhost:5000/docker_image:latest

# Build the singularity container from the docker image
export SINGULARITY_CACHEDIR=/home/builder/.singularity
singularity ${DEBUG_FLAG} pull --name container.simg docker://localhost:5000/docker_image
export SINGULARITY_NOHTTPS=true
singularity ${DEBUG_FLAG} pull --name container.simg docker://localhost:5000/docker_image:latest
4 changes: 1 addition & 3 deletions Deployment/deploy-summitdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ source ${MODULESHOME}/init/bash
export PATH=$PATH:${MODULESHOME}/bin

module unload xalt
module load gcc
module load cmake/3.9.2

set -x
Expand Down Expand Up @@ -39,7 +38,7 @@ make
make install

# Generate a public modulefile
MF_ROOT=/sw/summitdev/modulefiles/container-builder
MF_ROOT=/sw/summitdev/modulefiles/core/container-builder
mkdir -p ${MF_ROOT}

# Grab latest queue host
Expand All @@ -51,7 +50,6 @@ cat << EOF > ${MF_ROOT}/${VERSION}
setenv QUEUE_HOST ${QUEUE_HOST}
setenv QUEUE_PORT 8080
module load gcc
prepend-path LD_LIBRARY_PATH ${SW_ROOT}/lib
prepend-path PATH ${SW_ROOT}/bin
EOF

0 comments on commit 652604f

Please sign in to comment.