Skip to content
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

getLinuxDistro returns unknown on EC2 runner #210

Open
sadra-barikbin opened this issue Dec 5, 2024 · 0 comments
Open

getLinuxDistro returns unknown on EC2 runner #210

sadra-barikbin opened this issue Dec 5, 2024 · 0 comments

Comments

@sadra-barikbin
Copy link

sadra-barikbin commented Dec 5, 2024

Hi there!

On an EC2 runner with Fedora linux distro, getLinuxDistro returns (unknown) and consequently, apt-get fails in run.

Here is the runner's (linux.8xlarge.nvidia.gpu) /etc/os-release:

NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023.5.20241001"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/amazon-linux-2023/"
DOCUMENTATION_URL="https://docs.aws.amazon.com/linux/"
SUPPORT_URL="https://aws.amazon.com/premiumsupport/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
VENDOR_NAME="AWS"
VENDOR_URL="https://aws.amazon.com/"
SUPPORT_END="2028-03-15"

Could we resolve this problem with this change?

export const getLinuxDistro = async () => {
  try {
    const osRelease = await fs.promises.readFile("/etc/os-release")
    let match = osRelease.toString().match(/^ID=(.*)$/m)
    if(match && match[1] == "amzn"){
      match = osRelease.toString().match(/^ID_LIKE=(.*)$/m)
    }
    return match ? match[1] : "(unknown)"
  } catch (e) {
    return "(unknown)"
  }
}

@mxschmitt

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

No branches or pull requests

1 participant