Summary
The text discusses encountering an error during an Earthly build triggered by a GitHub Actions cron
job, where the build fails with the error line 4: main: command not found
despite the build being successful. The user is exploring the possibility of a bug in the GitHub Actions script attempting to invoke a program named main
, questioning if the error is occurring outside of Earthly.
jw
Hmm, bdai-gh-large-runners
is actually the Github-hosted runner (with more than 2 cores). But you are right, I think this might be a runner issue
nacho
It could be useful taking a look at this file in the self-hosted runner: /home/runner/work/_temp/5c9f72c8-7742-45ca-8385-278047e223ba.sh
jw
I feel my CI yaml is fairly kosher. I have this:
on:
schedule:
- cron: '0 5 * * *' # run at 1:00 AM UTC
jobs:
starfish-nightly-build-amd64:
runs-on:
group: bdai-gh-large-runners
defaults:
run:
shell: bash
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- name: Earthly version
run: earthly --version
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into GitHub Container Registry
uses: docker/login-action@v3
with:
registry: <http://ghcr.io|ghcr.io>
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
- name: Build and Push amd64 Docker
run: |
earthly --allow-privileged --ci --push --secret GITHUB_TOKEN=${{ secrets.PAT_SECRET }} \
+build-dmm-docker-amd64 \
--DOCKER_METADATA_TAG=${{ steps.meta.outputs.tags }}
- name: Build and Test DMM
run: |
earthly --allow-privileged --ci --secret GITHUB_TOKEN=${{ secrets.PAT_SECRET }} \
+build-dmm-source```
I’m not doing anything after the final earthly line. I don’t understand where the other `main` is coming from…
brandon
Is there a bug in the Github actions script perhaps that is trying to invoke a program called main
? I wonder if that error is happening outside of earthly.
jw
I’m triggering an Earthly build using Github Action’s cron
trigger to build an Docker image at 1am every day. I’m getting this error this:
Push Summary ⏫
————————————————————————————————————————————————————————————————————————————————
Pushed image <http://github.com/bdaiinstitute/starfish:main+build-dmm-docker-amd64|github.com/bdaiinstitute/starfish:main+build-dmm-docker-amd64> as <http://ghcr.io/bdaiinstitute/dmm_amd64:nightly|ghcr.io/bdaiinstitute/dmm_amd64:nightly>
Local Output Summary 🎁 (disabled)
========================== 🌍 Earthly Build ✅ SUCCESS ==========================
🛰️ Reuse cache between CI runs with Earthly Satellites! 2-20X faster than without cache. Generous free tier <https://cloud.earthly.dev>
/home/runner/work/_temp/5c9f72c8-7742-45ca-8385-278047e223ba.sh: line 4: main: command not found
Error: Process completed with exit code 127.```
It looks like the Earthly build job is successful, and there isn’t a single additional line after the `earthly …` command, yet Github Actions is failing my build with the `line 4: main: command not found` error. Any insights?