Skip to content

Commit

Permalink
Rm container after running. Avoid outputting aux files.
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Oct 8, 2024
1 parent a4d7891 commit adecba9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docker/local_batch_job/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ ENV OPENEO_BATCH_JOB_ID="unknown-job"
ENV OPENEO_USER_ID="openeo_docker_local"
# When debugging is enabled, port 4040 and 5009 are exposed:
ENV OPENEO_LOCAL_DEBUGGING="false"
# Avoid GDAL making .aux files
ENV GDAL_PAM_ENABLED=NO

# Write directly to the mount. If an error occurs, there is something to debug with
# openeo.log will be written in the current directory, so change current directory
Expand Down
2 changes: 1 addition & 1 deletion docker/local_batch_job/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Prerequisites: Docker already installed. Python with the openEO client installed
Note, you can refer to local stac collections by file path on Linux, but not on Windows.

- Clone / download this repository
- Build the image with `cd openeo-geopyspark-driver && sudo docker build -t openeo_docker_local . -f docker/local_batch_job/Dockerfile`
- Build the image with `cd openeo-geopyspark-driver && docker build -t openeo_docker_local . -f docker/local_batch_job/Dockerfile`
- Run graph with `./local_batch_job path/to/process_graph.json folder/that/contains/local/stac/catalogs/`
- The output files will be written to the same folder as process_graph.json

Expand Down
2 changes: 2 additions & 0 deletions docker/local_batch_job/local_batch_job
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ fi
# mount is used to read process_graph and write results
# Avoid -i, to avoid "the input device is not a TTY"
# --network host can fix internet connection when the host machine is behind a VPN
# --rm to remove the container after it finishes. Remove all stopped containers with `docker container prune -f && docker ps -a`
docker run -t \
--user "$(id -g):$(id -u)" \
-v /etc/passwd:/etc/passwd:ro \
--security-opt seccomp=unconfined \
-v "$graph_directory":/opt/docker_mount \
"${extra_arguments[@]}" \
--network host \
--rm \
openeo_docker_local \
"$graph_filename"
3 changes: 2 additions & 1 deletion docker/local_batch_job/local_batch_job.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ IF NOT "%2"=="" (
:: mount is used to read process_graph and write results
:: Avoid -i, to avoid "the input device is not a TTY"
:: --network host can fix internet connection when the host machine is behind a VPN
docker run -t -v /etc/passwd:/etc/passwd:ro --security-opt seccomp=unconfined -v "%parent_folder%":/opt/docker_mount --network host openeo_docker_local
:: --rm to remove the container after it finishes. Remove all stopped containers with `docker container prune -f && docker ps -a`
docker run -t -v /etc/passwd:/etc/passwd:ro --security-opt seccomp=unconfined -v "%parent_folder%":/opt/docker_mount --network host --rm openeo_docker_local
echo Output written to: %parent_folder%

0 comments on commit adecba9

Please sign in to comment.