build(docker): Add optional debuginfod volume#220
Draft
cleithner-comcast wants to merge 1 commit into
Draft
Conversation
This commit adds an optional debuginfod volume compose file. If there is a DEBUGINFOD_CACHE_PATH environment variable set, it will use that. Else, it will use the default $HOME/.cache/debuginfod_client path. This will allow people to persist a cache across BartonCore containers.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for persisting a host-side debuginfod client cache into BartonCore containers, intended to avoid repeated debug symbol downloads across container runs (CLI and devcontainer workflows).
Changes:
- Add
-Dflag todockerwto bind-mount the host’s debuginfod cache path and exportDEBUGINFOD_CACHE_PATHinto the container. - Extend
docker/setupDockerEnv.shto writeHOST_DEBUGINFOD_CACHE(andDEBUGINFOD_CACHE_PATH) intodocker/.envwhen a host cache directory exists. - Introduce a Docker Compose override (
docker/compose.debuginfod-cache.yaml) and include it in the devcontainer compose stack.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
dockerw |
Adds -D option to mount and export debuginfod cache path for CLI container runs. |
docker/setupDockerEnv.sh |
Emits debuginfod cache environment variables into docker/.env for compose-based workflows. |
docker/compose.debuginfod-cache.yaml |
New compose override to mount host debuginfod cache into the barton service. |
.devcontainer/devcontainer.json |
Adds the new compose override to the devcontainer compose file list. |
Comment on lines
+10
to
+11
| "../docker/compose.devcontainer.yaml", | ||
| "../docker/compose.debuginfod-cache.yaml" |
Comment on lines
+183
to
+189
| # debuginfod cache: if the host has a cache directory, record its path so it can be | ||
| # bind-mounted into the container via the compose.debuginfod-cache.yaml overlay. | ||
| HOST_DEBUGINFOD_CACHE="${DEBUGINFOD_CACHE_PATH:-$HOME/.cache/debuginfod_client}" | ||
| if [ -d "$HOST_DEBUGINFOD_CACHE" ]; then | ||
| echo "HOST_DEBUGINFOD_CACHE=$HOST_DEBUGINFOD_CACHE" >> $OUTFILE | ||
| echo "DEBUGINFOD_CACHE_PATH=$HOST_DEBUGINFOD_CACHE" >> $OUTFILE | ||
| fi |
Comment on lines
+46
to
+51
| services: | ||
| barton: | ||
| volumes: | ||
| - ${HOST_DEBUGINFOD_CACHE}:${HOST_DEBUGINFOD_CACHE}:cached | ||
| environment: | ||
| - DEBUGINFOD_CACHE_PATH=${HOST_DEBUGINFOD_CACHE} |
Comment on lines
+57
to
+62
| D) # mount host debuginfod cache into container | ||
| _cache="${DEBUGINFOD_CACHE_PATH:-$HOME/.cache/debuginfod_client}" | ||
| if [ -d "$_cache" ]; then | ||
| DEBUGINFOD_CACHE_VOL="-v $_cache:$_cache:cached" | ||
| EXTRA_ENV="${EXTRA_ENV} -e DEBUGINFOD_CACHE_PATH=$_cache" | ||
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit adds an optional debuginfod volume compose file. If there is a DEBUGINFOD_CACHE_PATH environment variable set, it will use that. Else, it will use the default $HOME/.cache/debuginfod_client path. This will allow people to persist a cache across BartonCore containers.