Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-docker-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,10 @@ jobs:
SKIP_JOB: ${{ needs.build-earthly.result != 'success' }}
secrets: inherit

docker-earthly-image-test:
docker-earthbuild-image-test:
needs: build-earthly
if: ${{ !failure() }}
uses: ./.github/workflows/reusable-earthly-image-tests.yml
uses: ./.github/workflows/reusable-earthbuild-image-tests.yml
with:
BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly"
RUNS_ON: "ubuntu-latest"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-podman-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,11 @@ jobs:
# SKIP_JOB: ${{ needs.build-earthly.result != 'success' }}
# secrets: inherit
#
# podman-earthly-image-tests:
# podman-earthbuild-image-tests:
# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd
# needs: build-earthly
# if: ${{ !failure() }}
# uses: ./.github/workflows/reusable-earthly-image-tests.yml
# uses: ./.github/workflows/reusable-earthbuild-image-tests.yml
# with:
# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly"
# RUNS_ON: "ubuntu-latest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:


jobs:
earthly-image-tests:
earthbuild-image-tests:
if: ${{!inputs.SKIP_JOB}}
runs-on: ${{inputs.RUNS_ON}}
env:
Expand All @@ -55,10 +55,10 @@ jobs:
set -euo pipefail
EARTHLY_VERSION_FLAG_OVERRIDES="$(tr -d '\n' < .earthly_version_flag_overrides)"
echo "EARTHLY_VERSION_FLAG_OVERRIDES=$EARTHLY_VERSION_FLAG_OVERRIDES" >> "$GITHUB_ENV"
- name: Build the earthly docker image
- name: Build the earthbuild docker image
run: ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} +earthly-docker --TAG=image-test
- name: "Run the earthly image tests"
run: FRONTEND=${{inputs.BINARY}} EARTHLY_IMAGE=earthly/earthly:image-test DOCKERHUB_MIRROR_USERNAME="${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" DOCKERHUB_MIRROR_PASSWORD="${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" DOCKERHUB_USERNAME="${{ secrets.DOCKERHUB_USERNAME }}" DOCKERHUB_PASSWORD="${{ secrets.DOCKERHUB_TOKEN }}" ./scripts/tests/earthly-image.sh
- name: "Run the earthbuild image tests"
run: FRONTEND=${{inputs.BINARY}} EARTHLY_IMAGE=ghcr.io/earthbuild/earthbuild:image-test ./scripts/tests/earthly-image.sh
- name: Buildkit logs (runs on failure)
if: ${{ failure() }}
run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd
22 changes: 2 additions & 20 deletions scripts/tests/earthly-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,17 @@ FRONTEND=${FRONTEND:-docker}
EARTHLY_IMAGE=${EARTHLY_IMAGE:-earthly/earthly:dev-main}
PATH="$(realpath "$(dirname "$0")/../acbtest"):$PATH"

if [ -z "${DOCKERHUB_MIRROR_USERNAME:-}" ] && [ -z "${DOCKERHUB_MIRROR_PASSWORD:-}" ]; then
echo "using dockerhub credentials from earthly secrets"
DOCKERHUB_MIRROR_USERNAME="$(earthly secrets --org earthly-technologies --project core get dockerhub-mirror/user)"
export DOCKERHUB_MIRROR_USERNAME
DOCKERHUB_MIRROR_PASSWORD="$(earthly secrets --org earthly-technologies --project core get dockerhub-mirror/pass)"
export DOCKERHUB_MIRROR_PASSWORD
fi
test -n "$DOCKERHUB_MIRROR_USERNAME" || (echo "error: DOCKERHUB_MIRROR_USERNAME is not set" && exit 1)
test -n "$DOCKERHUB_MIRROR_PASSWORD" || (echo "error: DOCKERHUB_MIRROR_PASSWORD is not set" && exit 1)

ENCODED_AUTH="$(echo -n "$DOCKERHUB_MIRROR_USERNAME:$DOCKERHUB_MIRROR_PASSWORD" | base64 -w 0)"

dockerconfig="$(mktemp /tmp/earthly-image-test-docker-config.XXXXXX)"
chmod 600 "$dockerconfig"
cat > "$dockerconfig" <<EOF
{
"auths": {
"mirror.gcr.io": {
"auth": "$ENCODED_AUTH"
}
}
}
{}
EOF

# Note that it is not possible to use GLOBAL_CONFIG for this, due to the fact
# earthly-entrypoint.sh starts buildkit instead of the earthly binary,
# as a result the buildkit_additional_config value in ~/.earthly/config.yml is ignored.
export EARTHLY_ADDITIONAL_BUILDKIT_CONFIG='[registry."docker.io"]
mirrors = ["mirror.gcr.io"]'
mirrors = ["mirror.gcr.io", "public.ecr.aws"]'

function finish {
status="$?"
Expand Down
Loading