Merge pull request #29 from Molecule-AI/fix/publish-template-smoke-perms
fix(publish-template-image): chmod a+rX + drop :ro so agent can read /configs
This commit is contained in:
commit
b4e17014fa
19
.github/workflows/publish-template-image.yml
vendored
19
.github/workflows/publish-template-image.yml
vendored
@ -287,11 +287,22 @@ jobs:
|
|||||||
|
|
||||||
# Mount the repo's own config.yaml at /configs so the runtime
|
# Mount the repo's own config.yaml at /configs so the runtime
|
||||||
# can reach create_executor() — that's where the lazy imports
|
# can reach create_executor() — that's where the lazy imports
|
||||||
# we want to test actually live. World-readable so the
|
# we want to test actually live. The image's entrypoint drops
|
||||||
# entrypoint's drop-priv to uid 1000 can read it.
|
# priv from root to agent (uid 1000) before exec'ing
|
||||||
|
# molecule-runtime, so /configs needs to be readable AND
|
||||||
|
# traversable from uid 1000.
|
||||||
|
#
|
||||||
|
# Use `a+rX` (capital X — only adds x where it's already
|
||||||
|
# executable, i.e. directories): mktemp -d creates the dir
|
||||||
|
# with mode 700, so a bare `go+r` would leave the dir
|
||||||
|
# un-traversable for agent and config.py would
|
||||||
|
# PermissionError on `Path('/configs/config.yaml').exists()`.
|
||||||
|
# Mount RW (not :ro) so the entrypoint's `chown -R agent
|
||||||
|
# /configs` succeeds — its silent chown failure on a :ro
|
||||||
|
# mount was the original symptom.
|
||||||
SMOKE_CONFIG_DIR=$(mktemp -d)
|
SMOKE_CONFIG_DIR=$(mktemp -d)
|
||||||
cp config.yaml "${SMOKE_CONFIG_DIR}/"
|
cp config.yaml "${SMOKE_CONFIG_DIR}/"
|
||||||
chmod -R go+r "${SMOKE_CONFIG_DIR}"
|
chmod -R a+rX "${SMOKE_CONFIG_DIR}"
|
||||||
|
|
||||||
# Stub credentials — adapters validate shape at create_executor
|
# Stub credentials — adapters validate shape at create_executor
|
||||||
# time but the smoke times out before any real call goes out.
|
# time but the smoke times out before any real call goes out.
|
||||||
@ -299,7 +310,7 @@ jobs:
|
|||||||
# specific key sees a non-empty value.
|
# specific key sees a non-empty value.
|
||||||
set +e
|
set +e
|
||||||
timeout 60 docker run --rm \
|
timeout 60 docker run --rm \
|
||||||
-v "${SMOKE_CONFIG_DIR}:/configs:ro" \
|
-v "${SMOKE_CONFIG_DIR}:/configs" \
|
||||||
-e WORKSPACE_ID=fake-smoke \
|
-e WORKSPACE_ID=fake-smoke \
|
||||||
-e MOLECULE_SMOKE_MODE=1 \
|
-e MOLECULE_SMOKE_MODE=1 \
|
||||||
-e MOLECULE_SMOKE_TIMEOUT_SECS=10 \
|
-e MOLECULE_SMOKE_TIMEOUT_SECS=10 \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user