Skip to content
Snippets Groups Projects
Commit 1744311e authored by Guillaume Eynard-Bontemps's avatar Guillaume Eynard-Bontemps
Browse files

Merge branch '133-docker-tests' into 'develop'

Resolve "Add docker tests"

Closes #133

See merge request !131
parents 99acb1d1 eb71f562
No related branches found
No related tags found
2 merge requests!139Merge develop 1.12 into master,!131Resolve "Add docker tests"
......@@ -171,7 +171,7 @@ ARG GIT_TOKEN
RUN if [ -f "/kaniko/run/secrets/http_proxy" ]; then export http_proxy=$(cat /kaniko/run/secrets/http_proxy); export https_proxy=$(cat /kaniko/run/secrets/https_proxy); fi && \
mkdir -p /install && \
cd /install && \
git -c http.sslVerify=false clone --branch master https://${GIT_USER}:${GIT_TOKEN}@gitlab.cnes.fr/eolab/processing/rastertools.git && \
git clone --branch 0.6.0 https://github.com/CNES/rastertools.git && \
export PYTHONWARNINGS="ignore:Unverified HTTPS request" && \
pip3 install \
--trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org \
......
# How to use this Dockerfile
## Retrieve OTB 7
## Retrieve OTB 8
OTB and its dependances can be retrieved at https://www.orfeo-toolbox.org/
We need :
* otb.tar.gz
......@@ -15,4 +15,18 @@ LIS can be retrieve from this repository by git clone and compress into the Dock
## Run
`docker run --rm -it lis`
or define an entrypoint
\ No newline at end of file
or define an entrypoint;
## Validation
You can validate the docker image created with the tests available in the "docker/tests" folder.
There is actually four tests :
- FSC snow coverage on l8
- FSC snow coverage on S2 with classic hillshade method
- FSC snow coverage on S2 with rastertools
- Snow synthesis on one month
To launch a test : `docker run -v ./docker/tests:/tests -v __input_data_folder__:/input-data -v __baseline_folder__:/baseline lis /tests/tests-<name_test>.sh /input-data /baseline`
The input data folder and baseline folder must be the same folders used for LIS validation tests.
\ No newline at end of file
#!/bin/bash -u
# Usage: test-fsc-snow-l8.sh <data-test> <baseline>
DATA_TEST=$1
BASELINE=$2
test_name="l8"
# Cleanup
rm -rf ${test_name}
# Run test
let_it_snow_fsc.py \
-c ${DATA_TEST}/Landsat/lis_configuration.json \
-i ${DATA_TEST}/Landsat/LANDSAT8_OLITIRS_XS_20170308_N2A_France-MetropoleD0004H0001 \
-d ${DATA_TEST}/Landsat/LANDSAT8_OLITIRS_XS_20170308_N2A_France-MetropoleD0004H0001/SRTM/dem.tif \
-o ${test_name}
# Output comparison
errors=0
echo "-- Comparison pass1"
gdalcompare.py ${BASELINE}/l8_test/pass1.tif ${test_name}/tmp/snow_pass1.tif
errors=$((errors+$?))
echo "-- Comparison pass2"
gdalcompare.py ${BASELINE}/l8_test/pass2.tif ${test_name}/tmp/snow_pass2.tif
errors=$((errors+$?))
echo "-- Comparison pass3"
gdalcompare.py ${BASELINE}/l8_test/pass3.tif ${test_name}/tmp/snow_pass3.tif
errors=$((errors+$?))
echo "-- Comparison snow_all"
gdalcompare.py ${BASELINE}/l8_test/snow_all.tif ${test_name}/tmp/LIS_SNOW_ALL.TIF
errors=$((errors+$?))
echo "-- Comparison final_mask"
gdalcompare.py ${BASELINE}/l8_test/final_mask.tif ${test_name}/tmp/LIS_SEB.TIF
errors=$((errors+$?))
exit ${errors}
#!/bin/bash -u
# Usage: test-fsc-snow-s2-hillshade.sh <data-test> <baseline>
DATA_TEST=$1
BASELINE=$2
test_name="shaded_snow_no_relief_shadow_mask"
# Cleanup
rm -rf ${test_name}
# Run test
let_it_snow_fsc.py \
-c ${DATA_TEST}/S2/shaded_snow/global_parameters_shaded_snow.json \
-i ${DATA_TEST}/S2/SENTINEL2B_20210124-103807-070_L2A_T31TGM_C_V1-0 \
-d ${DATA_TEST}/S2/SENTINEL2B_20210124-103807-070_L2A_T31TGM_C_V1-0/Leman_dem_merged.tif \
-o ${test_name} \
-V 1.11.0
# Output comparison
errors=0
echo "-- Comparison FSC TOC"
gdalcompare.py \
${BASELINE}/shaded_snow_test/shaded_snow_no_relief_shadow_mask/LIS_S2-SNOW-FSC-TOC_T31TGM_20210124T103807_1.11.0.tif \
${test_name}/LIS_S2-SNOW-FSC-TOC_T31TGM_20210124T103807_1.11.0.tif
errors=$((errors+$?))
exit ${errors}
#!/bin/bash -u
# Usage: test-fsc-snow-s2-rastertools.sh <data-test> <baseline>
DATA_TEST=$1
BASELINE=$2
test_name="shaded_snow_rastertools"
# Cleanup
rm -rf ${test_name}
# Run test
let_it_snow_fsc.py \
-c ${DATA_TEST}/S2/shaded_snow/global_parameters_shaded_snow_rastertools.json \
-i ${DATA_TEST}/S2/SENTINEL2B_20210124-103807-070_L2A_T31TGM_C_V1-0 \
-d ${DATA_TEST}/S2/SENTINEL2B_20210124-103807-070_L2A_T31TGM_C_V1-0/Leman_dem_merged.tif \
-o ${test_name} \
-V 1.11.0
# Output comparison
errors=0
echo "-- Comparison FSC TOC"
gdalcompare.py \
${BASELINE}/shaded_snow_test/shaded_snow_detect_shaded_snow_rastertools/LIS_S2-SNOW-FSC-TOC_T31TGM_20210124T103807_1.11.0.tif \
${test_name}/LIS_S2-SNOW-FSC-TOC_T31TGM_20210124T103807_1.11.0.tif
errors=$((errors+$?))
exit ${errors}
#!/bin/bash -u
# Usage: test-synthesis.sh <data-test> <baseline>
DATA_TEST=$1
BASELINE=$2
test_name="snow_synthesis"
# Cleanup
rm -rf ${test_name}
# Run test
let_it_snow_synthesis.py \
-i ${DATA_TEST}/SNOW_PRODUCTS/SENTINEL2A_20180101-105435-457_L2A_T31TCH_D_V1-4 \
-i ${DATA_TEST}/SNOW_PRODUCTS/SENTINEL2A_20180131-105416-437_L2A_T31TCH_D_V1-4 \
-d ${DATA_TEST}/SNOW_PRODUCTS/LANDSAT8-OLITIRS-XS_20180115-103629-617_L2A_T31TCH_D_V1-9 \
-d ${DATA_TEST}/SNOW_PRODUCTS/LANDSAT8-OLITIRS-XS_20180131-103619-890_L2A_T31TCH_D_V1-9 \
-c ${DATA_TEST}/SYNTHESIS/synthesis_configuration.json \
-j ${DATA_TEST}/SYNTHESIS/synthesis_launch.json \
-o ${test_name} \
-V 1.11.0
# Output comparison
errors=0
echo "-- Comparison SCD"
gdalcompare.py \
${BASELINE}/snow_synthesis_test/LIS_S2L8-SNOW-SCD_T31TCH_20180101_20180131_1.11.0_1.tif \
${test_name}/LIS_S2L8-SNOW-SCD_T31TCH_20180101_20180131_1.11.0_1.tif
errors=$((errors+$?))
echo "-- Comparison NOBS"
gdalcompare.py \
${BASELINE}/snow_synthesis_test/LIS_S2L8-SNOW-NOBS_T31TCH_20180101_20180131_1.11.0_1.tif \
${test_name}/LIS_S2L8-SNOW-NOBS_T31TCH_20180101_20180131_1.11.0_1.tif
errors=$((errors+$?))
echo "-- Comparison SOD"
gdalcompare.py \
${BASELINE}/snow_synthesis_test/LIS_S2L8-SNOW-SOD_T31TCH_20180101_20180131_1.11.0_1.tif \
${test_name}/LIS_S2L8-SNOW-SOD_T31TCH_20180101_20180131_1.11.0_1.tif
errors=$((errors+$?))
echo "-- Comparison SMOD"
gdalcompare.py \
${BASELINE}/snow_synthesis_test/LIS_S2L8-SNOW-SMOD_T31TCH_20180101_20180131_1.11.0_1.tif \
${test_name}/LIS_S2L8-SNOW-SMOD_T31TCH_20180101_20180131_1.11.0_1.tif
errors=$((errors+$?))
echo "-- Comparison NSP"
gdalcompare.py \
${BASELINE}/snow_synthesis_test/LIS_S2L8-SNOW-NSP_T31TCH_20180101_20180131_1.11.0_1.tif \
${test_name}/LIS_S2L8-SNOW-NSP_T31TCH_20180101_20180131_1.11.0_1.tif
errors=$((errors+$?))
echo "-- Comparison CCD"
gdalcompare.py \
${BASELINE}/snow_synthesis_test/CLOUD_OCCURENCE_T31TCH_20180101_20180131.tif \
${test_name}/tmp/CLOUD_OCCURENCE_T31TCH_20180101_20180131.tif
errors=$((errors+$?))
exit ${errors}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment