Skip to content

Commit

Permalink
BYOC and Self-Hosted Dogfood (#4076)
Browse files Browse the repository at this point in the history
Introduces a new reusable-smoke-test to our Github actions which runs a
simple/arbitary build on a satellite. We use this to mainly test
connectivity with self-hosted and BYOC satellites.

---------

Co-authored-by: Alex Couture-Beil <[email protected]>
  • Loading branch information
brandonSc and alexcb authored Jun 1, 2024
1 parent f540ee2 commit 4f4b479
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci-docker-satellites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,29 @@ jobs:
SATELLITE_NAME: "core-test"
EARTHLY_ORG: "earthly-technologies"
secrets: inherit

satellites-byoc-smoke-test:
needs: build-earthly
uses: ./.github/workflows/reusable-satellite-smoke-test.yml
with:
BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly"
RUNS_ON: "ubuntu-latest"
BINARY: "docker"
SUDO: ""
SATELLITE_NAME: "core-byoc"
EARTHLY_ORG: "earthly-technologies"
USE_VPN: true
secrets: inherit

satellites-self-hosted-smoke-test:
needs: build-earthly
uses: ./.github/workflows/reusable-satellite-smoke-test.yml
with:
BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly"
RUNS_ON: "ubuntu-latest"
BINARY: "docker"
SUDO: ""
SATELLITE_NAME: "self-hosted"
EARTHLY_ORG: "earthly-technologies"
USE_VPN: true
secrets: inherit
70 changes: 70 additions & 0 deletions .github/workflows/reusable-satellite-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Satellite Smoke Test

on:
workflow_call:
inputs:
BUILT_EARTHLY_PATH:
required: true
type: string
RUNS_ON:
required: true
type: string
SUDO:
type: string
required: false
BINARY:
required: true
type: string
SATELLITE_NAME:
required: true
type: string
EARTHLY_ORG:
required: false
type: string
USE_VPN:
required: false
type: boolean

jobs:
satellite-smoke-test:
runs-on: ${{inputs.RUNS_ON}}
env:
FORCE_COLOR: 1
EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}"
EARTHLY_ORG: "${{ inputs.EARTHLY_ORG }}"
EARTHLY_SATELLITE: ${{ inputs.SATELLITE_NAME }}
EARTHLY_INSTALL_ID: "earthly-githubactions"
DOCKERHUB_MIRROR_USERNAME: "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}"
DOCKERHUB_MIRROR_PASSWORD: "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}"
# Used in our github action as the token - TODO: look to change it into an input
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/stage2-setup
with:
DOCKERHUB_MIRROR_USERNAME: "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}"
DOCKERHUB_MIRROR_PASSWORD: "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}"
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_TOKEN }}"
EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}"
BINARY: "${{ inputs.BINARY }}"
SUDO: "${{ inputs.SUDO }}"
BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}"
SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}"
USE_SATELLITE: true
- name: Configure Tailscale
uses: tailscale/github-action@v2
if: ${{ inputs.USE_VPN }}
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Set EARTHLY_VERSION_FLAG_OVERRIDES env
run: |-
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: Run satellite smoke test
run: ${{inputs.BUILT_EARTHLY_PATH}} github.com/earthly/hello-world+hello

0 comments on commit 4f4b479

Please sign in to comment.