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

Workflow fails to pull image from private registry due to missing authentication #3747

Open
4 tasks done
diegoara96 opened this issue Sep 16, 2024 · 5 comments
Open
4 tasks done
Labels
bug Something isn't working gha-runner-scale-set Related to the gha-runner-scale-set mode needs triage Requires review from the maintainers

Comments

@diegoara96
Copy link

Checks

Controller Version

0.9.3

Deployment Method

Helm

Checks

  • This isn't a question or user support case (For Q&A and community support, go to Discussions).
  • I've read the Changelog before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes

To Reproduce

create a worflow that uses a service from a private repository as follows:

      postgresdb:
        # Docker Hub image
        image: my.private.registry/project/postgresdb:latest
        credentials:
          username: ${{ secrets.HARBOR_USER }}
          password: ${{ secrets.HARBOR_PASS }}

Describe the bug

When creating a workflow that needs to use images hosted in a private repository we see a “no basic auth credentials” error. The same workflow running against a normal self-hosted runner is able to download the image.

I opened this discussion #3741 thinking it was a question but seeing that with the normal self-runner it works I understand that it is a bug.

Describe the expected behavior

It should work just like a self-hosted runner and be able to download the image from the private registry.

Additional Context

githubConfigUrl: "URL"

githubConfigSecret:
  ### GitHub PAT Configuration
  github_token: "ghp_TOKEN"

## maxRunners is the max number of runners the autoscaling runner set will scale up to.
#maxRunners: 5

## minRunners is the min number of idle runners. The target number of runners created will be
## calculated as a sum of minRunners and the number of jobs assigned to the scale set.
minRunners: 1

containerMode:
  type: "kubernetes"  ## type can be set to dind or kubernetes
  kubernetesModeWorkVolumeClaim:
    accessModes: ["ReadWriteOnce"]
    storageClassName: "rook-cephfs"
    resources:
      requests:
        storage: 2Gi

  spec:
    securityContext:
      fsGroup: 1001
    containers:
    - name: runner
      image: ghcr.io/actions/actions-runner:latest
      command: ["/home/runner/run.sh"]
      env:
 #          - name: ACTIONS_RUNNER_CONTAINER_HOOKS
 #            value: /home/runner/k8s/index.js
 #          - name: ACTIONS_RUNNER_POD_NAME
 #            valueFrom:
 #              fieldRef:
 #                fieldPath: metadata.name
        - name: ACTIONS_RUNNER_REQUIRE_JOB_CONTAINER
          value: "false"
      volumeMounts:
        - name: work
          mountPath: /home/runner/_work
      resources:
        requests:
          memory: "1Gi"
          cpu: "2"
        limits:
          memory: "4Gi"
          cpu: "4"
          
    volumes:
      - name: work
        ephemeral:
          volumeClaimTemplate:
            spec:
              accessModes: [ "ReadWriteOnce" ]
              storageClassName: "rook-cephfs"
              resources:
                requests:
                  storage: 2Gi

Controller Logs

https://gist.github.com/diegoara96/20c6ce4fd17ef006de796bb1266b196d

Runner Pod Logs

workflow describe: https://gist.github.com/diegoara96/e75fa18237a7643ecb71d34cce562bc9
runner log: https://gist.github.com/diegoara96/47a20be90c587594bf25605053642524
@diegoara96 diegoara96 added bug Something isn't working gha-runner-scale-set Related to the gha-runner-scale-set mode needs triage Requires review from the maintainers labels Sep 16, 2024
Copy link
Contributor

Hello! Thank you for filing an issue.

The maintainers will triage your issue shortly.

In the meantime, please take a look at the troubleshooting guide for bug reports.

If this is a feature request, please review our contribution guidelines.

@diegoara96
Copy link
Author

This functionality was added by github in 2020 (changelog) but from what I see it doesn't seem to have ever been implemented here. It seems that the workflow credentials object is not used by te ARC

@chrispat
Copy link
Member

Which mode are you using ARC in for container jobs? Docker-in-docker or Kubernetes?

@diegoara96
Copy link
Author

Hi @chrispat
We are using kubernetes mode. You have all the configuration in Additional Context in the first message.

@diegoara96
Copy link
Author

Hi @chrispat were you able to take a look at this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gha-runner-scale-set Related to the gha-runner-scale-set mode needs triage Requires review from the maintainers
Projects
None yet
Development

No branches or pull requests

2 participants