Skip to content

Commit

Permalink
Trust that docker is installed and use a Kind cluster.
Browse files Browse the repository at this point in the history
This PR relies on that Docker is preinstalled on all platforms, and uses
a Kind cluster instead of kubeception. This removes the need for a
special proprietary kubeception token when running the integration
tests, and also opens up for running tests that require Docker on all
platforms.

Docker is not installed on macOS by default. The Silicon chip lacks
support for nested virtualization. This will be remedied shortly, but
for now, the macOS tests will run on amd64 only, and use a special
action to install Docker.

Signed-off-by: Thomas Hallgren <[email protected]>
Signed-off-by: Thomas Hallgren <[email protected]>
  • Loading branch information
thallgren committed Aug 5, 2024
1 parent 6803672 commit ea383ad
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 33 deletions.
11 changes: 10 additions & 1 deletion .github/actions/install-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ runs:
if [[ ${RUNNER_ARCH} == "ARM64" ]]; then
sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
fi
- if: runner.os == 'macOS'
- name: install dependencies for arm64
if: runner.os == 'Linux' && runner.arch == 'arm64'
shell: bash
run: |
sudo rm -f /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update -y
sudo apt-get install -y socat gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu make jq uidmap
- if: runner.os == 'macOS' && runner.arch == 'amd64'
name: install macOS dependencies
shell: bash
env:
Expand All @@ -45,6 +52,8 @@ runs:
if [[ ${RUNNER_ARCH} == "ARM64" ]]; then
brew install jq
fi
- if: runner.os == 'macOS' # remove once docker is pre-installed on macOS images
uses: douglascamata/setup-docker-macos-action@v1-alpha
- if: runner.os == 'Windows'
name: install make and zip
uses: nick-fields/retry/@v3
Expand Down
34 changes: 5 additions & 29 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
- labeled

env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig.yaml
DTEST_KUBECONFIG: ${{ github.workspace }}/kubeconfig.yaml
TELEPRESENCE_REGISTRY: localhost:5000
DTEST_REGISTRY: localhost:5000
SCOUT_DISABLE: "1"
Expand Down Expand Up @@ -49,11 +47,8 @@ jobs:
runners:
- ubuntu-latest
- ubuntu-arm64
- macos-latest # this runner uses arm64
- windows-2019
clusters:
- distribution: Kubeception
version: "1.29"
- macos-13 # Ensure amd64 (see https://github.com/marketplace/actions/setup-docker-on-macos)
- windows-latest
runs-on: ${{ matrix.runners }}
needs: build_image
steps:
Expand All @@ -63,18 +58,8 @@ jobs:
ref: "${{ github.event.pull_request.head.sha }}"
- name: install dependencies
uses: ./.github/actions/install-dependencies
- name: install dependencies for arm64
if: runner.os == 'Linux' && runner.arch == 'arm64'
run: |
sudo rm -f /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update -y
sudo apt-get install -y socat gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu make jq uidmap
- name: install docker for arm64
if: runner.os == 'Linux' && runner.arch == 'arm64'
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
dockerd-rootless-setuptool.sh install
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
- name: Build client
env:
TELEPRESENCE_VERSION: ${{needs.build_image.outputs.telepresenceVersion}}
Expand All @@ -84,16 +69,6 @@ jobs:
env:
TELEPRESENCE_VERSION: ${{needs.build_image.outputs.telepresenceVersion}}
run: make client-image
- name: Create cluster
uses: datawire/infra-actions/[email protected]
with:
kubeconfig: ${{ env.KUBECONFIG }}
kubeceptionToken: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
kubeceptionProfile: small
lifespan: 7200
distribution: ${{ matrix.clusters.distribution }}
version: ${{ matrix.clusters.version }}
gkeCredentials: '{"project_id": "foo"}' # See https://github.com/datawire/infra-actions/issues/66
- name: Download prebuilt docker image
uses: actions/download-artifact@v3
with:
Expand All @@ -110,6 +85,7 @@ jobs:
env:
DEV_TELEPRESENCE_VERSION: ${{needs.build_image.outputs.telepresenceVersion}}
TELEPRESENCE_VERSION: ${{needs.build_image.outputs.telepresenceVersion}}
DTEST_KUBECONFIG: ${{ env.HOME }}/.kube/config
uses: nick-fields/retry/@v3
with:
max_attempts: 3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- ubuntu-latest
- ubuntu-arm64
- macos-latest
- windows-2019
- windows-latest
runs-on: ${{ matrix.runners }}
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runners:
- ubuntu-latest
- ubuntu-arm64
- macos-latest
- windows-2019
- macos-13
- windows-latest
runs-on: ${{ matrix.runners }}
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit ea383ad

Please sign in to comment.