Skip to content

fix: avoid running cachedir mount commands via script #2070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2025

Conversation

egibs
Copy link
Member

@egibs egibs commented Jul 7, 2025

We currently run all QEMU commands via script when running tests which does not work for the cache directory mount commands:

2025/07/07 16:46:49 INFO qemu: setting up melange cachedir: /tmp/melange-cache
2025/07/07 16:46:49 WARN ash: script: not found
2025/07/07 16:46:49 ERRO Failed to run command "script -f -q --log-in /dev/null --log-out /dev/null -e -c 'sh -c '\\''mkdir -p /var/cache/melange /mount/var/cache/melange /mount/upper /mount/work && mount -t 9p melange_cache /var/cache/melange && mount -t overlay overlay -o lowerdir=/var/cache/melange,upperdir=/mount/upper,workdir=/mount/work /mount/var/cache/melange'\\'": Process exited with status 127

This PR avoids running the initial StartPod commands via script while leaving all of the test pipelines unaltered.

That said, script is now causing certain test commands to hang, so we'll have to follow up on that in a separate PR.

@egibs egibs requested a review from 89luca89 July 7, 2025 23:21
@stevebeattie
Copy link
Member

I think this is the right approach, but it seems possible in the future that we'd have potentially other setup commands to run outside of the chroot environment under /mount -- I wonder if it'd be better to have either an argument to the function or variant of it that is for environment setup that causes the injection of the script ... bits to be avoided, rather than specifically hard-coding it for the overlay mount command.

@egibs egibs force-pushed the fix-boot-script branch from b8f66a1 to 2d4719d Compare July 8, 2025 00:05
@egibs
Copy link
Member Author

egibs commented Jul 8, 2025

I think this is the right approach, but it seems possible in the future that we'd have potentially other setup commands to run outside of the chroot environment under /mount -- I wonder if it'd be better to have either an argument to the function or variant of it that is for environment setup that causes the injection of the script ... bits to be avoided, rather than specifically hard-coding it for the overlay mount command.

2d4719d (#2070) is a better attempt that only sets TestRun at the pipeline level after we run StartPod.

e.g.,

cmd: sh -c 'mkdir -p /var/cache/melange /mount/var/cache/melange /mount/upper /mount/work && mount -t 9p melange_cache /var/cache/melange && mount -t overlay overlay -o lowerdir=/var/cache/melange,upperdir=/mount/upper,workdir=/mount/work /mount/var/cache/melange' test run: false
2025/07/07 19:05:58 INFO qemu: setting up local workspace
cmd: sh -c 'find /mnt/ -mindepth 1 -maxdepth 1 -exec cp -a {} /home/build/ \;' test run: false                                                                        2025/07/07 19:05:58 INFO running the main test pipeline
cmd: /bin/sh -c 'set -ex
[ -d '\''/home/build'\'' ] || mkdir -p '\''/home/build'\''
cd '\''/home/build'\''
find / -name "script"                                                                                                                                                   cd "${ZK_HOME}"
cp conf/zoo_sample.cfg conf/zoo.cfg
bin/zkServer.sh start-foreground &                                                                                                                                      ZOOKEEPER_PID=$!
bin/zkCli.sh | grep "Welcome to ZooKeeper!"
bin/zkCli.sh create /test-$(uuidgen) '\''$(uuidgen)'\''                                                                                                                 kill "${ZOOKEEPER_PID}"

exit 0' test run: true

Signed-off-by: egibs <[email protected]>
@egibs egibs changed the title Avoid running cachedir mount commands via script fix: avoid running cachedir mount commands via script Jul 8, 2025
@egibs egibs merged commit 4e7b2c4 into chainguard-dev:main Jul 8, 2025
62 checks passed
sil2100 added a commit to sil2100/melange that referenced this pull request Jul 17, 2025
javacruft pushed a commit that referenced this pull request Jul 17, 2025
…2096)

* Revert "fix: avoid running cachedir mount commands via script (#2070)"

This reverts commit 4e7b2c4.

* Revert "fix: avoid SSH lockups, use script for tests (#2049)"

This reverts commit 7499c54.

* With the change for script usage reverted, we need to fix the release data collection.

Signed-off-by: Łukasz 'sil2100' Zemczak <[email protected]>

---------

Signed-off-by: Łukasz 'sil2100' Zemczak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants