From 72ddc887fa13a069802c9e3fd5e6ea16fa95482d Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Arango Gutierrez Date: Tue, 20 Feb 2024 12:26:27 +0100 Subject: [PATCH] Add e2e github action Signed-off-by: Carlos Eduardo Arango Gutierrez --- .github/workflows/e2e.yaml | 45 ++++++++++++++++++++++++++++++++++++++ tests/e2e/holodeck.yaml | 29 ++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/e2e.yaml create mode 100644 tests/e2e/holodeck.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 000000000..55222fc58 --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,45 @@ +# Copyright 2024 NVIDIA CORPORATION +# +# 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. + +name: e2e + +on: + pull_request: + branches: + - main + - release-* + types: + - labeled + - opened + - synchronize + - closed + +jobs: + test: + runs-on: ubuntu-latest + if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') || github.event_name == 'closed' }} + + steps: + - uses: actions/checkout@v4 + name: Checkout code + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + - name: Install YQ + run: | + sudo add-apt-repository ppa:rmescandon/yq -y + sudo apt-get update + sudo apt-get install yq -y + yq --version \ No newline at end of file diff --git a/tests/e2e/holodeck.yaml b/tests/e2e/holodeck.yaml new file mode 100644 index 000000000..428e28633 --- /dev/null +++ b/tests/e2e/holodeck.yaml @@ -0,0 +1,29 @@ +apiVersion: holodeck.nvidia.com/v1alpha1 +kind: Environment +metadata: + name: holodeck + description: "Devel infra environment" +spec: + provider: aws + auth: + keyName: cnt-ci + privateKey: "/Users/eduardoa/.ssh/cnt-ci.pem" + instance: + type: g4dn.xlarge + region: us-west-1 + ingressIpRanges: + - 0.0.0.0/0 + image: + architecture: amd64 + imageId: ami-0ce2cb35386fc22e9 + kubernetes: + install: true + installer: kubeadm + version: v1.28.5 + + +# how would a sed command look like to replace the value of the auth.privateKey and auth.keyName fields with some ENV VAR values? + +# yq e '.spec.auth.keyName = env(KEY_NAME)' holodeck.yaml +# yq e '.spec.auth.privateKey = env(PRIVATE_KEY)' holodeck.yaml +