feat: Optimize Dockerfile and update setup documentation #111
+129
−148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #80
This PR completely revamps the project's Docker setup to improve dependency management, build efficiency, and user experience, addressing all points outlined in the issue.
A) Dependency Management (
pyproject.toml&Dockerfile)pip installstep from theDockerfile.jupyter,ipykernel,ipython) into a new[tool.poetry.group.notebooks]group inpyproject.toml.grpcio-toolsas a development dependency to ensure reliable.protofile compilation within the Python environment.protobufversion to^4.25.0to resolve a dependency conflict withgrpcio-tools.B) & C) Dockerfile Optimization
Dockerfilenow follows modern conventions, including:WORKDIRinstead ofRUN cd.SHELL ["/bin/bash", "-o", "pipefail", "-c"]to ensure build steps fail correctly.curlconsistently instead ofwget.RUNcommands have been restructured into logical layers to improve Docker's layer caching and significantly speed up subsequent builds.pyproject.tomlandpoetry.lockbefore installing dependencies, preventing re-installation on minor code changes.start.sh) and thegit clonestep have been removed in favor of a cleanerCOPY . .and a directCMDinstruction.CMDfor a better developer experience, matching the originalDockerfile's intent.Expanded Documentation (
docs/setup/docker.md)pytestsuite or accessing an interactive shell, as requested in the issue.How to Test
docker build -t sbsim .docker run -p 8888:8888 sbsimhttp://localhost:8888.docker exec <container_name> poetry run pytestKnown Issue
The test suite fails with a
Fatal Python error: Illegal instructionwhen run inside the container on an Apple Silicon (ARM) Mac. This is a known issue related to CPU instruction sets when running TensorFlow in an emulated environment and is outside the scope of the Dockerfile optimizations. TheDockerfilebuilds successfully, the Jupyter server runs, and thedocker execcommand is correctly configured for users on native x86/amd64 systems.