From 996e0a989f7eee330f2ab33dea363e3fa23e33cb Mon Sep 17 00:00:00 2001 From: Karel Suta Date: Wed, 29 Nov 2023 16:04:53 +0100 Subject: [PATCH] Use dedicated KinD composite action from CodeFlare common --- .github/actions/kind/action.yml | 74 -------------------------------- .github/resources-kind/kind.yaml | 31 ------------- .github/workflows/e2e_tests.yaml | 9 +++- .github/workflows/olm_tests.yaml | 9 +++- 4 files changed, 16 insertions(+), 107 deletions(-) delete mode 100644 .github/actions/kind/action.yml delete mode 100644 .github/resources-kind/kind.yaml diff --git a/.github/actions/kind/action.yml b/.github/actions/kind/action.yml deleted file mode 100644 index f76e60af5..000000000 --- a/.github/actions/kind/action.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: "Set up KinD" -description: "Step to start and configure KinD cluster" - -inputs: - kind-node-hostname: - description: "Hostname of the main kind node" - required: false - default: kind - -runs: - using: "composite" - steps: - - name: Init directories - shell: bash - run: | - TEMP_DIR="$(pwd)/tmp" - mkdir -p "${TEMP_DIR}" - echo "TEMP_DIR=${TEMP_DIR}" >> $GITHUB_ENV - - mkdir -p "$(pwd)/bin" - echo "$(pwd)/bin" >> $GITHUB_PATH - - - name: Container image registry - shell: bash - run: | - podman run -d -p 5000:5000 --name registry registry:2.8.1 - - export REGISTRY_ADDRESS=$(hostname -i):5000 - echo "REGISTRY_ADDRESS=${REGISTRY_ADDRESS}" >> $GITHUB_ENV - echo "Container image registry started at ${REGISTRY_ADDRESS}" - - KIND_CONFIG_FILE=${{ env.TEMP_DIR }}/kind.yaml - echo "KIND_CONFIG_FILE=${KIND_CONFIG_FILE}" >> $GITHUB_ENV - envsubst < .github/resources-kind/kind.yaml > ${KIND_CONFIG_FILE} - - sudo --preserve-env=REGISTRY_ADDRESS sh -c 'cat > /etc/containers/registries.conf.d/local.conf <> $GITHUB_ENV - echo "CLUSTER_HOSTNAME=${{ inputs.kind-node-hostname }}" >> $GITHUB_ENV diff --git a/.github/resources-kind/kind.yaml b/.github/resources-kind/kind.yaml deleted file mode 100644 index 4546589b8..000000000 --- a/.github/resources-kind/kind.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# --------------------------------------------------------------------------- -# Copyright 2023. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# --------------------------------------------------------------------------- - -kind: Cluster -apiVersion: kind.x-k8s.io/v1alpha4 -nodes: - - role: control-plane - image: kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1 - kubeadmConfigPatches: - - | - kind: InitConfiguration - nodeRegistration: - kubeletExtraArgs: - node-labels: "ingress-ready=true" -containerdConfigPatches: - - |- - [plugins."io.containerd.grpc.v1.cri".registry.mirrors."${REGISTRY_ADDRESS}"] - endpoint = ["http://${REGISTRY_ADDRESS}"] diff --git a/.github/workflows/e2e_tests.yaml b/.github/workflows/e2e_tests.yaml index b20ff9689..1962a8b84 100644 --- a/.github/workflows/e2e_tests.yaml +++ b/.github/workflows/e2e_tests.yaml @@ -35,6 +35,13 @@ jobs: with: submodules: recursive + - name: Checkout common repo code + uses: actions/checkout@v3 + with: + repository: 'project-codeflare/codeflare-common' + ref: 'main' + path: 'common' + - name: Set Go uses: actions/setup-go@v3 with: @@ -46,7 +53,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Setup and start KinD cluster - uses: ./.github/actions/kind + uses: ./common/github-actions/kind - name: Deploy CodeFlare stack id: deploy diff --git a/.github/workflows/olm_tests.yaml b/.github/workflows/olm_tests.yaml index 382c95f3c..83175503a 100644 --- a/.github/workflows/olm_tests.yaml +++ b/.github/workflows/olm_tests.yaml @@ -34,6 +34,13 @@ jobs: with: fetch-depth: 0 # fetching also previous commits to get tags + - name: Checkout common repo code + uses: actions/checkout@v3 + with: + repository: 'project-codeflare/codeflare-common' + ref: 'main' + path: 'common' + - name: Set Go uses: actions/setup-go@v3 with: @@ -45,7 +52,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Setup and start KinD cluster - uses: ./.github/actions/kind + uses: ./common/github-actions/kind - name: Install OLM run: |