Skip to content

Commit

Permalink
Move Prow to GHA (kyma-project#584)
Browse files Browse the repository at this point in the history
* Move Prow to GHA

* Extend memory

* Add evaluation param

* update

* Delete a.sh

* update

* Adapt

* Istio gha a (#17)

* Move Prow to GHA

* Extend memory

* Add evaluation param

* update

* Delete a.sh

* update

* update imgae

* update

* Add version

* Replace image

* update

* a

* Update main.go

* a

* Update main-integration.yaml

* update docs

* AWS specific job

* AWS specific job

* Run on rel branch

* Add jobs to rel branch

* fetch depth

* Update gardener-integration-aws-specific.sh

* Update pull-integration-rel.yaml

* Add main

* Add rel
  • Loading branch information
barchw committed Feb 2, 2024
1 parent 277fc20 commit f436c6a
Show file tree
Hide file tree
Showing 16 changed files with 465 additions and 113 deletions.
42 changes: 42 additions & 0 deletions .github/actions/integration-test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

name: 'Istio integration test'
description: 'Runs Istio integration tests'
inputs:
evaluation:
description: 'Controls whether the test should run for Evaluation or Production'
required: false
operator-image-name:
description: 'Operator image used for test'
required: true
agents:
description: 'Number of k3d agents created'
required: true
servers-memory:
description: 'Amount of memory allocated to k3d cluster'
required: true
runs:
using: "composite"
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
with:
cluster-name: "test-cluster-1"
args: >-
--agents ${{ inputs.agents }}
--image docker.io/rancher/k3s:v1.28.2-k3s1
--servers-memory ${{ inputs.servers-memory }}
--port 80:80@loadbalancer
--port 443:443@loadbalancer
--k3s-arg "--disable=traefik@server:0"
- name: Run integration tests
shell: bash
run: |
kubectl config use-context k3d-test-cluster-1
if "${{ inputs.evaluation }}" == "true"; then
TEST_EVALUATION=TRUE EXPORT_RESULT=true IMG=${{ inputs.operator-image-name }} make istio-integration-test
else
EXPORT_RESULT=true IMG=${{ inputs.operator-image-name }} make istio-integration-test
fi
112 changes: 110 additions & 2 deletions .github/workflows/main-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ on:
- "OWNERS"
- "CODEOWNERS"
- "sec-scanners-config.yaml"
- ".github/**" #Ignoring since build job isn't triggered on the workflow directory changes
- ".github/**" #Ignoring since the build job isn't triggered on the workflow directory changes
branches:
- main
- 'release-**'

jobs:
wait-for-image-build:
Expand All @@ -41,11 +42,118 @@ jobs:
operator-image-name: "europe-docker.pkg.dev/kyma-project/prod/istio-manager:${{github.sha}}"
target_branch: ${{github.ref_name}}

istio-integration-test:
name: Istio integration test
runs-on: ubuntu-latest
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/integration-test
with:
operator-image-name: "europe-docker.pkg.dev/kyma-project/prod/istio-manager:${{github.sha}}"
servers-memory: "16g"
agents: 2

istio-integration-gcp:
name: Istio integration test GCP
runs-on: ubuntu-latest
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: ./tests/integration/scripts/gardener-kubeconfig.sh
shell: bash
env:
GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- run: make IMG="europe-docker.pkg.dev/kyma-project/prod/istio-manager:${{github.sha}}" gardener-istio-integration-test
shell: bash
env:
GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml"
GARDENER_PROJECT_NAME: "goatz"
GARDENER_PROVIDER_SECRET_NAME: "goat"
GARDENER_PROVIDER: "gcp"
GARDENER_REGION: "europe-west3"
GARDENER_ZONES: "europe-west3-c,europe-west3-b,europe-west3-a"
GARDENER_CLUSTER_VERSION: "1.27"
MACHINE_TYPE: "n2-standard-4"
DISK_SIZE: 50
DISK_TYPE: "pd-standard"
SCALER_MAX: 20
SCALER_MIN: 3

istio-integration-aws-specific:
name: Istio integration test AWS specific
runs-on: ubuntu-latest
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: ./tests/integration/scripts/gardener-kubeconfig.sh
shell: bash
env:
GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- run: make IMG="europe-docker.pkg.dev/kyma-project/prod/istio-manager:${{github.sha}}" gardener-aws-integration-test
shell: bash
env:
GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml"
GARDENER_PROJECT_NAME: "goatz"
GARDENER_PROVIDER_SECRET_NAME: "aws-gardener-access"
GARDENER_PROVIDER: "aws"
GARDENER_CLUSTER_VERSION: "1.27"
GARDENER_REGION: "eu-west-1"
GARDENER_ZONES: "eu-west-1b,eu-west-1c,eu-west-1a"
MACHINE_TYPE: "m5.xlarge"
DISK_SIZE: 50
DISK_TYPE: "gp2"
SCALER_MAX: 3
SCALER_MIN: 1

istio-integration-aws:
name: Istio integration test AWS
runs-on: ubuntu-latest
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: ./tests/integration/scripts/gardener-kubeconfig.sh
shell: bash
env:
GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- run: make IMG="europe-docker.pkg.dev/kyma-project/prod/istio-manager:${{github.sha}}" gardener-istio-integration-test
shell: bash
env:
GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml"
GARDENER_PROJECT_NAME: "goatz"
GARDENER_PROVIDER_SECRET_NAME: "aws-gardener-access"
GARDENER_PROVIDER: "aws"
GARDENER_CLUSTER_VERSION: "1.27"
GARDENER_REGION: "eu-west-1"
GARDENER_ZONES: "eu-west-1b,eu-west-1c,eu-west-1a"
MACHINE_TYPE: "m5.xlarge"
DISK_SIZE: 50
DISK_TYPE: "gp2"
SCALER_MAX: 3
SCALER_MIN: 1

slack_failed_notification:
name: Slack Notification
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: [istio-upgrade-integration-test]
needs: [istio-upgrade-integration-test, istio-integration-test, istio-integration-gcp, istio-integration-aws, istio-integration-aws-specific]
steps:
- uses: actions/checkout@v4
- name: Notify
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/performance-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow is responsible for all kinds of performance tests

name: main performance tests

on:
schedule:
- cron: '0 5 * * *' # Run every day at 05:00 AM
jobs:
istio-performance-test:
name: Istio performance test
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: ./tests/integration/scripts/gardener-kubeconfig.sh
shell: bash
env:
GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- run: make IMG="europe-docker.pkg.dev/kyma-project/prod/istio-manager:${{github.sha}}" gardener-perf-test
shell: bash
env:
GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml"
GARDENER_PROJECT_NAME: "goatz"
GARDENER_PROVIDER_SECRET_NAME: "goat"
GARDENER_PROVIDER: "gcp"
GARDENER_REGION: "europe-west3"
GARDENER_ZONES: "europe-west3-c,europe-west3-b,europe-west3-a"
GARDENER_CLUSTER_VERSION: "1.27"
MACHINE_TYPE: "n2-standard-4"
DISK_SIZE: 50
DISK_TYPE: "pd-standard"
SCALER_MAX: 20
SCALER_MIN: 3
- uses: actions/upload-artifact@v3
if: always()
name: Export no sidecar summary
with:
name: no-sidecar
path: tests/performance/summary-no-sidecar.html
- uses: actions/upload-artifact@v3
if: always()
name: Export sidecar summary
with:
name: sidecar
path: tests/performance/summary-sidecar.html

slack_failed_notification:
name: Slack Notification
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: [istio-performance-test]
steps:
- uses: actions/checkout@v4
- name: Notify
uses: ./.github/actions/slack-notification-failed-workflow
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
101 changes: 101 additions & 0 deletions .github/workflows/pull-integration-gardener.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# This workflow is responsible for all kinds of integration tests run on pull request to release branch.
# Those tests depend on a container image, so in the first job we wait for the image build to succeed.

name: PR Integration Release

on:
# pull_request_target runs workflows from the base of PR
# It allows the workflow to get the repository secrets
pull_request_target:
types: [ synchronize, opened, reopened, ready_for_review ]
paths-ignore:
- "docs/**"
- "**/*.md"
- "OWNERS"
- "CODEOWNERS"
- ".github/**" #Ignoring since the build job isn't triggered on the workflow directory changes
branches:
- 'release-**'
- 'main'

jobs:
wait-for-image-build:
name: Wait for image build
environment: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' && 'restricted' || 'internal' }}
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/wait-for-job-succeed-or-fail
with:
job-name: 'pull-istio-operator-build'
github-auth-token: ${{ secrets.GITHUB_TOKEN }}


istio-integration-gcp:
name: Istio integration test GCP
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: ./tests/integration/scripts/gardener-kubeconfig.sh
shell: bash
env:
GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- run: make IMG="europe-docker.pkg.dev/kyma-project/prod/istio-manager:PR-{{github.event.number}}" gardener-istio-integration-test
shell: bash
env:
GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml"
GARDENER_PROJECT_NAME: "goatz"
GARDENER_PROVIDER_SECRET_NAME: "goat"
GARDENER_PROVIDER: "gcp"
GARDENER_REGION: "europe-west3"
GARDENER_ZONES: "europe-west3-c,europe-west3-b,europe-west3-a"
GARDENER_CLUSTER_VERSION: "1.27"
MACHINE_TYPE: "n2-standard-4"
DISK_SIZE: 50
DISK_TYPE: "pd-standard"
SCALER_MAX: 20
SCALER_MIN: 3

istio-integration-aws-specific:
name: Istio integration test AWS specific
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- run: ./tests/integration/scripts/gardener-kubeconfig.sh
shell: bash
env:
GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- run: make IMG="europe-docker.pkg.dev/kyma-project/prod/istio-manager:PR-{{github.event.number}}" gardener-aws-integration-test
shell: bash
env:
GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml"
GARDENER_PROJECT_NAME: "goatz"
GARDENER_PROVIDER_SECRET_NAME: "aws-gardener-access"
GARDENER_PROVIDER: "aws"
GARDENER_CLUSTER_VERSION: "1.27"
GARDENER_REGION: "eu-west-1"
GARDENER_ZONES: "eu-west-1b,eu-west-1c,eu-west-1a"
MACHINE_TYPE: "m5.xlarge"
DISK_SIZE: 50
DISK_TYPE: "gp2"
SCALER_MAX: 3
SCALER_MIN: 1
32 changes: 32 additions & 0 deletions .github/workflows/pull-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,35 @@ jobs:
with:
operator-image-name: "europe-docker.pkg.dev/kyma-project/dev/istio-manager:PR-${{github.event.number}}"
target_branch: ${{ github.base_ref }}

istio-integration-test:
name: Istio integration test
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/integration-test
with:
evaluation: false
operator-image-name: "europe-docker.pkg.dev/kyma-project/dev/istio-manager:PR-${{github.event.number}}"
servers-memory: "16g"
agents: 2

istio-integration-test-evaluation:
name: Istio integration test evaluation
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/integration-test
with:
evaluation: true
operator-image-name: "europe-docker.pkg.dev/kyma-project/dev/istio-manager:PR-${{github.event.number}}"
servers-memory: "4g"
agents: 0
Loading

0 comments on commit f436c6a

Please sign in to comment.