Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e github action #571

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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: End-to-end Tests

on:
workflow_run:
workflows: [Image]
types:
- completed
branches:
- main
- release-*

jobs:
e2e-tests:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.event.workflow_run.event == '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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope: Do we want to tag this with a version at some point?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will cut a version once we are happy with it, I still feel is a bit unstable.

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
ArangoGutierrez marked this conversation as resolved.
Show resolved Hide resolved
image:
architecture: amd64
imageId: ami-0ce2cb35386fc22e9
ArangoGutierrez marked this conversation as resolved.
Show resolved Hide resolved
containerRuntime:
install: true
name: containerd
ArangoGutierrez marked this conversation as resolved.
Show resolved Hide resolved
nvidiaContainerToolkit:
install: true
nvidiaDriver:
install: true
kubernetes:
install: true
installer: kubeadm
ArangoGutierrez marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the default I think we can remove it. Note a blocker for this PR though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove, yes. but I wanted to be very explicit at the first try

version: v1.28.5
ArangoGutierrez marked this conversation as resolved.
Show resolved Hide resolved