From 8bb1ee89c2ba18d596d266e8b1aaed7a8f1183e2 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Wed, 29 Oct 2025 08:39:14 +0000 Subject: [PATCH 01/20] feat: add renovate --- .github/renovate.json5 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/renovate.json5 diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 0000000..c34b9a1 --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,24 @@ +{ + $schema: 'https://docs.renovatebot.com/renovate-schema.json', + extends: [ + 'config:best-practices', + 'security:openssf-scorecard', + ':semanticCommits', + ':pinVersions', + ], + configMigration: true, + dockerfile: { + managerFilePatterns: ['/Earthfile/'], + }, + customManagers: [ + { + customType: 'regex', + description: 'Update _version ARGs and ENVs in Earthfile', + managerFilePatterns: ['/^Earthfile$/'], + matchStrings: [ + '#\\s*renovate:\\s*datasource=(?[a-z-]+?)(?:\\s+depName=(?.+?))?\\s+packageName=(?.+?)(?:\\s+versioning=(?[a-z-]+?))?\\s+(?:ENV|ARG)\\s+.+?(_VERSION|_VER|_version)=(?.+?)\\s', + ], + }, + ], + labels: ['renovate'], +} From ce3be2163687379584feaba8d6f2185970204e8d Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Wed, 29 Oct 2025 09:01:45 +0000 Subject: [PATCH 02/20] feat: make ci work --- .github/CODEOWNERS | 2 -- .github/workflows/ci.yml | 46 ++++++++++++++++----------------------- CONTRIBUTING.md | 10 --------- utils/git/tests/Earthfile | 10 ++++----- 4 files changed, 24 insertions(+), 44 deletions(-) delete mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index e2d3d45..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# PRs require approval from the earthly core team -* @earthly/core diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 785fb7f..86d18ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,54 +9,46 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true - + jobs: test: name: +test - runs-on: [earthly-satellite#gha-lib] # https://docs.earthly.dev/earthly-cloud/satellites/gha-runners + runs-on: ubuntu-latest env: FORCE_COLOR: 1 EARTHLY_CONVERSION_PARALLELISM: "5" EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" EARTHLY_INSTALL_ID: "earthly-lib-githubactions" steps: - - uses: actions/checkout@v2 - - name: Docker mirror login (non fork only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Configure Earthly to use mirror (non fork only) - run: |- - earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + - uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Run tests run: |- - earthly config git "{github.com: {auth: ssh, user: git}}" && \ - eval $(ssh-agent) && \ - earthly secrets --org earthly-technologies --project core get littleredcorvette-id_rsa | ssh-add - && \ + # earthly config git "{github.com: {auth: ssh, user: git}}" && \ + # eval $(ssh-agent) && \ + # earthly secrets --org earthly-technologies --project core get littleredcorvette-id_rsa | ssh-add - && \ earthly --ci -P +test test-native-arm: name: +test-native-arm - runs-on: [earthly-satellite#gha-arm-lib] # https://docs.earthly.dev/earthly-cloud/satellites/gha-runners + runs-on: ubuntu-latest-arm env: FORCE_COLOR: 1 EARTHLY_CONVERSION_PARALLELISM: "5" EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" EARTHLY_INSTALL_ID: "earthly-lib-githubactions" steps: - - uses: actions/checkout@v2 - - name: Docker mirror login (non fork only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Configure Earthly to use mirror (non fork only) - run: |- - earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + - uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Run tests run: |- - earthly config git "{github.com: {auth: ssh, user: git}}" && \ - eval $(ssh-agent) && \ - earthly secrets --org earthly-technologies --project core get littleredcorvette-id_rsa | ssh-add - && \ + # earthly config git "{github.com: {auth: ssh, user: git}}" && \ + # eval $(ssh-agent) && \ + # earthly secrets --org earthly-technologies --project core get littleredcorvette-id_rsa | ssh-add - && \ earthly --ci -P ./utils/dind+test diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a83ba7d..2c1d7ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,13 +3,3 @@ ## Code of Conduct Please refer to the [CNCF Community Code of Conduct v1.0](https://github.com/cncf/foundation/blob/main/code-of-conduct.md) - -## CLA - -### Individual - -All contributions must indicate agreement to the [Earthly Contributor License Agreement](https://gist.github.com/vladaionescu/ed990fa149a38a53ac74b64155bc6766) by logging into GitHub via the CLA assistant and signing the provided CLA. The CLA assistant will automatically notify the PRs that require CLA signing. - -### Entity - -If you are an entity, please use the [Earthly Contributor License Agreement form](https://earthly.dev/cla-form) in addition to requiring your individual contributors to sign all contributions. diff --git a/utils/git/tests/Earthfile b/utils/git/tests/Earthfile index 0280ce7..1ca98bc 100644 --- a/utils/git/tests/Earthfile +++ b/utils/git/tests/Earthfile @@ -11,11 +11,11 @@ all: --base_image=ubuntu:latest \ --base_image=amazonlinux:1 \ --base_image=amazonlinux:2 \ - --GIT_URL=https://github.com/earthly/hello-world.git \ - --GIT_URL=git@github.com:earthly/hello-world.git \ - --GIT_URL=git@github.com:earthly/hello-world \ - --SECRET_PATH="" \ - --SECRET_PATH="littleredcorvette-id_rsa" \ + --GIT_URL=https://github.com/EarthBuild/hello-world.git \ + --GIT_URL=git@github.com:EarthBuild/hello-world.git \ + --GIT_URL=git@github.com:EarthBuild/hello-world \ + # --SECRET_PATH="" \ + # --SECRET_PATH="littleredcorvette-id_rsa" \ --DEST_DIR="" \ --DEST_DIR="some-other-dir" From 7fc3534ce5db646741fe326dd902e29e3672ed90 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Wed, 29 Oct 2025 09:09:47 +0000 Subject: [PATCH 03/20] fix: install earthly --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86d18ff..a6237b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,9 @@ jobs: with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - uses: earthly/actions-setup@bda7cee4972033c6d6b77d77165e787f389f8752 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Run tests run: |- # earthly config git "{github.com: {auth: ssh, user: git}}" && \ @@ -46,6 +49,9 @@ jobs: with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - uses: earthly/actions-setup@bda7cee4972033c6d6b77d77165e787f389f8752 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Run tests run: |- # earthly config git "{github.com: {auth: ssh, user: git}}" && \ From 9522ff699fc8a2c695ec185e164f1779fd1e61b4 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Thu, 30 Oct 2025 08:43:27 +0000 Subject: [PATCH 04/20] fix: point to a real machine type --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6237b2..abdfe55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: test-native-arm: name: +test-native-arm - runs-on: ubuntu-latest-arm + runs-on: ubuntu-24.04-arm env: FORCE_COLOR: 1 EARTHLY_CONVERSION_PARALLELISM: "5" From 6ebe55372dea2f452712b6f28813c6739b338043 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Thu, 30 Oct 2025 09:09:20 +0000 Subject: [PATCH 05/20] feat: less layers --- utils/git/tests/Earthfile | 2 -- utils/ssh/Earthfile | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/utils/git/tests/Earthfile b/utils/git/tests/Earthfile index 1ca98bc..2633de3 100644 --- a/utils/git/tests/Earthfile +++ b/utils/git/tests/Earthfile @@ -1,7 +1,5 @@ VERSION --arg-scope-and-set --pass-args 0.7 -PROJECT earthly-technologies/core - all: BUILD --platform=linux/amd64 --platform=linux/arm64 +test-deep-clone-image \ --base_image=alpine/git:latest \ diff --git a/utils/ssh/Earthfile b/utils/ssh/Earthfile index 0485e57..d50a38e 100644 --- a/utils/ssh/Earthfile +++ b/utils/ssh/Earthfile @@ -6,8 +6,9 @@ ADD_KNOWN_HOSTS: ARG target_file=~/.ssh/known_hosts LET expanded_target_file="$(eval echo $target_file)" COPY +known-hosts/known_hosts /tmp/. - RUN mkdir -p $(dirname $expanded_target_file) && cat /tmp/known_hosts >> $expanded_target_file - RUN rm /tmp/known_hosts + RUN mkdir -p $(dirname $expanded_target_file) \ + && cat /tmp/known_hosts >> $expanded_target_file \ + && rm /tmp/known_hosts # known-hosts is used to copy the known_hosts file into the build context (internal use) known-hosts: From b6642f61174b88346d2db0fdb07e6f34cd3393e5 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 3 Nov 2025 07:37:02 +0000 Subject: [PATCH 06/20] fix: use ssh + upgrade crypto --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++---------- utils/git/Earthfile | 2 +- utils/git/tests/Earthfile | 4 ++-- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abdfe55..a81b68a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,11 +29,17 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Run tests - run: |- - # earthly config git "{github.com: {auth: ssh, user: git}}" && \ - # eval $(ssh-agent) && \ - # earthly secrets --org earthly-technologies --project core get littleredcorvette-id_rsa | ssh-add - && \ - earthly --ci -P +test + run: | + earthly config git "{github.com: {auth: ssh, user: git}}" + eval $(ssh-agent) + mkdir -p ~/.ssh + chmod 700 ~/.ssh + cat > ~/.ssh/id_ed25519 <<'EOF' + ${{ secrets.EARTHBUILDCI_GITHUB_USER_SSH_PRIVATE_KEY }} + EOF + chmod 600 ~/.ssh/id_ed25519 + ssh-add ~/.ssh/id_ed25519 + earthly --ci -P --secret-file earthbuildci_id_ed25519=~/.ssh/id_ed25519 +test test-native-arm: name: +test-native-arm @@ -53,8 +59,14 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Run tests - run: |- - # earthly config git "{github.com: {auth: ssh, user: git}}" && \ - # eval $(ssh-agent) && \ - # earthly secrets --org earthly-technologies --project core get littleredcorvette-id_rsa | ssh-add - && \ - earthly --ci -P ./utils/dind+test + run: | + earthly config git "{github.com: {auth: ssh, user: git}}" + eval $(ssh-agent) + mkdir -p ~/.ssh + chmod 700 ~/.ssh + cat > ~/.ssh/id_ed25519 <<'EOF' + ${{ secrets.EARTHBUILDCI_GITHUB_USER_SSH_PRIVATE_KEY }} + EOF + chmod 600 ~/.ssh/id_ed25519 + ssh-add ~/.ssh/id_ed25519 + earthly --ci -P --secret-file earthbuildci_id_ed25519=~/.ssh/id_ed25519 ./utils/dind+test diff --git a/utils/git/Earthfile b/utils/git/Earthfile index 88c022e..71bca29 100644 --- a/utils/git/Earthfile +++ b/utils/git/Earthfile @@ -22,7 +22,7 @@ DEEP_CLONE: IF [ -z $SECRET_PATH ] RUN --ssh git fetch --unshallow ELSE - RUN --mount=type=secret,id=$SECRET_PATH,mode=0400,target=/root/.ssh/id_rsa \ + RUN --mount=type=secret,id=$SECRET_PATH,mode=0400,target=/root/.ssh/id_ed25519 \ git fetch --unshallow END diff --git a/utils/git/tests/Earthfile b/utils/git/tests/Earthfile index 2633de3..01b4b87 100644 --- a/utils/git/tests/Earthfile +++ b/utils/git/tests/Earthfile @@ -12,8 +12,8 @@ all: --GIT_URL=https://github.com/EarthBuild/hello-world.git \ --GIT_URL=git@github.com:EarthBuild/hello-world.git \ --GIT_URL=git@github.com:EarthBuild/hello-world \ - # --SECRET_PATH="" \ - # --SECRET_PATH="littleredcorvette-id_rsa" \ + --SECRET_PATH="" \ + --SECRET_PATH="earthbuildci_id_ed25519" \ --DEST_DIR="" \ --DEST_DIR="some-other-dir" From 6b7291c7f8cac56d439a665e9cc8769f03c46ea4 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 3 Nov 2025 07:45:16 +0000 Subject: [PATCH 07/20] fix: use ssh + upgrade crypto --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a81b68a..17a63fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,9 +34,7 @@ jobs: eval $(ssh-agent) mkdir -p ~/.ssh chmod 700 ~/.ssh - cat > ~/.ssh/id_ed25519 <<'EOF' - ${{ secrets.EARTHBUILDCI_GITHUB_USER_SSH_PRIVATE_KEY }} - EOF + printf '%s\n' "${{ secrets.EARTHBUILDCI_GITHUB_USER_SSH_PRIVATE_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 ssh-add ~/.ssh/id_ed25519 earthly --ci -P --secret-file earthbuildci_id_ed25519=~/.ssh/id_ed25519 +test @@ -64,9 +62,10 @@ jobs: eval $(ssh-agent) mkdir -p ~/.ssh chmod 700 ~/.ssh - cat > ~/.ssh/id_ed25519 <<'EOF' - ${{ secrets.EARTHBUILDCI_GITHUB_USER_SSH_PRIVATE_KEY }} - EOF + printf '%s\n' "${{ secrets.EARTHBUILDCI_GITHUB_USER_SSH_PRIVATE_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 ssh-add ~/.ssh/id_ed25519 + ssh-keyscan -t rsa,ecdsa,ed25519 -H github.com >> ~/.ssh/known_hosts + ssh-keyscan -p 443 -t rsa,ecdsa,ed25519 -H ssh.github.com >> ~/.ssh/known_hosts + chmod 644 ~/.ssh/known_hosts earthly --ci -P --secret-file earthbuildci_id_ed25519=~/.ssh/id_ed25519 ./utils/dind+test From 75eb7fedc660e57c46f7d24f290f52ad1bbde94b Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 3 Nov 2025 08:20:59 +0000 Subject: [PATCH 08/20] fix: amazonlinux:1 emulator crashes on arm mac --- utils/dind/tests/Earthfile | 2 +- utils/git/tests/Earthfile | 2 +- utils/ssh/tests/Earthfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/dind/tests/Earthfile b/utils/dind/tests/Earthfile index a207ce7..9d40211 100644 --- a/utils/dind/tests/Earthfile +++ b/utils/dind/tests/Earthfile @@ -8,7 +8,7 @@ all: --base_image=debian:stable-slim \ --base_image=debian:oldstable \ --base_image=ubuntu:latest \ - --base_image=amazonlinux:1 \ + # --base_image=amazonlinux:1 \ --base_image=amazonlinux:2 \ --base_image=earthly/dind:alpine \ --base_image=earthly/dind:ubuntu diff --git a/utils/git/tests/Earthfile b/utils/git/tests/Earthfile index 01b4b87..a8598c6 100644 --- a/utils/git/tests/Earthfile +++ b/utils/git/tests/Earthfile @@ -7,7 +7,7 @@ all: --base_image=debian:stable \ --base_image=debian:stable-slim \ --base_image=ubuntu:latest \ - --base_image=amazonlinux:1 \ + # --base_image=amazonlinux:1 \ --base_image=amazonlinux:2 \ --GIT_URL=https://github.com/EarthBuild/hello-world.git \ --GIT_URL=git@github.com:EarthBuild/hello-world.git \ diff --git a/utils/ssh/tests/Earthfile b/utils/ssh/tests/Earthfile index 58d6241..3ee6094 100644 --- a/utils/ssh/tests/Earthfile +++ b/utils/ssh/tests/Earthfile @@ -6,7 +6,7 @@ all: --base_image=debian:stable \ --base_image=debian:stable-slim \ --base_image=ubuntu:latest \ - --base_image=amazonlinux:1 \ + # --base_image=amazonlinux:1 \ --base_image=amazonlinux:2 \ --target_file=~/to_interpolate/known_hosts \ --target_file=no_dir_new_known_hosts \ From bcce1db2b12d144b14bbfede55f872ac5fa68d48 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 3 Nov 2025 08:24:25 +0000 Subject: [PATCH 09/20] fix: temp pause alpine --- utils/ssh/tests/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/ssh/tests/Earthfile b/utils/ssh/tests/Earthfile index 3ee6094..1ee983c 100644 --- a/utils/ssh/tests/Earthfile +++ b/utils/ssh/tests/Earthfile @@ -2,7 +2,7 @@ VERSION --pass-args --arg-scope-and-set 0.7 all: BUILD --platform=linux/amd64 --platform=linux/arm64 +test-add-known-hosts-image \ - --base_image=alpine:latest \ + # --base_image=alpine:latest \ --base_image=debian:stable \ --base_image=debian:stable-slim \ --base_image=ubuntu:latest \ From c90e611c5cad1280b4e208fc06d96750a86be0bb Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 3 Nov 2025 08:28:14 +0000 Subject: [PATCH 10/20] fix: reduce emulation --- utils/ssh/tests/Earthfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/ssh/tests/Earthfile b/utils/ssh/tests/Earthfile index 1ee983c..c63bd64 100644 --- a/utils/ssh/tests/Earthfile +++ b/utils/ssh/tests/Earthfile @@ -1,8 +1,9 @@ VERSION --pass-args --arg-scope-and-set 0.7 + # --platform=linux/amd64 --platform=linux/arm64 all: - BUILD --platform=linux/amd64 --platform=linux/arm64 +test-add-known-hosts-image \ - # --base_image=alpine:latest \ + BUILD +test-add-known-hosts-image \ + --base_image=alpine:latest \ --base_image=debian:stable \ --base_image=debian:stable-slim \ --base_image=ubuntu:latest \ From 529af1dce189a68e63ad0513883ad9f69fc7adc4 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 3 Nov 2025 08:30:24 +0000 Subject: [PATCH 11/20] fix: reduce emulation --- utils/git/tests/Earthfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/git/tests/Earthfile b/utils/git/tests/Earthfile index a8598c6..02a59cb 100644 --- a/utils/git/tests/Earthfile +++ b/utils/git/tests/Earthfile @@ -1,7 +1,8 @@ VERSION --arg-scope-and-set --pass-args 0.7 +# --platform=linux/amd64 --platform=linux/arm64 all: - BUILD --platform=linux/amd64 --platform=linux/arm64 +test-deep-clone-image \ + BUILD +test-deep-clone-image \ --base_image=alpine/git:latest \ --base_image=alpine:latest \ --base_image=debian:stable \ From adba4b8ca302592c746885237aac17a45101859b Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 3 Nov 2025 08:35:33 +0000 Subject: [PATCH 12/20] fix: turn on all arm tests --- .github/workflows/ci.yml | 2 +- utils/git/tests/Earthfile | 1 - utils/ssh/tests/Earthfile | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17a63fb..3998214 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,4 +68,4 @@ jobs: ssh-keyscan -t rsa,ecdsa,ed25519 -H github.com >> ~/.ssh/known_hosts ssh-keyscan -p 443 -t rsa,ecdsa,ed25519 -H ssh.github.com >> ~/.ssh/known_hosts chmod 644 ~/.ssh/known_hosts - earthly --ci -P --secret-file earthbuildci_id_ed25519=~/.ssh/id_ed25519 ./utils/dind+test + earthly --ci -P --secret-file earthbuildci_id_ed25519=~/.ssh/id_ed25519 +test diff --git a/utils/git/tests/Earthfile b/utils/git/tests/Earthfile index 02a59cb..a44b645 100644 --- a/utils/git/tests/Earthfile +++ b/utils/git/tests/Earthfile @@ -1,6 +1,5 @@ VERSION --arg-scope-and-set --pass-args 0.7 -# --platform=linux/amd64 --platform=linux/arm64 all: BUILD +test-deep-clone-image \ --base_image=alpine/git:latest \ diff --git a/utils/ssh/tests/Earthfile b/utils/ssh/tests/Earthfile index c63bd64..51f144d 100644 --- a/utils/ssh/tests/Earthfile +++ b/utils/ssh/tests/Earthfile @@ -1,6 +1,5 @@ VERSION --pass-args --arg-scope-and-set 0.7 - # --platform=linux/amd64 --platform=linux/arm64 all: BUILD +test-add-known-hosts-image \ --base_image=alpine:latest \ From 9aad9b65344d534696da7ccc75077a80c06ede75 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 3 Nov 2025 08:49:57 +0000 Subject: [PATCH 13/20] fix: add amazonlinux:1 back in now emulation off --- utils/dind/tests/Earthfile | 2 +- utils/git/tests/Earthfile | 2 +- utils/ssh/tests/Earthfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/dind/tests/Earthfile b/utils/dind/tests/Earthfile index 9d40211..a207ce7 100644 --- a/utils/dind/tests/Earthfile +++ b/utils/dind/tests/Earthfile @@ -8,7 +8,7 @@ all: --base_image=debian:stable-slim \ --base_image=debian:oldstable \ --base_image=ubuntu:latest \ - # --base_image=amazonlinux:1 \ + --base_image=amazonlinux:1 \ --base_image=amazonlinux:2 \ --base_image=earthly/dind:alpine \ --base_image=earthly/dind:ubuntu diff --git a/utils/git/tests/Earthfile b/utils/git/tests/Earthfile index a44b645..6a2c1b6 100644 --- a/utils/git/tests/Earthfile +++ b/utils/git/tests/Earthfile @@ -7,7 +7,7 @@ all: --base_image=debian:stable \ --base_image=debian:stable-slim \ --base_image=ubuntu:latest \ - # --base_image=amazonlinux:1 \ + --base_image=amazonlinux:1 \ --base_image=amazonlinux:2 \ --GIT_URL=https://github.com/EarthBuild/hello-world.git \ --GIT_URL=git@github.com:EarthBuild/hello-world.git \ diff --git a/utils/ssh/tests/Earthfile b/utils/ssh/tests/Earthfile index 51f144d..6fd717e 100644 --- a/utils/ssh/tests/Earthfile +++ b/utils/ssh/tests/Earthfile @@ -6,7 +6,7 @@ all: --base_image=debian:stable \ --base_image=debian:stable-slim \ --base_image=ubuntu:latest \ - # --base_image=amazonlinux:1 \ + --base_image=amazonlinux:1 \ --base_image=amazonlinux:2 \ --target_file=~/to_interpolate/known_hosts \ --target_file=no_dir_new_known_hosts \ From e2d355d0e31041d5551154c2548a1587d163cbb7 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 4 Nov 2025 08:42:46 +0000 Subject: [PATCH 14/20] fix: add back CODEOWNERS --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..bea3553 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +# PRs require approval from the EarthBuild core team +* @EarthBuild/fork-admins From d5c08d33ce69512639a9445f1e7af73c06bca9c8 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 4 Nov 2025 08:44:09 +0000 Subject: [PATCH 15/20] fix: mv CODEOWNERS to under .github --- CODEOWNERS => .github/CODEOWNERS | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CODEOWNERS => .github/CODEOWNERS (100%) diff --git a/CODEOWNERS b/.github/CODEOWNERS similarity index 100% rename from CODEOWNERS rename to .github/CODEOWNERS From 133d43e505bf1a06c454f46eac156e10a69fa4db Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 4 Nov 2025 08:52:53 +0000 Subject: [PATCH 16/20] fix: pin ubuntu runner version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3998214..19cc363 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ concurrency: jobs: test: name: +test - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: FORCE_COLOR: 1 EARTHLY_CONVERSION_PARALLELISM: "5" From 1c5ddcb1ccd892c46c59c30b5feda076045e6ddc Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 4 Nov 2025 09:05:39 +0000 Subject: [PATCH 17/20] fix: allow build to get further if fork. Will still fail further down. --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19cc363..63bbca5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,8 @@ jobs: steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 - uses: docker/login-action@v3 + # if fork no secret access, so skip and take chances on rate limiting. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -50,6 +52,8 @@ jobs: steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 - uses: docker/login-action@v3 + # if fork no secret access, so skip and take chances on rate limiting. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} From 4e81e36d7aa9d053b350b76af95569ebe1c0a76a Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 25 Nov 2025 08:29:55 +0000 Subject: [PATCH 18/20] fix: wasn't interpreting var correctly --- utils/dind/tests/Earthfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/dind/tests/Earthfile b/utils/dind/tests/Earthfile index a207ce7..45f2a92 100644 --- a/utils/dind/tests/Earthfile +++ b/utils/dind/tests/Earthfile @@ -1,9 +1,12 @@ -VERSION 0.7 +VERSION 0.8 all: + # renovate: datasource=docker packageName=alpine + LET alpine_version=3.22.2 + BUILD +test-install-dind-for-image \ --base_image=docker:dind \ - --base_image=alpine:latest \ + --base_image=alpine:${alpine_version} \ --base_image=debian:stable \ --base_image=debian:stable-slim \ --base_image=debian:oldstable \ From bb93d3d76c789f9ec85bd612ac4d860d6a40a2ef Mon Sep 17 00:00:00 2001 From: Rory Dunne Date: Fri, 7 Aug 2026 11:29:45 -0400 Subject: [PATCH 19/20] fix: update variables to use EARTH for earthbuild v0.8.18 Also remove instances of Earthly from Earthfiles --- gradle/Earthfile | 18 ++++---- gradle/README.md | 8 ++-- rust/Earthfile | 86 +++++++++++++++++++------------------- rust/README.md | 12 +++--- utils/dind/install-dind.sh | 2 +- utils/dind/tests/Earthfile | 6 +-- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/gradle/Earthfile b/gradle/Earthfile index 1753241..86b93bc 100644 --- a/gradle/Earthfile +++ b/gradle/Earthfile @@ -2,20 +2,20 @@ VERSION --global-cache 0.7 # GRADLE_GET_MOUNT_CACHE sets the following entries in the calling environment: -# EARTHLY_GRADLE_USER_HOME_CACHE: Code of the mount cache for the gradle home. -# EARTHLY_GRADLE_PROJECT_CACHE: Code of the mount cache for the .gradle folder. +# EARTH_GRADLE_USER_HOME_CACHE: Code of the mount cache for the gradle home. +# EARTH_GRADLE_PROJECT_CACHE: Code of the mount cache for the .gradle folder. # Example: # DO gradle+GRADLE_GET_MOUNT_CACHE -# RUN --mount=$EARTHLY_GRADLE_USER_HOME_CACHE --mount=$EARTHLY_GRADLE_PROJECT_CACHE gradle --no-daemon build +# RUN --mount=$EARTH_GRADLE_USER_HOME_CACHE --mount=$EARTH_GRADLE_PROJECT_CACHE gradle --no-daemon build # Arguments: -# - cache_prefix: To be used in both caches. By default: ${EARTHLY_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-gradle-cache +# - cache_prefix: To be used in both caches. By default: ${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earth-gradle-cache GRADLE_GET_MOUNT_CACHE: COMMAND - ARG EARTHLY_TARGET_PROJECT_NO_TAG - ARG cache_prefix = "${EARTHLY_TARGET_PROJECT_NO_TAG}#earthly-gradle-cache" + ARG EARTH_TARGET_PROJECT_NO_TAG + ARG cache_prefix = "${EARTH_TARGET_PROJECT_NO_TAG}#earth-gradle-cache" IF [ "$GRADLE_USER_HOME" = "" ] ENV GRADLE_USER_HOME="$HOME/.gradle" END - ENV EARTHLY_GRADLE_CACHE_PREFIX=$cache_prefix - ENV EARTHLY_GRADLE_USER_HOME_CACHE="type=cache,mode=0777,id=$cache_prefix,sharing=shared,target=$GRADLE_USER_HOME" - ENV EARTHLY_GRADLE_PROJECT_CACHE="type=cache,mode=0777,id=${cache_prefix}#project,sharing=shared,target=.gradle" + ENV EARTH_GRADLE_CACHE_PREFIX=$cache_prefix + ENV EARTH_GRADLE_USER_HOME_CACHE="type=cache,mode=0777,id=$cache_prefix,sharing=shared,target=$GRADLE_USER_HOME" + ENV EARTH_GRADLE_PROJECT_CACHE="type=cache,mode=0777,id=${cache_prefix}#project,sharing=shared,target=.gradle" diff --git a/gradle/README.md b/gradle/README.md index c1c283e..6b88b2f 100644 --- a/gradle/README.md +++ b/gradle/README.md @@ -12,16 +12,16 @@ IMPORT github.com/earthly/lib/gradle: AS gradle ## +GRADLE_GET_MOUNT_CACHE This function sets the following entries in the calling environment, so they can be used later to parametrize two global mount caches in `RUN` commands: -- `$EARTHLY_GRADLE_USER_HOME_CACHE`: Code of the mount cache for the [gradle user home](https://docs.gradle.org/current/userguide/directory_layout.html#dir:gradle_user_home) directory. -- `$EARTHLY_GRADLE_PROJECT_CACHE`: Code of the mount cache for the [gradle project root](https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root) directory. +- `$EARTH_GRADLE_USER_HOME_CACHE`: Code of the mount cache for the [gradle user home](https://docs.gradle.org/current/userguide/directory_layout.html#dir:gradle_user_home) directory. +- `$EARTH_GRADLE_PROJECT_CACHE`: Code of the mount cache for the [gradle project root](https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root) directory. ### Arguments -- `cache_prefix`: To be used in both caches. By default: `${EARTHLY_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-gradle-cache` +- `cache_prefix`: To be used in both caches. By default: `${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-gradle-cache` ### Example ```earthly DO gradle+GRADLE_GET_MOUNT_CACHE -RUN --mount=$EARTHLY_GRADLE_USER_HOME_CACHE --mount=$EARTHLY_GRADLE_PROJECT_CACHE gradle --no-daemon build +RUN --mount=$EARTH_GRADLE_USER_HOME_CACHE --mount=$EARTH_GRADLE_PROJECT_CACHE gradle --no-daemon build ``` ### Scoping diff --git a/rust/Earthfile b/rust/Earthfile index 73a14c7..b6f8d83 100644 --- a/rust/Earthfile +++ b/rust/Earthfile @@ -1,12 +1,12 @@ VERSION 0.8 # INIT sets some configuration in the environment (used by following functions), and installs required dependencies. # Arguments: -# - cache_prefix: Overrides cache prefix for cache IDS. Its value is exported to the build environment under the entry: $EARTHLY_CACHE_PREFIX. By default ${EARTHLY_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-cargo-cache +# - cache_prefix: Overrides cache prefix for cache IDS. Its value is exported to the build environment under the entry: $EARTH_CACHE_PREFIX. By default ${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earth-cargo-cache # - keep_fingerprints (false): Instructs the following +CARGO calls to not remove the Cargo fingerprints of the source packages. Use only when source packages have been COPYed with --keep-ts option. # - sweep_days (4): +CARGO uses cargo-sweep to clean build artifacts that haven't been accessed for this number of days. INIT: FUNCTION - RUN if [ -n "$EARTHLY_CACHE_PREFIX" ]; then \ + RUN if [ -n "$EARTH_CACHE_PREFIX" ]; then \ echo "+INIT has already been called in this build environment" ; \ exit 1; \ fi @@ -18,28 +18,28 @@ INIT: END DO +INSTALL_CARGO_SWEEP - # $EARTHLY_CACHE_PREFIX - ARG EARTHLY_TARGET_PROJECT_NO_TAG #https://docs.earthly.dev/docs/earthfile/builtin-args + # $EARTH_CACHE_PREFIX + ARG EARTH_TARGET_PROJECT_NO_TAG #https://docs.earthbuild.dev/docs/earthfile/builtin-args ARG OS_RELEASE=$(md5sum /etc/os-release | cut -d ' ' -f 1) - ARG cache_prefix="${EARTHLY_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-cargo-cache" - ENV EARTHLY_CACHE_PREFIX=$cache_prefix + ARG cache_prefix="${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earth-cargo-cache" + ENV EARTH_CACHE_PREFIX=$cache_prefix - # $EARTHLY_KEEP_FINGERPRINTS + # $EARTH_KEEP_FINGERPRINTS ARG keep_fingerprints=false - ENV EARTHLY_KEEP_FINGERPRINTS=$keep_fingerprints + ENV EARTH_KEEP_FINGERPRINTS=$keep_fingerprints - # $EARTHLY_SWEEP_DAYS + # $EARTH_SWEEP_DAYS ARG sweep_days=4 - ENV EARTHLY_SWEEP_DAYS=$sweep_days + ENV EARTH_SWEEP_DAYS=$sweep_days # Make sure that crates installed through this function are stored in the original cargo home, and not in the cargo home within the mount cache. # This way, if BK garbage-collects them, the build is not broken. ENV CARGO_INSTALL_ROOT=$CARGO_HOME # We change $CARGO_HOME while keeping $ORIGINAL_CARGO_HOME/bin directory in the path. This way, the Cargo binary is still accessible and the whole $CARGO_HOME is within the global cache # ($CARGO_HOME/.package-cache has to be in the cache so Cargo can properly synchronize parallel access to $CARGO_HOME resources). - ENV CARGO_HOME="/tmp/earthly/.cargo" + ENV CARGO_HOME="/tmp/earth/.cargo" - DO +INSTALL_EARTHLY_FUNCTIONS + DO +INSTALL_EARTH_FUNCTIONS # CARGO runs the cargo command "cargo $args". @@ -56,34 +56,34 @@ CARGO: ARG --required args ARG output DO +SET_CACHE_MOUNTS_ENV - IF [ "$EARTHLY_KEEP_FINGERPRINTS" = "false" ] + IF [ "$EARTH_KEEP_FINGERPRINTS" = "false" ] DO +REMOVE_SOURCE_FINGERPRINTS END - RUN --mount=$EARTHLY_RUST_CARGO_HOME_CACHE --mount=$EARTHLY_RUST_TARGET_CACHE \ + RUN --mount=$EARTH_RUST_CARGO_HOME_CACHE --mount=$EARTH_RUST_TARGET_CACHE \ set -e; \ cargo $args; \ - cargo sweep -r -t $EARTHLY_SWEEP_DAYS; \ + cargo sweep -r -t $EARTH_SWEEP_DAYS; \ cargo sweep -r -i; \ - $EARTHLY_FUNCTIONS_HOME/copy-output.sh "$output"; - RUN $EARTHLY_FUNCTIONS_HOME/rename-output.sh + $EARTH_FUNCTIONS_HOME/copy-output.sh "$output"; + RUN $EARTH_FUNCTIONS_HOME/rename-output.sh # SET_CACHE_MOUNTS_ENV sets the following entries in the environment, to be used to mount the cargo caches. -# - EARTHLY_RUST_CARGO_HOME_CACHE: Code of the mount cache for the cargo home. -# - EARTHLY_RUST_TARGET_CACHE: Code of the mount cache for the target folder. +# - EARTH_RUST_CARGO_HOME_CACHE: Code of the mount cache for the cargo home. +# - EARTH_RUST_TARGET_CACHE: Code of the mount cache for the target folder. # Notice that in order to run this function, +INIT must be called first. # Arguments: # - target_cache_suffix: Optional cache suffix for the target folder cache ID. # Example: # DO rust+SET_CACHE_MOUNTS_ENV -# RUN --mount=$EARTHLY_RUST_CARGO_HOME_CACHE --mount=$EARTHLY_RUST_TARGET_CACHE cargo build --release +# RUN --mount=$EARTH_RUST_CARGO_HOME_CACHE --mount=$EARTH_RUST_TARGET_CACHE cargo build --release SET_CACHE_MOUNTS_ENV: FUNCTION DO +CHECK_INITED ARG target_cache_suffix ARG TARGETPLATFORM - ARG EARTHLY_TARGET_NAME #https://docs.earthly.dev/docs/earthfile/builtin-args - ENV EARTHLY_RUST_CARGO_HOME_CACHE="type=cache,mode=0777,id=$EARTHLY_CACHE_PREFIX#cargo-home,sharing=shared,target=$CARGO_HOME" - ENV EARTHLY_RUST_TARGET_CACHE="type=cache,mode=0777,id=$EARTHLY_CACHE_PREFIX#target#$EARTHLY_TARGET_NAME#$TARGETPLATFORM#$target_cache_suffix,sharing=locked,target=target" + ARG EARTH_TARGET_NAME #https://docs.earthbuild.dev/docs/earthfile/builtin-args + ENV EARTH_RUST_CARGO_HOME_CACHE="type=cache,mode=0777,id=$EARTH_CACHE_PREFIX#cargo-home,sharing=shared,target=$CARGO_HOME" + ENV EARTH_RUST_TARGET_CACHE="type=cache,mode=0777,id=$EARTH_CACHE_PREFIX#target#$EARTH_TARGET_NAME#$TARGETPLATFORM#$target_cache_suffix,sharing=locked,target=target" # COPY_OUTPUT copies files out of the target cache into the image layers. # Use this function when you want to SAVE an ARTIFACT from the target folder (mounted cache), always trying to minimize the total size of the copied fileset. @@ -92,18 +92,18 @@ SET_CACHE_MOUNTS_ENV: # - output: Regex matching output artifacts files to be copied to ./target folder in the caller filesystem (image layers). # Example: # DO rust+SET_CACHE_MOUNTS_ENV -# RUN --mount=$EARTHLY_RUST_CARGO_HOME_CACHE --mount=$EARTHLY_RUST_TARGET_CACHE cargo build --release +# RUN --mount=$EARTH_RUST_CARGO_HOME_CACHE --mount=$EARTH_RUST_TARGET_CACHE cargo build --release # DO rust+COPY_OUTPUT --output="release/[^\./]+" # Keep all the files in /target/release that don't have any extension. COPY_OUTPUT: FUNCTION ARG --required output DO +CHECK_INITED - RUN if [ ! -n "$EARTHLY_RUST_TARGET_CACHE" ]; then \ + RUN if [ ! -n "$EARTH_RUST_TARGET_CACHE" ]; then \ echo "+SET_CACHE_MOUNTS_ENV has not been called yet in this build environment" ; \ exit 1; \ fi; - RUN --mount=$EARTHLY_RUST_TARGET_CACHE $EARTHLY_FUNCTIONS_HOME/copy-output.sh "$output" - RUN $EARTHLY_FUNCTIONS_HOME/rename-output.sh + RUN --mount=$EARTH_RUST_TARGET_CACHE $EARTH_FUNCTIONS_HOME/copy-output.sh "$output" + RUN $EARTH_FUNCTIONS_HOME/rename-output.sh # CROSS runs the [cross](https://github.com/cross-rs/cross) command "cross $args --target $target". # Notice that in order to run this function, +INIT must be called first. @@ -121,11 +121,11 @@ CROSS: ARG output="$target/release/[^\./]+" ARG version=0.2.5 DO +SET_CACHE_MOUNTS_ENV --target_cache_suffix="$target" - COPY (+get-cross/cross --version=$version) /tmp/earthly/cross + COPY (+get-cross/cross --version=$version) /tmp/earth/cross WITH DOCKER --pull ghcr.io/cross-rs/$target:$version - RUN --mount=$EARTHLY_RUST_CARGO_HOME_CACHE \ - --mount=$EARTHLY_RUST_TARGET_CACHE \ - /tmp/earthly/cross $args --target=$target; + RUN --mount=$EARTH_RUST_CARGO_HOME_CACHE \ + --mount=$EARTH_RUST_TARGET_CACHE \ + /tmp/earth/cross $args --target=$target; END DO +COPY_OUTPUT --output="$output" @@ -159,12 +159,12 @@ INSTALL_CARGO_SWEEP: cargo install cargo-sweep@0.8.0 --locked --root $CARGO_HOME; \ fi; -INSTALL_EARTHLY_FUNCTIONS: +INSTALL_EARTH_FUNCTIONS: FUNCTION - ENV EARTHLY_FUNCTIONS_HOME="/tmp/earthly/functions" - RUN mkdir -p $EARTHLY_FUNCTIONS_HOME - RUN if [ ! -f $EARTHLY_FUNCTIONS_HOME/copy-output.sh ]; then \ - OUTPUT_TMP_FOLDER="/tmp/earthly/lib/rust"; \ + ENV EARTH_FUNCTIONS_HOME="/tmp/earth/functions" + RUN mkdir -p $EARTH_FUNCTIONS_HOME + RUN if [ ! -f $EARTH_FUNCTIONS_HOME/copy-output.sh ]; then \ + OUTPUT_TMP_FOLDER="/tmp/earth/lib/rust"; \ # copy-output.sh copies matching files from ./target to $OUTPUT_TMP_FOLDER # this function is expected to be called from a build context with ./target belonging to a shared cache echo "if [ -n \"\$1\" ]; then @@ -173,8 +173,8 @@ INSTALL_EARTHLY_FUNCTIONS: cd target; find . -type f -regextype posix-egrep -regex \"./\$1\" -exec cp --parents {} $OUTPUT_TMP_FOLDER \; ; cd ..; - fi;" > $EARTHLY_FUNCTIONS_HOME/copy-output.sh; \ - chmod +x $EARTHLY_FUNCTIONS_HOME/copy-output.sh; \ + fi;" > $EARTH_FUNCTIONS_HOME/copy-output.sh; \ + chmod +x $EARTH_FUNCTIONS_HOME/copy-output.sh; \ # rename-output.sh moves files back from $OUTPUT_TMP_FOLDER to ./target # this function is expected to be called from a build context with ./target not belonging to a shared cache echo "mkdir -p target; @@ -183,8 +183,8 @@ INSTALL_EARTHLY_FUNCTIONS: else cp -ruT \"$OUTPUT_TMP_FOLDER\" target; rm -rf \"$OUTPUT_TMP_FOLDER\"; - fi;" > $EARTHLY_FUNCTIONS_HOME/rename-output.sh; \ - chmod +x $EARTHLY_FUNCTIONS_HOME/rename-output.sh; \ + fi;" > $EARTH_FUNCTIONS_HOME/rename-output.sh; \ + chmod +x $EARTH_FUNCTIONS_HOME/rename-output.sh; \ fi; REMOVE_SOURCE_FINGERPRINTS: @@ -192,11 +192,11 @@ REMOVE_SOURCE_FINGERPRINTS: DO +CHECK_INITED COPY +get-tomljson/tomljson /tmp/tomljson COPY +get-jq/jq /tmp/jq - RUN if [ ! -n "$EARTHLY_RUST_TARGET_CACHE" ]; then \ + RUN if [ ! -n "$EARTH_RUST_TARGET_CACHE" ]; then \ echo "+SET_CACHE_MOUNTS_ENV has not been called yet in this build environment" ; \ exit 1; \ fi; - RUN --mount=$EARTHLY_RUST_TARGET_CACHE \ + RUN --mount=$EARTH_RUST_TARGET_CACHE \ set -e;\ source_libs=$(find . -name Cargo.toml -exec bash -c '/tmp/tomljson {} | /tmp/jq -r .package.name; printf "\n"' \;) ; \ fingerprint_folders=$(find target -name .fingerprint) ; \ @@ -209,7 +209,7 @@ REMOVE_SOURCE_FINGERPRINTS: CHECK_INITED: FUNCTION - RUN if [ ! -n "$EARTHLY_CACHE_PREFIX" ]; then \ + RUN if [ ! -n "$EARTH_CACHE_PREFIX" ]; then \ echo "+INIT has not been called yet in this build environment" ; \ exit 1; \ fi; diff --git a/rust/README.md b/rust/README.md index 689a3b4..5b5d0ef 100644 --- a/rust/README.md +++ b/rust/README.md @@ -26,8 +26,8 @@ DO rust+INIT ... ### Arguments #### `cache_prefix` -Overrides cache prefix for cache IDS. Its value is exported to the build environment under the entry: `$EARTHLY_CACHE_PREFIX`. -By default `${EARTHLY_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-cargo-cache` +Overrides cache prefix for cache IDS. Its value is exported to the build environment under the entry: `$EARTH_CACHE_PREFIX`. +By default `${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-cargo-cache` #### `keep_fingerprints (false)` @@ -69,8 +69,8 @@ This function is thread safe. Parallel builds of targets calling this function s ## +SET_CACHE_MOUNTS_ENV Sets the following entries in the environment, to be used to mount the cargo caches. - - `EARTHLY_RUST_CARGO_HOME_CACHE`: Code of the mount cache for the cargo home. - - `EARTHLY_RUST_TARGET_CACHE`: Code of the mount cache for the target folder. + - `EARTH_RUST_CARGO_HOME_CACHE`: Code of the mount cache for the cargo home. + - `EARTH_RUST_TARGET_CACHE`: Code of the mount cache for the target folder. Notice that in order to run this function, [+INIT](#init) must be called first. @@ -85,7 +85,7 @@ Optional cache suffix for the target folder cache ID. clean-target: ... DO rust+SET_CACHE_MOUNTS_ENV - RUN --mount=$EARTHLY_RUST_TARGET_CACHE rm -rf target + RUN --mount=$EARTH_RUST_TARGET_CACHE rm -rf target ``` ## +COPY_OUTPUT @@ -101,7 +101,7 @@ Regex matching output artifacts files to be copied to `./target` folder in the c ### Example ```earthfile DO rust+SET_RUST_CACHE_MOUNTS -RUN --mount=$EARTHLY_RUST_CARGO_HOME_CACHE --mount=$EARTHLY_RUST_TARGET_CACHE cargo build --release +RUN --mount=$EARTH_RUST_CARGO_HOME_CACHE --mount=$EARTH_RUST_TARGET_CACHE cargo build --release DO rust+COPY_OUTPUT --output="release/[^\./]+" # Keep all the files in /target/release that don't have any extension. ``` ## +CROSS diff --git a/utils/dind/install-dind.sh b/utils/dind/install-dind.sh index d5e6238..579beab 100755 --- a/utils/dind/install-dind.sh +++ b/utils/dind/install-dind.sh @@ -30,7 +30,7 @@ detect_jq() { print_debug() { set +u - if [ "$EARTHLY_DEBUG" = "true" ] ; then + if [ "$EARTH_DEBUG" = "true" ] ; then echo "$@" fi set -u diff --git a/utils/dind/tests/Earthfile b/utils/dind/tests/Earthfile index 45f2a92..ae3c980 100644 --- a/utils/dind/tests/Earthfile +++ b/utils/dind/tests/Earthfile @@ -13,8 +13,8 @@ all: --base_image=ubuntu:latest \ --base_image=amazonlinux:1 \ --base_image=amazonlinux:2 \ - --base_image=earthly/dind:alpine \ - --base_image=earthly/dind:ubuntu + --base_image=earthbuild/dind:alpine-3.23-docker-29.5.2-r0 \ + --base_image=earthbuild/dind:ubuntu-24.04-docker-28.5.2-1 test-install-dind-for-image: ARG --required base_image @@ -27,7 +27,7 @@ test-install-dind-for-image: # docker-compose will fail with: # Error response from daemon: Invalid container name (-hello-1), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed # if docker-compose.yml is in the root directory, due to the --project flag defaulting to "". - # This bug does not exist in the official earthly/dind:alpine image. + # This bug does not exist in the official EarthBuild/dind:alpine-3.23-docker-29.5.2-r0 image. WORKDIR /dind-test DO ..+INSTALL From c494bbf6738aecf40547f06905ba043639077fba Mon Sep 17 00:00:00 2001 From: Rory Dunne Date: Fri, 7 Aug 2026 11:49:14 -0400 Subject: [PATCH 20/20] chore: update readmes to remove earthly references --- README.md | 7 +++---- billing/README.md | 20 -------------------- gradle/README.md | 10 +++++----- rust/README.md | 42 +++++++++++++++++++++--------------------- 4 files changed, 29 insertions(+), 50 deletions(-) delete mode 100644 billing/README.md diff --git a/README.md b/README.md index 8f3f962..939c24e 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ # lib -Earthly's official collection of [functions](https://docs.earthly.dev/docs/guides/functions). +Earthly's official collection of [functions](https://docs.earthbuild.dev/docs/guides/functions). ## Contributing -* Please report bugs as [GitHub issues](https://github.com/earthly/lib/issues). -* Join us on [Slack](https://earthly.dev/slack)! +* Please report bugs as [GitHub issues](https://github.com/EarthBuild/lib/issues). * Questions via GitHub issues are welcome! * PRs welcome! But please give a heads-up in a GitHub issue before starting work. If there is no GitHub issue for what you want to do, please create one. * Check the [contributing page](./CONTRIBUTING.md) for more details. ## Licensing -Earthly is licensed under the Mozilla Public License Version 2.0. See [LICENSE](./LICENSE). \ No newline at end of file +Earthly is licensed under the Mozilla Public License Version 2.0. See [LICENSE](./LICENSE). diff --git a/billing/README.md b/billing/README.md deleted file mode 100644 index c767d23..0000000 --- a/billing/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Billing utilities -## +active-users -Estimates monthly active users of a GIT remote repo, based on past commits - -Usage: -``` -earthly --secret repoUrl= github.com/earthly/lib/billing+active-users -``` - -### Private repositories -#### SSH -For SSH URLs, SSH auth is passed-though from the host machine. - -#### HTTPS -For HTTPS URLs, pass credentials within the URL: -``` -earthly --secret repoUrl=https://@/host/repo.git github.com/earthly/lib/billing+active-users -``` -> Note: -> For GitHub private repos you need to use a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) instead of your password diff --git a/gradle/README.md b/gradle/README.md index 6b88b2f..22975b1 100644 --- a/gradle/README.md +++ b/gradle/README.md @@ -1,11 +1,11 @@ # lib/gradle -Earthly's official collection of Gradle [functions](https://docs.earthly.dev/docs/guides/functions). +EarthBuild's official collection of Gradle [functions](https://docs.earthbuild.dev/docs/guides/functions). First, import the library up in your Earthfile: ```earthfile VERSION --global-cache 0.7 -IMPORT github.com/earthly/lib/gradle: AS gradle +IMPORT github.com/EarthBuild/lib/gradle: AS gradle ``` > :warning: Due to [this issue](https://github.com/earthly/earthly/issues/3490), make sure to enable `--global-cache` in the calling Earthfile, as shown above. @@ -16,10 +16,10 @@ This function sets the following entries in the calling environment, so they can - `$EARTH_GRADLE_PROJECT_CACHE`: Code of the mount cache for the [gradle project root](https://docs.gradle.org/current/userguide/directory_layout.html#dir:project_root) directory. ### Arguments -- `cache_prefix`: To be used in both caches. By default: `${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-gradle-cache` +- `cache_prefix`: To be used in both caches. By default: `${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earth-gradle-cache` ### Example -```earthly +```earthfile DO gradle+GRADLE_GET_MOUNT_CACHE RUN --mount=$EARTH_GRADLE_USER_HOME_CACHE --mount=$EARTH_GRADLE_PROJECT_CACHE gradle --no-daemon build ``` @@ -30,4 +30,4 @@ If `cache_prefix` is not set, the two global caches have an Earthfile-scope, tha Otherwise, all Earthfiles using the same `cache_prefix` will share the cache mounts. ## Example -See [earthly-intellij-plugin](https://github.com/earthly/earthly-intellij-plugin/blob/main/Earthfile) for a complete example. \ No newline at end of file +See [earth-intellij-plugin](https://github.com/EarthBuild/earthly-intellij-plugin/blob/main/Earthfile) for a complete example. diff --git a/rust/README.md b/rust/README.md index 5b5d0ef..ccc278c 100644 --- a/rust/README.md +++ b/rust/README.md @@ -2,19 +2,19 @@ # lib/rust -Earthly's official collection of Rust [functions](https://docs.earthly.dev/docs/guides/functions). +EarthBuild's official collection of Rust [functions](https://docs.earthbuild.dev/docs/guides/functions). First, import the library up in your Earthfile: ```earthfile VERSION 0.8 -IMPORT github.com/earthly/lib/rust: AS rust +IMPORT github.com/EarthBuild/lib/rust: AS rust ``` ## +INIT This function sets some configuration in the environment (used by following functions), and installs required dependencies. It must be called once per build environment, to avoid passing repetitive arguments to the functions called after it, and to install required dependencies before the source files are copied from the build context. -Note that this function changes `$CARGO_HOME` in the calling environment to point to a cache mount later on. +Note that this function changes `$CARGO_HOME` in the calling environment to point to a cache mount later on. It is recommended then that all interaction with cargo is done throug the `+CARGO` function or using cache mounts returned by `+SET_CACHE_MOUNTS_ENV`. ### Usage @@ -26,12 +26,12 @@ DO rust+INIT ... ### Arguments #### `cache_prefix` -Overrides cache prefix for cache IDS. Its value is exported to the build environment under the entry: `$EARTH_CACHE_PREFIX`. -By default `${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earthly-cargo-cache` +Overrides cache prefix for cache IDS. Its value is exported to the build environment under the entry: `$EARTH_CACHE_PREFIX`. +By default `${EARTH_TARGET_PROJECT_NO_TAG}#${OS_RELEASE}#earth-cargo-cache` #### `keep_fingerprints (false)` -By default `+CARGO` removes the [compiler fingerprints](https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/compiler/fingerprint/struct.Fingerprint.html) of those packages found in your source code (not their dependencies), to force their recompilation and work even when the Earthly `COPY` commands overwrote file mtimes (by default). +By default `+CARGO` removes the [compiler fingerprints](https://doc.rust-lang.org/nightly/nightly-rustc/cargo/core/compiler/fingerprint/struct.Fingerprint.html) of those packages found in your source code (not their dependencies), to force their recompilation and work even when the EarthBuild `COPY` commands overwrote file mtimes (by default). Set `keep_fingerprints=true` to keep the source packages fingerprints and avoid their recompilation, when source packages have been copied with `--keep-ts `option. @@ -76,7 +76,7 @@ Notice that in order to run this function, [+INIT](#init) must be called first. ### Arguments -#### `target_cache_suffix` +#### `target_cache_suffix` Optional cache suffix for the target folder cache ID. ### Example @@ -95,7 +95,7 @@ Use it function when you want to `SAVE ARTIFACT` from the target folder (mounted Notice that in order to run this function, `+SET_CACHE_MOUNTS_ENV` or `+CARGO` must be called first. ### Arguments -#### `output` +#### `output` Regex matching output artifacts files to be copied to `./target` folder in the caller filesystem (image layers). ### Example @@ -104,12 +104,12 @@ DO rust+SET_RUST_CACHE_MOUNTS RUN --mount=$EARTH_RUST_CARGO_HOME_CACHE --mount=$EARTH_RUST_TARGET_CACHE cargo build --release DO rust+COPY_OUTPUT --output="release/[^\./]+" # Keep all the files in /target/release that don't have any extension. ``` -## +CROSS +## +CROSS Runs the [cross](https://github.com/cross-rs/cross) command: `cross $args --target $target` . Notice that: -- This function makes use of `WITH DOCKER`, and hence parallelization might be tricky to achieve ([earthly#3808](https://github.com/earthly/earthly/issues/3808)). +- This function makes use of `WITH DOCKER`, and hence parallelization might be tricky to achieve ([earthly#3808](https://github.com/earthly/earthly/issues/3808)). - In order to run this function, [+INIT](#init) must be called first. ### Arguments @@ -158,7 +158,7 @@ The Earthfile would look like: VERSION 0.8 # Imports the library definition from default branch (in a real case, specify version or commit to guarantee immutability) -IMPORT github.com/earthly/lib/rust AS rust +IMPORT github.com/EarthBuild/lib/rust AS rust install: FROM rust:1.73.0-bookworm @@ -167,7 +167,7 @@ install: RUN cargo install --locked cargo-deny RUN rustup component add clippy RUN rustup component add rustfmt - # Call +INIT before copying the source file to avoid installing depencies every time source code changes. + # Call +INIT before copying the source file to avoid installing depencies every time source code changes. # This parametrization will be used in future calls to functions of the library DO rust+INIT --keep_fingerprints=true @@ -209,7 +209,7 @@ cross: ARG --required target DO rust+CROSS --target=$target SAVE ARTIFACT target/$target AS LOCAL dist/$target - + # all runs all other targets in parallel all: BUILD +lint @@ -222,19 +222,19 @@ all: ## Mount caches and parallelization As of today, local Cargo builds cannot run in parallel for a given project, given that the output artifact folder is globally locked for the whole build. -This library overcomes such limitation by using different mount caches for the target folder, one per Earthly target. -While multiple concurrent builds of the same Earthly target will still block, the user now has the choice of creating new Earthly targets instead of reusing the same to increase parallelization. +This library overcomes such limitation by using different mount caches for the target folder, one per EarthBuild target. +While multiple concurrent builds of the same EarthBuild target will still block, the user now has the choice of creating new EarthBuild targets instead of reusing the same to increase parallelization. Hence, this library uses several mount caches per tuple of `{project, os_release}`: -- One cache mount for `$CARGO_HOME`, shared across all target builds without any locking involved. -- A family of locked cache mounts for `$CARGO_TARGET_DIR`. One per Earthly target. +- One cache mount for `$CARGO_HOME`, shared across all target builds without any locking involved. +- A family of locked cache mounts for `$CARGO_TARGET_DIR`. One per EarthBuild target. Notice that: -- the previous targets builds might belong to one or multiple Earthly builds, given that the caches involved are global. +- the previous targets builds might belong to one or multiple EarthBuild builds, given that the caches involved are global. - builds will only be blocked by concurrent ones of the same target. -- Earthly target builds are atomic in the sense that the artifacts returned are guaranteed to be the ones generated by that build. +- EarthBuild target builds are atomic in the sense that the artifacts returned are guaranteed to be the ones generated by that build. -For example, running `earthly +all` in the previous example will: +For example, running `earth +all` in the previous example will: - run all targets (`+lint,+build,+test,+fmt,+check-dependencies`) in parallel without any blocking involved. - use a common cache mount for `$CARGO_HOME`. -- use one individual `$CARGO_TARGET_DIR` cache mount per Earthly target. +- use one individual `$CARGO_TARGET_DIR` cache mount per EarthBuild target.