adoroszlai opened a new pull request, #36: URL: https://github.com/apache/ozone-docker/pull/36
## What changes were proposed in this pull request? `apache/ozone` Docker image comes with few helper files on top of the contents of Ozone binary tarball: - `log4j.properties` to write log to `stdout` so that logs can be checked by `docker log` command. However, Ozone's logging config already does that (which we rely on for `ozone-runner`-based tests. So the override log config is unnecessary. - `ozone-site.xml` and `start-ozone-all.sh` to allow running all Ozone services in a single container using a simple `docker run ...` [command](https://ozone.apache.org/docs/1.4.0/start/startfromdockerhub.html#ozone-in-a-single-container). I think this mode is no longer useful, Docker Compose is widespread (e.g. it's part of Docker Desktop). - `docker-compose.yaml` and `docker-config` to allow running Ozone in Docker Compose after copying these files from the image to the host. However, any changes in these files requires building and publishing new image(s), most of which is unchanged (since Ozone release artifacts are immutable). I think it would be better to omit these files, and provide them as examples, referring users to the GitHub repo and/or the Ozone website. Removing these from the image eliminates the need for downloading and running Rat before building the image in `build.sh` (which is not used in automated builds anyway). So I propose: - removing `log4j.properties`, `ozone-site.xml` and `start-ozone-all.sh` completely, - no longer adding `docker-compose.yaml` and `docker-config` to the image. In addition: - make `docker-compose.yaml` more reusable by moving image name, version and flavor into `.env` - allow overriding base image version during build - let `build.sh` pick up build args (`OZONE_VERSION`, etc.) - tweak `.dockerignore` - remove unnecessary `ENV`, base image already has the same definitions: ``` $ docker run -it --rm apache/ozone-runner:20241108-jdk17-1 env | grep OZONE_ OZONE_CONF_DIR=/etc/hadoop OZONE_LOG_DIR=/var/log/hadoop ``` https://issues.apache.org/jira/browse/HDDS-11809 ## How was this patch tested? CI: https://github.com/adoroszlai/ozone-docker/actions/runs/12030378357 ``` $ docker run -it --rm ghcr.io/adoroszlai/ozone:0f76050abb7209d426e20f3ccebc625320ecfa69 Please check https://github.com/apache/ozone-docker for information. $ docker run -it --rm ghcr.io/adoroszlai/ozone:0f76050abb7209d426e20f3ccebc625320ecfa69 ozone version ... / 1.4.1(Hot Springs) ... $ docker compose up -d --scale datanode=3 [+] Running 7/8 ⠏ Network docker-ozone_default Created ✔ Container docker-ozone-s3g-1 Started ✔ Container docker-ozone-om-1 Started ✔ Container docker-ozone-scm-1 Started ✔ Container docker-ozone-datanode-3 Started ✔ Container docker-ozone-recon-1 Started ✔ Container docker-ozone-datanode-1 Started ✔ Container docker-ozone-datanode-2 Started $ docker compose exec -T scm ozone freon ockg -n1 -t1 ... 2024-11-26 17:19:06 INFO BaseFreonGenerator:75 - Successful executions: 1 $ docker compose logs --tail 10 om om-1 | 2024-11-26 17:19:05 INFO OmKeyInfo:71 - OmKeyInfo.getCodec ignorePipeline = true om-1 | 2024-11-26 17:19:05 INFO OMBucketCreateRequest:295 - created bucket: bucket1 of layout FILE_SYSTEM_OPTIMIZED in volume: vol1 om-1 | 2024-11-26 17:19:16 INFO DBCheckpointServlet:301 - Received GET request to obtain DB checkpoint snapshot om-1 | 2024-11-26 17:19:16 INFO OMDBCheckpointServlet:247 - Compaction pausing 1 started. om-1 | 2024-11-26 17:19:16 INFO RDBCheckpointManager:89 - Created checkpoint in rocksDB at /data/metadata/db.checkpoints/om.db_checkpoint_1732641556682 in 36 milliseconds om-1 | 2024-11-26 17:19:16 INFO RDBCheckpointUtils:60 - Waited for 5 milliseconds for checkpoint directory /data/metadata/db.checkpoints/om.db_checkpoint_1732641556682 availability. om-1 | 2024-11-26 17:19:16 INFO OMDBCheckpointServlet:259 - Compaction pausing 1 ended. Elapsed ms: 48 om-1 | 2024-11-26 17:19:16 INFO DBCheckpointServlet:225 - Time taken to write the checkpoint to response output stream: 12 milliseconds om-1 | 2024-11-26 17:19:16 INFO DBCheckpointServlet:228 - Excluded SST [] from the latest checkpoint. om-1 | 2024-11-26 17:19:16 INFO RocksDBCheckpoint:78 - Cleaning up RocksDB checkpoint at /data/metadata/db.checkpoints/om.db_checkpoint_1732641556682 ``` Also built the image locally (with custom URL for using local artifact); ``` $ export OZONE_URL=http://172.18.0.1/dist.apache.org/ozone/ozone-1.4.0.tar.gz $ ./build.sh --progress plain --no-cache #0 building with "default" instance using docker driver #1 [internal] load .dockerignore #1 transferring context: 2B done #1 DONE 0.0s #2 [internal] load build definition from Dockerfile #2 transferring dockerfile: 1.36kB done #2 DONE 0.0s #3 [internal] load metadata for docker.io/apache/ozone-runner:20241108-jdk17-1 #3 DONE 0.0s #4 [1/4] FROM docker.io/apache/ozone-runner:20241108-jdk17-1 #4 DONE 0.0s #5 [2/4] WORKDIR /opt #5 CACHED #6 [3/4] RUN sudo rm -rf /opt/hadoop && curl -LSs -o ozone.tar.gz http://172.18.0.1/dist.apache.org/ozone/ozone-1.4.0.tar.gz && tar zxf ozone.tar.gz && rm ozone.tar.gz && mv ozone* hadoop #6 DONE 2.9s #7 [4/4] WORKDIR /opt/hadoop #7 DONE 0.0s #8 exporting to image #8 exporting layers #8 exporting layers 0.7s done #8 writing image sha256:dc3ad950315513a8e74b74b6df3418e0809d474cb9b3cc11fa4ae58085e86f15 done #8 naming to docker.io/apache/ozone:dev done #8 DONE 0.7s ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
