opencontainers / runc

CLI tool for spawning and running containers according to the OCI specification
https://www.opencontainers.org/
Apache License 2.0
11.87k stars 2.11k forks source link

[ci] bats: command not found #4411

Closed lifubang closed 1 month ago

lifubang commented 1 month ago

After merged #4409, the CI was always failed for arm64:

/bin/bash: line 1: bats: command not found

https://github.com/opencontainers/runc/actions/runs/11019452323/job/30602054521

And there are many warnings for all platform when setup bats:

/usr/bin/tar: ../../../../../usr: Cannot mkdir: Permission denied
lifubang commented 1 month ago

@akhilerm Could you have some suggestions?

lifubang commented 1 month ago

There are 2 problems:

  1. Known cache issue: https://github.com/bats-core/bats-action/issues/9#issuecomment-2138032932 .
  2. It seems like that there is no architecture in bats cache key. So if the bats binary has cached in amd64, it can't work on arm64 after restored from the cache. https://github.com/bats-core/bats-action/blob/main/action.yaml#L112

If the second problem is true, I think we should revert #4409 or open an issue in https://github.com/bats-core/bats-action ?

akhilerm commented 1 month ago

I think second problem is there, but I am still curious why we didnt hit it in the CI for the PR. Will raise an issue in bats-action to fix the same.

lifubang commented 1 month ago

but I am still curious why we didnt hit it in the CI for the PR.

For the first time, there is no cache:

Cache not found for input keys: Linux-bats-1.9.0
lifubang commented 1 month ago

Will raise an issue in bats-action to fix the same.

Thanks, please help to do this, if the next release is coming soon, it will be better.

akhilerm commented 1 month ago

Ref: https://github.com/bats-core/bats-action/issues/16

akhilerm commented 1 month ago

We might hit this issue in the next release https://github.com/bats-core/bats-action/issues/18, as we have ubuntu-20.04 runners.

brokenpip3 commented 1 month ago

There are 2 problems:

1. Known cache issue: [bats-action: generates warnings trying to untar the cache bats-core/bats-action#9 (comment)](https://github.com/bats-core/bats-action/issues/9#issuecomment-2138032932) .

2. It seems like that there is no architecture in bats cache key. So if the bats binary has cached in amd64, it can't work on arm64 after restored from the cache.
   https://github.com/bats-core/bats-action/blob/main/action.yaml#L112

If the second problem is true, I think we should revert #4409 or open an issue in https://github.com/bats-core/bats-action ?

for problem 1: the cache issue it's only for the libraries since we always use home local directory for bats. If you don't need the libraries you should not hit that, you can disable the installation of those. If instead you need some of the bats libraries you can put them in a home directory and expose the BATS_LIB_PATH env to that directory, see this example.

brokenpip3 commented 1 month ago

https://github.com/bats-core/bats-action/issues/18#issuecomment-2374234510 :)