Shared sstate volume#6
Conversation
Split the monolithic workdir volume into two roles: - Per-branch workdir: /workdir/tmp and /workdir/downloads (TMPDIR, DL_DIR) - Shared sstate volume: mounted at /sstate-cache (SSTATE_DIR) Changes: - config.sh: add SSTATE_VOLUME_NAME, exported alongside VOLUME_NAME - env_core.sh: add _initialize_sstate_volume(); pre-create /workdir/tmp and /workdir/downloads in _initialize_workdir() so chown covers both - docker_utils.sh: mount sstate volume at /sstate-cache; always inject SSTATE_DIR=/sstate-cache and DL_DIR=/workdir/downloads into container - docker-compose.template.yml: add sstate volume; mount in poky and rpm-host (rpm-host serves sstate-cache at /sstate-cache/PATH for mirror use) - plugins/volume.sh: show sstate volume name in 'volume info'
Previously config.sh unconditionally overwrote SSTATE_VOLUME_NAME with
a value derived from PROJECT_NAME. When CI sets SSTATE_VOLUME_NAME to
point all branches at the shared gh-kirkstone-<hw>-x86_64-sstate volume,
config.sh would overwrite it with the per-branch-named volume derived
from the build directory name.
Use ${SSTATE_VOLUME_NAME:-...} so the env var set by CI takes precedence;
local dev without the env var set gets the existing default behaviour.
lc-EmLogic
left a comment
There was a problem hiding this comment.
It does not work for me unless I modify BB_ENV_PASSTHROUGH_ADDITIONS - see my comment below.
| docker_args+=(-e "SSTATE_DIR=${_sstate_dir}") | ||
| docker_args+=(-e "DL_DIR=${_dl_dir}") |
There was a problem hiding this comment.
Setting them as env variables is not enough, we need to either edit the local.lconf file or put them in BB_ENV_PASSTHROUGH_ADDITIONS
There was a problem hiding this comment.
@mrtuborg I got the full picture now. Setting SSTATE_DIR here isreally ignored. It works because we are setting the default value to /sstate-cache also in here:
My recommendation is hence to remove the ignored env variables from here and rely in that if a user modifies the path it will modify the bblayers.conf locally.
There was a problem hiding this comment.
I believe bblayers.conf is also could be generated to support consistency. As we do that with local.conf.
What do you think about this approach?
There was a problem hiding this comment.
I think that DL_DIR, SSTATE_DIR and TMPDIR do not belong to bblayers.conf in the first place but that they should be in local.conf.
And then, they could/should be generated. For example we could add them to the sample local.conf with ?= operator, and let CI init.sh script append another value if necessary (similar to MACHINE).
Co-authored-by: Lluis Martinez <lc@emlogic.no>
Avoid mixing workdirs from different branches, but still sharing sstate-cache between them