actions / runner-images

GitHub Actions runner images
MIT License
9.77k stars 2.99k forks source link

ubuntu-20.04-arm runner doesn't seem to have the GitHub CLI installed #10192

Closed jamilbk closed 4 weeks ago

jamilbk commented 1 month ago

Description

gh: command not found

https://github.com/firezone/firezone/actions/runs/9847918080/job/27190842443#step:13:36

We've been running this CI pipeline successfully for months on the equivalent x86_64 runner.

Seems like the package is missing?

Platforms affected

Runner images affected

Image version and build link

https://github.com/firezone/firezone/actions/runs/9847918080/job/27190842443#step:13:36

20.04.202407040

Is it regression?

Not sure

Expected behavior

gh command to be available

Actual behavior

gh is not in $PATH.

Repro steps

  1. Start a job on a GH-hosted Ubuntu 20.04 ARM64 runner.
  2. Try to run the gh command.
kishorekumar-anchala commented 1 month ago

Hi @jamilbk ,

Thank you for bringing this issue to us. We are looking into this issue and will update you on this issue after investigating.

jamilbk commented 1 month ago

hi @kishorekumar-anchala -- that does not resolve the bug. According to your documentation here, the GitHub CLI should be pre-installed in the runner image.

https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md#cli-tools

Prabhatkumar59 commented 1 month ago

Hi @jamilbk,

To resolve the gh: command not found error in your CI pipeline, please try using below steps:-

steps: name: Install GitHub CLI run: | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 sudo apt-add-repository https://github.com/cli/cli/packages sudo apt update sudo apt install gh

*Using GitHub Actions setup-gh Action:-

steps: name: Set up GitHub CLI uses: actions/setup-gh@v1 with: token: ${{ secrets.GITHUB_TOKEN }} These steps ensure gh is installed and available in your CI environment.

Requesting you to try this resolution and provide the update on this, thanks:)

jamilbk commented 1 month ago

Hi @Prabhatkumar59 -- I understand how to install the GitHub CLI. That's not the issue. The issue is that the arm64 runner image does not contain the same software the x86_64 runner has, and your documentation states it does.

Are we expected to install the GitHub CLI on all runner images? Is it expected that the arm64 runners do not have the GitHub CLI pre-installed like the documentation states?

Either the docs need to be updated or the runner image needs to be fixed.

Prabhatkumar59 commented 1 month ago

@jamilbk-- Thanks for your reply, will look into this and will update you after investigating.

ReactorScram commented 1 month ago

Similarly, the Windows 11 ARM image doesn't have Bash installed https://github.com/firezone/firezone/actions/runs/9863219247/job/27235517455#step:3:28

Should I open another issue for that? I can't tell if these images are provided by GitHub or by us

Prabhatkumar59 commented 1 month ago

Hi @jamilbk-- You can try by adding a conditional installation step in your CI workflow for the GitHub CLI:-

jobs: build: runs-on: ubuntu-latest steps:

Basically, this approach states that your CI pipeline behaves consistently across different runner images (x86_64 and arm64).

While ideally, the runner images should have consistent software pre-installed but in mean time, I will investigate more on this and update you, thanks:)

Prabhatkumar59 commented 1 month ago

Hi @ReactorScram-- I will investigate on "the Windows 11 ARM image doesn't have Bash installed" and then will update you, thanks.

jamilbk commented 1 month ago

While ideally, the runner images should have consistent software pre-installed but in mean time, I will investigate more on this and update you, thanks:)

Thanks, we've already implemented this work-around but we would prefer waiting for an official response from GitHub here.

Prabhatkumar59 commented 1 month ago

Hi @ReactorScram-- The issue you're experiencing with the Windows 11 ARM image not having Bash installed which is similar to this issue with the GitHub CLI on the arm64 runner.

For this, you can modify your workflow to handle the absence of Bash on Windows ARM images. You can install Bash or use PowerShell scripts as an alternative.

You can try by using below steps with example:-

Install GitHub CLI (if needed):- Ensure the GitHub CLI is installed

Use PowerShell Instead of Bash:- Modify your scripts to use PowerShell commands. If Bash is essential, you can install Git for Windows, which includes Git Bash.

Example Workflow Here’s an example of how you might adapt your workflow:--

jobs: build: runs-on: windows-latest steps:

You can modify your workflows to install the necessary tools (gh CLI, Bash) as needed. also can use PowerShell scripts where possible.

so, by following these above steps, you can maintain functionality in your CI pipeline while addressing the underlying issues with the runner images.

ReactorScram commented 1 month ago

@Prabhatkumar59 Will the amd64 MSI and exe work on ARM? Did you test this locally?

Prabhatkumar59 commented 1 month ago

@ReactorScram-- The amd64 MSI and EXE installers are intended for x86_64 architecture and will not work directly on ARM architecture. For ARM-based Windows systems, you need to ensure that you use ARM-compatible binaries or installers. I didn't test it locally but I have some insights on this as per my experience. I will check more on this and will update you, thanks:)

Prabhatkumar59 commented 1 month ago

Hi @ReactorScram- Did you get the resolution for above Windows 11 ARM image?

Prabhatkumar59 commented 4 weeks ago

@jamilbk - As I did not any update from you so, we are closing this issue. Feel free to reach out to us...thanks

jamilbk commented 4 weeks ago

Was this issue resolved? What's the reason for closing the issue?

ReactorScram commented 4 weeks ago

@Prabhatkumar59 No I did not try it because I was so perplexed by the example code showing an x86_64 MSI on ARM

Also I think it turned out Git for Windows just doesn't build for ARM yet