cncf / automation

Tools to manage CNCF maintenance tasks
Apache License 2.0
5 stars 5 forks source link

zstd unavailable in `equinix-2cpu-8gb` #25

Open stianst opened 4 weeks ago

stianst commented 4 weeks ago

I sent a PR to include zstd in the runner image, which was merged 4 days, but zstd is not available in the equinix-2cpu-8gb today.

Not sure if this means it uses a different image, or the images haven't been updated?

RobertKielty commented 1 week ago

The image has been updated and zstd has been installed.

When I pull the image and get to a prompt I can run zstd.

We need to look at how the tar command finds the zstd compression binary. I'll take a look.

RobertKielty commented 1 week ago

From running the runner locally this is what I see

docker run --rm -it --entrypoint bash ghcr.io/cncf/external-gha-runner:main 
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

runner@56d40521a5df:~$ zstd --version 
*** zstd command line interface 64-bits v1.4.8, by Yann Collet ***
runner@56d40521a5df:~$ 

@stianst I will look for the Action where tar is using zstd and failing (I was looking at this this morning) and troubleshoot this further.

RobertKielty commented 1 week ago

Here's the failing line

https://github.com/cncf/keycloak-testing/actions/runs/11890957483/job/33131050815#step:3:16722

From the env vars and the bash being invoked without a profile it looks like the PATH is not set.

Run tar -C ~/ --use-compress-program zstd -cf m2-keycloak.tzts \
  tar -C ~/ --use-compress-program zstd -cf m2-keycloak.tzts \
  --exclude '*.tar.gz' \
  .m2/repository/org/keycloak
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    MAVEN_ARGS: -B -nsu -Daether.connector.http.connectionMaxTtl=25
    SUREFIRE_RERUN_FAILING_COUNT: 2
    SUREFIRE_RETRY: -Dsurefire.rerunFailingTestsCount=2
    JAVA_HOME: /home/runner/_work/_tool/Java_Temurin-Hotspot_jdk/21.0.5-11.0.LTS/x64
    JAVA_HOME_21_X64: /home/runner/_work/_tool/Java_Temurin-Hotspot_jdk/21.0.5-11.0.LTS/x64
/bin/sh: 1: zstd: not found

Try replacing

tar -C ~/ --use-compress-program zstd

with

tar -C ~/ --use-compress-program /usr/bin/zstd

stianst commented 6 days ago

We can look into if we can change to use the full path in our workloads without causing issues on standard GitHub runners or elsewhere, but it's still a bit strange that it is not on the PATH, as I would expect /usr/bin to be on the PATH by default on a Linux based container.

RobertKielty commented 6 days ago

@stianst That's great!

You can also choose to run /usr/bin/bash without the --noprofile --norc flags.

That would also allow bash to read configuration files and configure the PATH according to your (reasonable) expectations. Excluding consumption of standard bash profile and rc files across /etc and home directories is why PATH is not setup.

When figuring this stuff out you can always run

docker run --rm -it --entrypoint bash ghcr.io/cncf/external-gha-runner:main

to interactively see how the runner is configured and behaves.

 ~  cncf > … > .github > actions > status-check  $ docker run --rm -it --entrypoint bash ghcr.io/cncf/external-gha-runner:main
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

runner@e440504bbe79:~$ env | grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
runner@e440504bbe79:~$ bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

runner@e440504bbe79:~$ env |
> grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
runner@e440504bbe79:~$ zstd 
stdin is a console, aborting
runner@e440504bbe79:~$ zstd  --version 
*** zstd command line interface 64-bits v1.4.8, by Yann Collet ***
runner@e440504bbe79:~$ exit 
exit
runner@e440504bbe79:~$ zstd 
stdin is a console, aborting
runner@e440504bbe79:~$ zstd --version 
*** zstd command line interface 64-bits v1.4.8, by Yann Collet ***
runner@e440504bbe79:~$ 

If you can share with me the source of the tar command I can troubleshoot this further for you.