Skip to content

Commit

Permalink
Add e2e github action
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
  • Loading branch information
ArangoGutierrez committed Mar 5, 2024
1 parent aee007e commit e28f8b3
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 7 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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:
workflow_run:
workflows: [Image]
types:
- completed

jobs:
e2e-tests:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
name: Check out code
- name: Calculate build vars
id: vars
run: |
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
- name: Set up Holodeck
uses: NVIDIA/holodeck@main
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_ssh_key: ${{ secrets.AWS_SSH_KEY }}
holodeck_config: "tests/e2e/holodeck.yaml"
- name: Run e2e tests
env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig
E2E_IMAGE_REPO: ghcr.io/nvidia/k8s-device-plugin
E2E_IMAGE_TAG: ${COMMIT_SHORT_SHA}-ubuntu20.04
run: |
make -f tests/e2e/Makefile e2e-test
3 changes: 3 additions & 0 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ name: Golang

on:
pull_request:
types:
- opened
- synchronize
branches:
- main
- release-*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Run this workflow on pull requests or merge to main/release branches
name: image
name: Image

on:
pull_request:
Expand Down
13 changes: 7 additions & 6 deletions tests/e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@
GO_CMD ?= go
GO_FMT ?= gofmt

DRIVER_ENABLED ?= true
include $(CURDIR)/versions.mk

E2E_IMAGE_REPO ?= nvcr.io/nvidia/k8s-device-plugin
E2E_IMAGE_TAG ?= v0.14.3
E2E_IMAGE_PULL_POLICY ?= Always
DRIVER_ENABLED ?= true

HELM_CHART ?= $(CURDIR)/../../deployments/helm/nvidia-device-plugin
E2E_IMAGE_REPO ?= $(REGISTRY)/$(DRIVER_NAME)
E2E_IMAGE_TAG ?= $(VERSION)
E2E_IMAGE_PULL_POLICY ?= IfNotPresent
HELM_CHART ?= $(CURDIR)/deployments/helm/nvidia-device-plugin

.PHONY: e2e-test
e2e-test:
@if [ -z ${KUBECONFIG} ]; then \
echo "[ERR] KUBECONFIG missing, must be defined"; \
exit 1; \
fi
$(GO_CMD) test -v . -args \
$(GO_CMD) test -v $(CURDIR)/tests/e2e -args \
-kubeconfig=$(KUBECONFIG) \
-driver-enabled=$(DRIVER_ENABLED) \
-image.repo=$(E2E_IMAGE_REPO) \
Expand Down
29 changes: 29 additions & 0 deletions tests/e2e/holodeck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: holodeck.nvidia.com/v1alpha1
kind: Environment
metadata:
name: HOLODECK_NAME
description: "end-to-end test infrastructure"
spec:
provider: aws
auth:
keyName: cnt-ci
privateKey: HOLODECK_PRIVATE_KEY
instance:
type: g4dn.xlarge
region: us-west-1
ingressIpRanges:
- 0.0.0.0/0
image:
architecture: amd64
imageId: ami-0ce2cb35386fc22e9
containerRuntime:
install: true
name: containerd
nvidiaContainerToolkit:
install: true
nvidiaDriver:
install: true
kubernetes:
install: true
installer: kubeadm
version: v1.28.5

0 comments on commit e28f8b3

Please sign in to comment.