Skip to content

Commit

Permalink
Add autoupdate/moonray to GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 committed Jun 4, 2024
1 parent 6526622 commit 1b908d9
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on:
branches:
- main
- autoupdate/strict
- autoupdate/moonray
- 'release-[0-9]+.[0-9]+'
- 'autoupdate/release-[0-9]+.[0-9]+-strict'
- 'autoupdate/sync/**'
pull_request:

permissions:
contents: read
contents: read

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- autoupdate/strict
- autoupdate/moonray
- 'release-[0-9]+.[0-9]+'
- 'autoupdate/release-[0-9]+.[0-9]+-strict'
- 'autoupdate/sync/**'
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/moonray.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Auto-update moonray branch

on:
push:
branches:
- main
# TODO: remove before merge
pull_request:

permissions:
contents: read

jobs:
update:
permissions:
contents: write # for Git to git push
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Sync ${{ github.ref }} to autoupdate/moonray
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY_TO_UPDATE_STRICT_BRANCH }}
- name: Apply moonray patch
run: |
git checkout -b autoupdate/moonray
./build-scripts/patches/moonray/apply
- name: Push to autoupdate/moonray
run: |
git push origin --force autoupdate/moonray
1 change: 1 addition & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- autoupdate/strict
- autoupdate/moonray
- 'release-[0-9]+.[0-9]+'
- 'autoupdate/release-[0-9]+.[0-9]+-strict'
- 'autoupdate/sync/**'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sbom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- autoupdate/strict
- autoupdate/moonray
- 'release-[0-9]+.[0-9]+'
- 'autoupdate/release-[0-9]+.[0-9]+-strict'
- 'autoupdate/sync/**'
Expand Down
73 changes: 73 additions & 0 deletions build-scripts/patches/moonray/0001-Moonray.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From bc1f724eb7219c8b8221663d6398e370c9a15842 Mon Sep 17 00:00:00 2001
From: Benjamin Schimke <[email protected]>
Date: Tue, 4 Jun 2024 15:19:13 +0200
Subject: [PATCH] Moonray

---
tests/integration/tests/test_cilium_e2e.py | 54 ----------------------
1 file changed, 54 deletions(-)
delete mode 100644 tests/integration/tests/test_cilium_e2e.py

diff --git a/tests/integration/tests/test_cilium_e2e.py b/tests/integration/tests/test_cilium_e2e.py
deleted file mode 100644
index cf2735e..0000000
--- a/tests/integration/tests/test_cilium_e2e.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Copyright 2024 Canonical, Ltd.
-#
-import logging
-import platform
-from typing import List
-
-import pytest
-from test_util import config, harness, util
-
-LOG = logging.getLogger(__name__)
-
-ARCH = platform.machine()
-CILIUM_CLI_ARCH_MAP = {"aarch64": "arm64", "x86_64": "amd64"}
-CILIUM_CLI_VERSION = "v0.16.3"
-CILIUM_CLI_TAR_GZ = f"https://github.com/cilium/cilium-cli/releases/download/{CILIUM_CLI_VERSION}/cilium-linux-{CILIUM_CLI_ARCH_MAP.get(ARCH)}.tar.gz" # noqa
-
-
-@pytest.mark.skipif(
- ARCH not in CILIUM_CLI_ARCH_MAP, reason=f"Platform {ARCH} not supported"
-)
-def test_cilium_e2e(instances: List[harness.Instance]):
- instance = instances[0]
- instance.exec(["bash", "-c", "mkdir -p ~/.kube"])
- instance.exec(["bash", "-c", "k8s config > ~/.kube/config"])
-
- # Download cilium-cli
- instance.exec(["curl", "-L", CILIUM_CLI_TAR_GZ, "-o", "cilium.tar.gz"])
- instance.exec(["tar", "xvzf", "cilium.tar.gz"])
- instance.exec(["./cilium", "version", "--client"])
-
- instance.exec(["k8s", "status", "--wait-ready"])
-
- util.wait_for_dns(instance)
- util.wait_for_network(instance)
-
- # Run cilium e2e tests
- e2e_args = []
- if config.SUBSTRATE == "lxd":
- # NOTE(neoaggelos): disable "no-unexpected-packet-drops" on LXD as it fails:
- # [=] Test [no-unexpected-packet-drops] [1/61]
- # [-] Scenario [no-unexpected-packet-drops/no-unexpected-packet-drops]
- # Found unexpected packet drops:
- # {
- # "labels": {
- # "direction": "INGRESS",
- # "reason": "VLAN traffic disallowed by VLAN filter"
- # },
- # "name": "cilium_drop_count_total",
- # "value": 4
- # }
- e2e_args.extend(["--test", "!no-unexpected-packet-drops"])
-
- instance.exec(["./cilium", "connectivity", "test", *e2e_args])
--
2.34.1

10 changes: 10 additions & 0 deletions build-scripts/patches/moonray/apply
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -xe

DIR="$(realpath "$(dirname "${0}")")"

# Configure git author
git config user.email [email protected]
git config user.name k8s-bot

# Apply strict patch
git am "${DIR}/0001-Moonray.patch"

0 comments on commit 1b908d9

Please sign in to comment.