Commit f7db5654 authored by Jesus Alvarez's avatar Jesus Alvarez

Fix docker push command

parent e84e0edd
......@@ -9,7 +9,7 @@ variables:
OS: "${CI_COMMIT_REF_NAME}"
before_script:
- apk add --no-cache git bash
- apk add --no-cache git bash findutils
- if [[ -n $NV_CI_INTERNAL ]]; then
export REGISTRY="gitlab-master.nvidia.com:5005";
export REGISTRY_USER="gitlab-ci-token";
......@@ -27,47 +27,64 @@ stages:
.cuda_base_template: &cuda_base_definition
stage: cuda
script:
- VERSION="${CI_JOB_NAME:1}"
- docker build -t "${IMAGE_NAME}:${VERSION}-base-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-base-${OS}-disable"
"${VERSION}/base"
- docker build -t "${IMAGE_NAME}:${VERSION}-runtime-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-runtime-${OS}-disable"
--build-arg "IMAGE_NAME=${IMAGE_NAME}"
"${VERSION}/runtime"
- docker build -t "${IMAGE_NAME}:${VERSION}-devel-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-devel-${OS}-disable"
--build-arg "IMAGE_NAME=${IMAGE_NAME}"
"${VERSION}/devel"
- if [[ "${NO_OS_SUFFIX}" == true ]]; then
docker tag "${IMAGE_NAME}:${VERSION}-base-${OS}" "${IMAGE_NAME}:${VERSION}-base";
docker tag "${IMAGE_NAME}:${VERSION}-runtime-${OS}" "${IMAGE_NAME}:${VERSION}-runtime";
docker tag "${IMAGE_NAME}:${VERSION}-devel-${OS}" "${IMAGE_NAME}:${VERSION}-devel";
fi
- if [[ "${LATEST}" == true ]]; then
docker tag "${IMAGE_NAME}:${VERSION}-devel-${OS}" "${IMAGE_NAME}:latest";
fi
- VERSION="${CI_JOB_NAME:1}"
- docker build -t "${IMAGE_NAME}:${VERSION}-base-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-base-${OS}-disable"
"${VERSION}/base"
- docker build -t "${IMAGE_NAME}:${VERSION}-runtime-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-runtime-${OS}-disable"
--build-arg "IMAGE_NAME=${IMAGE_NAME}"
"${VERSION}/runtime"
- docker build -t "${IMAGE_NAME}:${VERSION}-devel-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-devel-${OS}-disable"
--build-arg "IMAGE_NAME=${IMAGE_NAME}"
"${VERSION}/devel"
- if [[ "${NO_OS_SUFFIX}" == true ]]; then
docker tag "${IMAGE_NAME}:${VERSION}-base-${OS}" "${IMAGE_NAME}:${VERSION}-base";
docker tag "${IMAGE_NAME}:${VERSION}-runtime-${OS}" "${IMAGE_NAME}:${VERSION}-runtime";
docker tag "${IMAGE_NAME}:${VERSION}-devel-${OS}" "${IMAGE_NAME}:${VERSION}-devel";
fi
- if [[ "${LATEST}" == true ]]; then
docker tag "${IMAGE_NAME}:${VERSION}-devel-${OS}" "${IMAGE_NAME}:latest";
fi
.cudnn_template: &cudnn_definition
stage: cudnn
script:
- VERSION="${CI_JOB_NAME:1}"
- CUDA_VERSION="${VERSION%-*}"
- CUDNN_VERSION="${VERSION#*-}"
- docker images
- docker ps
- docker build -t "${IMAGE_NAME}:${VERSION}-runtime-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-runtime-${OS}-disable"
--build-arg "IMAGE_NAME=${IMAGE_NAME}"
"${CUDA_VERSION}/runtime/${CUDNN_VERSION}"
- docker build -t "${IMAGE_NAME}:${VERSION}-devel-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-devel-${OS}-disable"
--build-arg "IMAGE_NAME=${IMAGE_NAME}"
"${CUDA_VERSION}/devel/${CUDNN_VERSION}"
- if [[ "${NO_OS_SUFFIX}" == true ]]; then
docker tag "${IMAGE_NAME}:${VERSION}-runtime-${OS}" "${IMAGE_NAME}:${VERSION}-runtime";
docker tag "${IMAGE_NAME}:${VERSION}-devel-${OS}" "${IMAGE_NAME}:${VERSION}-devel";
fi
- VERSION="${CI_JOB_NAME:1}"
- CUDA_VERSION="${VERSION%-*}"
- CUDNN_VERSION="${VERSION#*-}"
- docker images
- docker ps
- docker build -t "${IMAGE_NAME}:${VERSION}-runtime-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-runtime-${OS}-disable"
--build-arg "IMAGE_NAME=${IMAGE_NAME}"
"${CUDA_VERSION}/runtime/${CUDNN_VERSION}"
- docker build -t "${IMAGE_NAME}:${VERSION}-devel-${OS}"
--cache-from "${IMAGE_NAME}:${VERSION}-devel-${OS}-disable"
--build-arg "IMAGE_NAME=${IMAGE_NAME}"
"${CUDA_VERSION}/devel/${CUDNN_VERSION}"
- if [[ "${NO_OS_SUFFIX}" == true ]]; then
docker tag "${IMAGE_NAME}:${VERSION}-runtime-${OS}" "${IMAGE_NAME}:${VERSION}-runtime";
docker tag "${IMAGE_NAME}:${VERSION}-devel-${OS}" "${IMAGE_NAME}:${VERSION}-devel";
fi
.test_template: &test_definition
stage: test
script:
- CUDA_VERSION="${CI_JOB_NAME%-*}"
- CUDA_TEST_VERSION="${CUDA_VERSION:1}"
- git clone https://gitlab.com/nvidia/cuda-docker-test.git
- cd cuda-docker-test/
- git log -1 --pretty=oneline
- bash -e ./scripts/bats_install.sh
- bash -e ./scripts/run_tests.sh
.deploy_template: &deploy_definition
stage: deploy
script:
- CUDA_VERSION="${CI_JOB_NAME%-*}"
- docker images | grep ${IMAGE_NAME} | grep "${CUDA_VERSION:1}" | grep "\(${OS}\ \|-base\ \|-devel\ \|-runtime\ \)" | awk '{ print $1":"$2 }' | xargs -L1 docker push
v9.2:
tags:
......@@ -83,27 +100,16 @@ v9.2-cudnn7:
NO_OS_SUFFIX: "true"
<<: *cudnn_definition
# FIXME: need a runner with cuda 9.2
.v9.2-test:
stage: test
tags:
- cuda-docker
variables:
CUDA_TEST_VERSION: "9.2"
script:
- git clone https://gitlab.com/nvidia/cuda-docker-test.git
- cd cuda-docker-test/
- git log -1 --pretty=oneline
- bash -e ./scripts/bats_install.sh
- bash -e ./scripts/run_tests.sh
<<: *test_definition
v9.2-deploy:
stage: deploy
tags:
- cuda-docker
script:
- docker images | grep ${IMAGE_NAME} | grep "9.2" | grep "\(${OS}\ \|-base\ \|-devel\ \|-runtime\ \)" | awk '{ print $1":"$2 }' | xargs docker push
- cuda-docker
<<: *deploy_definition
v10.0:
tags:
......@@ -121,24 +127,14 @@ v10.0-cudnn7:
# FIXME: need a runner with cuda 10.0
.v10.0-test:
stage: test
tags:
- cuda-docker-10.1
variables:
CUDA_TEST_VERSION: "10.0"
script:
- git clone https://gitlab.com/nvidia/cuda-docker-test.git
- cd cuda-docker-test/
- git log -1 --pretty=oneline
- bash -e ./scripts/bats_install.sh
- bash -e ./scripts/run_tests.sh
- cuda-docker
<<: *test_definition
v10.0-deploy:
stage: deploy
tags:
- cuda-docker
script:
- docker images | grep ${IMAGE_NAME} | grep "10.0" | grep "\(${OS}\ \|-base\ \|-devel\ \|-runtime\ \)" | awk '{ print $1":"$2 }' | xargs docker push
- cuda-docker
<<: *deploy_definition
v10.1:
tags:
......@@ -155,22 +151,13 @@ v10.1-cudnn7:
NO_OS_SUFFIX: "true"
<<: *cudnn_definition
v10.1-test:
stage: test
# FIXME: need a runner with cuda 10.1
.v10.1-test:
tags:
- cuda-docker-10.1
variables:
CUDA_TEST_VERSION: "10.1"
script:
- git clone https://gitlab.com/nvidia/cuda-docker-test.git
- cd cuda-docker-test/
- git log -1 --pretty=oneline
- bash -e ./scripts/bats_install.sh
- bash -e ./scripts/run_tests.sh
<<: *test_definition
v10.1-deploy:
stage: deploy
tags:
- cuda-docker-10.1
script:
- docker images | grep ${IMAGE_NAME} | grep "10.1" | grep "\(${OS}\ \|-base\ \|-devel\ \|-runtime\ \)" | awk '{ print $1":"$2 }'
- cuda-docker-10.1
<<: *deploy_definition
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment