Commit 076c6975 authored by Cresson Remi's avatar Cresson Remi
Browse files

CI: deploy CPU and GPU images

1 merge request!5Update otbtf version
Pipeline #36505 failed
Showing with 52 additions and 17 deletions
+52 -17
variables:
TEST_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
CPU_IMAGE_NAME: $CI_REGISTRY_IMAGE:cpu
GPU_IMAGE_NAME: $CI_REGISTRY_IMAGE:gpu
DOCKER_BUILDKIT: 1
DOCKER_DRIVER: overlay2
CPU_BASE_IMAGE: gitlab-registry.irstea.fr/remi.cresson/otbtf/3.2.1:cpu-basic-dev
GPU_BASE_IMAGE: gitlab-registry.irstea.fr/remi.cresson/otbtf/3.2.1:gpu-basic-dev
workflow: workflow:
rules: rules:
...@@ -35,19 +43,16 @@ Build the docker image: ...@@ -35,19 +43,16 @@ Build the docker image:
- > - >
docker build docker build
--pull --pull
--cache-from $CI_REGISTRY_IMAGE:latest --cache-from $CI_REGISTRY_IMAGE:cpu
--label "org.opencontainers.image.title=$CI_PROJECT_TITLE" --cache-from $TEST_IMAGE_NAME
--label "org.opencontainers.image.url=$CI_PROJECT_URL" --tag $TEST_IMAGE_NAME
--label "org.opencontainers.image.created=$CI_JOB_STARTED_AT" --build-arg "BASE_IMAGE=$CPU_BASE_IMAGE"
--label "org.opencontainers.image.revision=$CI_COMMIT_SHA" --build-arg BUILDKIT_INLINE_CACHE=1
--label "org.opencontainers.image.version=$CI_COMMIT_REF_NAME"
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
--build-arg "BASE_IMAGE=gitlab-registry.irstea.fr/remi.cresson/otbtf/3.2.1:cpu-basic-dev"
. .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME - docker push $TEST_IMAGE_NAME
.static_analysis_base: .static_analysis_base:
image: $CI_REGISTRY_IMAGE:latest image: $TEST_IMAGE_NAME
stage: Static Analysis stage: Static Analysis
allow_failure: true allow_failure: true
...@@ -67,7 +72,7 @@ codespell: ...@@ -67,7 +72,7 @@ codespell:
- sudo pip install codespell && codespell --skip="*.png,*.template,*.pbs,*.jpg,*git/lfs*" - sudo pip install codespell && codespell --skip="*.png,*.template,*.pbs,*.jpg,*git/lfs*"
.applications_test_base: .applications_test_base:
image: $CI_REGISTRY_IMAGE:latest image: $TEST_IMAGE_NAME
stage: Tests stage: Tests
before_script: before_script:
- export PYTHONPATH=$PYTHONPATH:$PWD - export PYTHONPATH=$PYTHONPATH:$PWD
...@@ -103,7 +108,6 @@ inference: ...@@ -103,7 +108,6 @@ inference:
script: script:
- pytest -o log_cli=true --log-cli-level=INFO --junitxml=report_inference.xml tests/inference_unittest.py - pytest -o log_cli=true --log-cli-level=INFO --junitxml=report_inference.xml tests/inference_unittest.py
s1_prepare: s1_prepare:
extends: .applications_test_base extends: .applications_test_base
script: script:
...@@ -129,13 +133,44 @@ train_from_tfrecords: ...@@ -129,13 +133,44 @@ train_from_tfrecords:
script: script:
- pytest -o log_cli=true --log-cli-level=INFO --junitxml=report_train_from_tfrecords.xml tests/train_from_tfrecords_unittest.py - pytest -o log_cli=true --log-cli-level=INFO --junitxml=report_train_from_tfrecords.xml tests/train_from_tfrecords_unittest.py
deploy: .ship_base:
stage: Ship stage: Ship
only: only:
- master - master
extends: .dind_base extends: .dind_base
cpu_deploy:
extends: .ship_base
script: script:
- echo "Shipping!" - >
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME docker build
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $CI_REGISTRY_IMAGE:latest --pull
- docker push $CI_REGISTRY_IMAGE:latest --cache-from $CPU_IMAGE_NAME
--cache-from $TEST_IMAGE_NAME
--label "org.opencontainers.image.title=$CI_PROJECT_TITLE"
--label "org.opencontainers.image.url=$CI_PROJECT_URL"
--label "org.opencontainers.image.created=$CI_JOB_STARTED_AT"
--label "org.opencontainers.image.revision=$CI_COMMIT_SHA"
--label "org.opencontainers.image.version=$CI_COMMIT_REF_NAME"
--tag $CPU_IMAGE_NAME
--build-arg "BASE_IMAGE=$CPU_BASE_IMAGE"
--build-arg BUILDKIT_INLINE_CACHE=1
.
- docker push $CPU_IMAGE_NAME
gpu_deploy:
extends: .ship_base
- >
docker build
--pull
--cache-from $GPU_IMAGE_NAME
--label "org.opencontainers.image.title=$CI_PROJECT_TITLE"
--label "org.opencontainers.image.url=$CI_PROJECT_URL"
--label "org.opencontainers.image.created=$CI_JOB_STARTED_AT"
--label "org.opencontainers.image.revision=$CI_COMMIT_SHA"
--label "org.opencontainers.image.version=$CI_COMMIT_REF_NAME"
--tag $GPU_IMAGE_NAME
--build-arg "BASE_IMAGE=$GPU_BASE_IMAGE"
--build-arg BUILDKIT_INLINE_CACHE=1
.
- docker push $GPU_IMAGE_NAME
Supports Markdown
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