Newer
Older
- if: $CI_COMMIT_TAG
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Avoid duplicated pipelines in MR context
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_MESSAGE =~ /^wip.*/i
OTBTF_SRC: /src/otbtf # OTBTF source directory path in image
DATADIR: $CI_PROJECT_DIR/test/data
CACHE_IMAGE_CPU: $CI_REGISTRY_IMAGE:build-cache-cpu
CACHE_IMAGE_GPU: $CI_REGISTRY_IMAGE:build-cache-gpu
BRANCH_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
BUILDX_BUILDER: container
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
default:
tags: [ godzilla ]
interruptible: true
image:
name: $BRANCH_IMAGE
pull_policy: always
.docker_build_base:
Vincent Delbar
committed
image: docker:27.3.1
services:
Vincent Delbar
committed
- name: docker:27.3.1-dind
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- docker buildx create --name=container --driver=docker-container --use --bootstrap
after_script:
- docker buildx rm --keep-state container
docker buildx build --push -t $BRANCH_IMAGE
--cache-from type=registry,ref=$CACHE_IMAGE_CPU
Vincent Delbar
committed
--cache-to type=registry,ref=$CACHE_IMAGE_CPU,mode=max
Vincent Delbar
committed
rules:
Vincent Delbar
committed
- codespell otbtf doc README.md
- cd $OTBTF_SRC/ && cppcheck --enable=all --error-exitcode=1 -I include/ --suppress=missingInclude --suppress=unusedFunction .
Vincent Delbar
committed
tags: [ stable ]
- if: $CI_COMMIT_TAG
when: never
- if: $CI_COMMIT_REF_NAME == /master/
variables:
PTH: public
reports:
junit: report_*.xml
OTB_TEST_UNITS: "Tensorflow|PanSharpening|Projection|Transform|IOGDAL"
- cd /src/otb/otb && git lfs pull
- ln -s $CI_PROJECT_DIR/test/data $OTBTF_SRC/test/data
- ln -s $CI_PROJECT_DIR/test/models $OTBTF_SRC/test/models
- ctest -L $OTB_TEST_UNITS --output-junit $CI_PROJECT_DIR/report_ctest.xml
after_script:
- cp -r $OTB_BUILD/Testing/Temporary/* $CI_PROJECT_DIR/artifacts_ctest
artifacts:
paths:
stage: Test
extends: .tests_base
variables:
API_TEST_TMP: /tmp/api_tests_tmp
script:
- mkdir $API_TEST_TMP
- TMPDIR=$API_TEST_TMP python -m pytest -svv --junitxml=report_api.xml test/api_unittest.py
- saved_model_cli show --dir $API_TEST_TMP/model_from_pimg --all
.applications_test_base:
stage: Applications Test
# crc_book:
# extends: .applications_test_base
# variables:
# CRC_BOOK_TMP: /tmp/crc_book_tests_tmp
# script:
# - mkdir -p $CRC_BOOK_TMP
# - TMPDIR=$CRC_BOOK_TMP python -m pytest -v --junitxml=report_tutorial.xml test/tutorial_unittest.py
# after_script:
# - cp -r $CRC_BOOK_TMP $CI_PROJECT_DIR/artifacts_crc_book
# artifacts:
# paths:
# - $CI_PROJECT_DIR/artifacts_crc_book
variables:
DATASET_DECLOUD: https://nextcloud.inrae.fr/s/aNTWLcH28zNomqk/download
- git clone https://forgemia.inra.fr/umr-tetis/decloud.git -b keras3
- wget -q $DATASET_DECLOUD -O file.zip && unzip file.zip
- pytest -v decloud/tests/train_from_tfrecords_unittest.py
DATASET_S2: https://nextcloud.inrae.fr/s/EZL2JN7SZyDK8Cf/download/sr4rs_sentinel2_bands4328_france2020_savedmodel.zip
DATASET_SR4RS: https://nextcloud.inrae.fr/s/kDms9JrRMQE2Q5z/download
- wget -qO sr4rs_sentinel2_bands4328_france2020_savedmodel.zip $DATASET_S2
- unzip -o sr4rs_sentinel2_bands4328_france2020_savedmodel.zip
- wget -qO sr4rs_data.zip $DATASET_SR4RS
- unzip -o sr4rs_data.zip
- rm -rf sr4rs
- git clone https://github.com/remicres/sr4rs.git
- export PYTHONPATH=$PYTHONPATH:$PWD/sr4rs
- python -m pytest -v --junitxml=report_sr4rs.xml test/sr4rs_unittest.py
geos_enabled:
extends: .applications_test_base
script:
- python -m pytest -v --junitxml=report_geos_enabled.xml test/geos_test.py
planetary_computer:
extends: .applications_test_base
script:
- pip install pystac_client planetary_computer
- python -m pytest -v --junitxml=report_pc_enabled.xml test/pc_test.py
numpy_gdal_otb:
extends: .applications_test_base
script:
- python -m pytest -v --junitxml=report_numpy.xml test/numpy_test.py
rio:
extends: .applications_test_base
script:
- pip install rasterio --no-binary rasterio
- python -m pytest -v --junitxml=report_rio.xml test/rio_test.py
nodata:
extends: .applications_test_base
script:
- python -m pytest -v --junitxml=report_nodata.xml test/nodata_test.py
variables:
DOCKERHUB_BASE: mdl4eo/otbtf
CI_REGISTRY_PUBIMG: $CI_REGISTRY_IMAGE:$OTBTF_VERSION
DOCKERHUB_IMAGE_BASE: $DOCKERHUB_BASE:$OTBTF_VERSION
IMAGE_CPU: $CI_REGISTRY_PUBIMG-cpu
IMAGE_CPUDEV: $CI_REGISTRY_PUBIMG-cpu-dev
DOCKERHUB_CPU: $DOCKERHUB_IMAGE_BASE-cpu
DOCKERHUB_CPUDEV: $DOCKERHUB_IMAGE_BASE-cpu-dev
DOCKERHUB_LATEST: $DOCKERHUB_BASE:latest
script:
# cpu
- >
docker buildx build --push -t $IMAGE_CPU
--cache-from type=registry,ref=$CACHE_IMAGE_CPU
- >
docker buildx build --push -t $IMAGE_CPUDEV
--cache-from type=registry,ref=$CACHE_IMAGE_CPU
--build-arg DEV_IMAGE=true
# push images on dockerhub
- echo -n $DOCKERHUB_TOKEN | docker login -u mdl4eo --password-stdin
- docker tag $IMAGE_CPU $DOCKERHUB_CPU && docker push $DOCKERHUB_CPU
- docker tag $IMAGE_CPUDEV $DOCKERHUB_CPUDEV && docker push $DOCKERHUB_CPUDEV
- docker tag $IMAGE_CPU $DOCKERHUB_LATEST && docker push $DOCKERHUB_LATEST
deploy_gpu:
IMAGE_GPU: $CI_REGISTRY_PUBIMG-gpu
IMAGE_GPUDEV: $CI_REGISTRY_PUBIMG-gpu-dev
DOCKERHUB_GPU: $DOCKERHUB_IMAGE_BASE-gpu
DOCKERHUB_GPUDEV: $DOCKERHUB_IMAGE_BASE-gpu-dev
DOCKERHUB_GPULATEST: $DOCKERHUB_BASE:latest-gpu
# gpu
- >
docker buildx build --push -t $IMAGE_GPU
--cache-from type=registry,ref=$CACHE_IMAGE_GPU
--cache-from type=registry,ref=$CACHE_IMAGE_CPU
Vincent Delbar
committed
--cache-to type=registry,ref=$CACHE_IMAGE_GPU,mode=max
# gpu-dev
- >
docker buildx build --push -t $IMAGE_GPUDEV
--cache-from type=registry,ref=$CACHE_IMAGE_GPU
--cache-from type=registry,ref=$CACHE_IMAGE_CPU
--build-arg WITH_CUDA=true --build-arg DEV_IMAGE=true
# push gpu-* images on dockerhub
- echo -n $DOCKERHUB_TOKEN | docker login -u mdl4eo --password-stdin
- docker tag $IMAGE_GPU $DOCKERHUB_GPU && docker push $DOCKERHUB_GPU
- docker tag $IMAGE_GPUDEV $DOCKERHUB_GPUDEV && docker push $DOCKERHUB_GPUDEV
- docker tag $IMAGE_GPU $DOCKERHUB_GPULATEST && docker push $DOCKERHUB_GPULATEST