From 652604f40444afa8bdc7a2800309df6cc95c0435 Mon Sep 17 00:00:00 2001 From: atj Date: Fri, 2 Feb 2018 13:11:42 -0500 Subject: [PATCH] Fix building with docker backend --- Builder/scripts/docker-builder-backend.sh | 25 +++++++++++++++++------ Deployment/deploy-summitdev.sh | 4 +--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Builder/scripts/docker-builder-backend.sh b/Builder/scripts/docker-builder-backend.sh index 2c42211..1147930 100755 --- a/Builder/scripts/docker-builder-backend.sh +++ b/Builder/scripts/docker-builder-backend.sh @@ -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 \ No newline at end of file +export SINGULARITY_NOHTTPS=true +singularity ${DEBUG_FLAG} pull --name container.simg docker://localhost:5000/docker_image:latest \ No newline at end of file diff --git a/Deployment/deploy-summitdev.sh b/Deployment/deploy-summitdev.sh index 3184b21..8d919d4 100755 --- a/Deployment/deploy-summitdev.sh +++ b/Deployment/deploy-summitdev.sh @@ -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 @@ -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 @@ -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 \ No newline at end of file