#Run dagger on top of GitHub action runner

1 messages · Page 1 of 1 (latest)

snow moat
#

Hello team.

I was trying to run my dagger program (built with Go SDK) from the GitHub action runner.

- name: Run the dagger CI
  id: run_dagger_ci
  run: |
    cd dagger
    go run -mod=vendor cmd/mi5-ci/main.go \
      -da ${{ env.DATADOG_APP_KEY }} -dk ${{ env.DATADOG_KEY }} \
      -sh "${GITHUB_SHA}" \
      -su ${{ env.SQL_USER }} -sp ${{ env.SQL_PASSWORD }} \
      -st dev \
      -sw ${{ env.SLACK_WEBHOOK_URL }}

But it failed with the following message.

No buildkitd container found, creating one...
time="2022-11-08T02:53:14Z" level=warning msg="commandConn.CloseWrite: commandconn: failed to wait: signal: terminated"
time="2022-11-08T02:53:14Z" level=warning msg="commandConn.CloseRead: commandconn: failed to wait: signal: terminated"
time="2022-11-08T02:53:14Z" level=warning msg="commandConn.CloseWrite: commandconn: failed to wait: signal: terminated"
Building git@github.com:moloco/intelligence - mi5
#1 resolve image config for docker.io/library/golang:1.18
#1 DONE 0.8s

#2 mkfile /Dockerfile
#2 DONE 0.0s

#3 mkfile /main.go
#3 DONE 0.0s

#4 [internal] load metadata for docker.io/library/golang:1.18.2-alpine
#4 DONE 0.4s

#5 mkdir /meta
#5 DONE 0.0s

#6 docker-image://docker.io/library/golang:1.18
#6 resolve docker.io/library/golang:1.18 0.1s done
#6 ...

#7 git://github.com/moloco/intelligence#af6ed09053b41606953177e352cdef3ae0f5ed54
#0 0.085 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/4/fs/
#7 ERROR: NotFound: no ssh handler for id default
valid hatch
snow moat
#

I think that error message was misleading. Will update the original question.

valid hatch
#

@snow moat seems like you're fetching a private repository probably? is ithis //github.com/moloco/intelligence private? The reason that it probably works in your machine is because you have an ssh-agent installed and configured and that's not the case in github actions

snow moat
#

Ah, I see. Thanks for the great answer!

#

Maybe this is something that I need to try...

valid hatch
#

Yes, that's correct. If you don't want to fiddle with SSH keys in the runner, you can try setting a token and changing the URL for the following format: https://$GIT_TOKEN:@github.com/USERNAME/REPO.git. Where GIT_TOKEN can be either a token that you set or you can play with the default GITHUB_TOKEN action uses (https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)

cc @keen ore @warm hawk not sure if it's worth clarifying this use-case in our guide. I personally find easier to work with tokens instead of ssh-keys in CI pipelines.