Docker image use to run the EWoC classification step
To build the docker image you need to have acess to the following private python packages:
The associated python packages need to be close to the Dockerfile
file.
You can now run the following command to build the docker image:
docker build --build-arg EWOC_CLASSIF_DOCKER_VERSION=$(git describe) --pull --rm -f "Dockerfile" -t ewoc_classif:$(git describe) "."
From OVH harbor
docker login 643vlk6z.gra7.container-registry.ovh.net -u ${harbor_username}
docker pull 643vlk6z.gra7.container-registry.ovh.net/world-cereal/ewoc_classif:${tag_name}
From AWS ECR
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
docker pull aws_account_id.dkr.ecr.region.amazonaws.com/world-cereal/ewoc_classif:${tag_name}
You need to pass to the docker image a file with some credentials with the option --env-file /path/to/env.file
.
This file must contain the following variables:
- EWOC_S3_ACCESS_KEY_ID
- EWOC_S3_SECRET_ACCESS_KEY
- EWOC_ENDPOINT_URL
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- EWOC_BLOCKSIZE=1024
- GDAL_CACHEMAX=2000
- AGERA5_BUCKET=ewoc-agera5-yearly
- PRD_BUCKET=ewoc-prd-dev [Optional]
- EWOC_CLOUD_PROVIDER= aws [or creodias]
- EWOC_DEV_MODE=True
- EWOC_REGION_NAME
- LOCAL_MODELS: Set this variable to true to use local models, otherwise don't use it or unset it
To run the generation of a specific S2 tile ID:
tag_name
to the right one
Cropland for one block
docker run --rm --env-file /local/path/to/env.file ewoc_classif:${tag_name} ewoc_classif ewoc_classif <s2 tile id> <production_id> --end-season-year 2021 --cropland-model-version v512 --croptype-model-version v502 --irr-model-version v420 --block-ids 89
Summer1
docker run --rm --env-file /local/path/to/env.file ewoc_classif:${tag_name} ewoc_classif ewoc_classif <s2 tile id> <production_id> --end-season-year 2021 --ewoc-detector croptype --ewoc-season summer1 --cropland-model-version v512 --croptype-model-version v502 --irr-model-version v420 --block-ids 89
Post-processing (mosaic) Cropland mosaic for a s2 tile
docker run --rm --env-file /local/path/to/env.file ewoc_classif:${tag_name} ewoc_classif ewoc_classif <s2 tile id> <production_id> --end-season-year 2021 --cropland-model-version v512 --croptype-model-version v502 --irr-model-version v420 --postprocess True
For more options please read the ewoc_classif readme or run:
docker run --rm -it ewoc_classif:${tag_name} ewoc_classif --help
The release of new docker image is made through GitHub Action to the EWoC docker registry.
When develop is ready and functional, you can merge into main. After you must tag in main branch a new version with git tag -a tag_name
command with tag_name
following semver.