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

GitHub–hosted runners have taken over the RUNNER_ environment variable prefix #738

Closed
0x2b3bfa0 opened this issue Sep 22, 2021 · 2 comments · Fixed by #739 or #712
Closed

GitHub–hosted runners have taken over the RUNNER_ environment variable prefix #738

0x2b3bfa0 opened this issue Sep 22, 2021 · 2 comments · Fixed by #739 or #712
Assignees
Labels
bug Something isn't working cml-runner Subcommand p0-critical Max priority (ASAP)

Comments

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Sep 22, 2021

Suddenly, GitHub–hosted runners have started to set environment variables with the RUNNER_ prefix, clashing with the ones we're using on cml runner to let users specify command–line options through the environment:

const NAME = `cml-${randid()}`;

cml/bin/cml/runner.js

Lines 17 to 28 in 7d664ae

RUNNER_PATH = `${WORKDIR_BASE}/${NAME}`,
RUNNER_IDLE_TIMEOUT = 5 * 60,
RUNNER_DESTROY_DELAY = 20,
RUNNER_LABELS = 'cml',
RUNNER_NAME = NAME,
RUNNER_SINGLE = false,
RUNNER_REUSE = false,
RUNNER_NO_RETRY = false,
RUNNER_DRIVER,
RUNNER_REPO,
REPO_TOKEN
} = process.env;

Among others, GitHub–hosted runners are setting RUNNER_NAME to esoteric values with uppercase and spaces like GitHub Actions 3, causing some cloud vendors to break in unexpected ways.

For example, Google Cloud complains loudly and refuses to create any resources with names containing whitespace:

Error: Failed creating the machine: googleapi: Error 400: Invalid value for field 'resource.name': 'GitHub Actions 2-egress'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'

More details:
  Reason: invalid, Message: Invalid value for field 'resource.name': 'GitHub Actions 2-egress'. Must be a match of
regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'
  Reason: invalid, Message: Invalid value for field 'resource.targetTags[0]': 'GitHub Actions 2'. Must be a match o
f regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'

AWS also fails because of this, as per #741

Minimal working example

Workflow

on: workflow_dispatch
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: env | grep ^RUNNER_

Output

RUNNER_NAME=GitHub Actions 3
RUNNER_OS=Linux
RUNNER_TRACKING_ID=github_···
RUNNER_TEMP=/home/runner/work/_temp
RUNNER_USER=runner
RUNNER_TOOL_CACHE=/opt/hostedtoolcache
RUNNER_WORKSPACE=/home/runner/work/test
RUNNER_PERFLOG=/home/runner/perflog
@0x2b3bfa0 0x2b3bfa0 added bug Something isn't working p0-critical Max priority (ASAP) cml-runner Subcommand labels Sep 22, 2021
@0x2b3bfa0 0x2b3bfa0 self-assigned this Sep 22, 2021
@dacbd
Copy link
Contributor

dacbd commented Sep 22, 2021

┬──┬ ¯_(ツ)

┻┻︵ヽ(`Д´)ノ︵┻┻

@0x2b3bfa0
Copy link
Member Author

Also seen on #741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment