Skip to content

Commit 9835100

Browse files
ArangoGutierrezelezar
authored andcommitted
Add E2E GitHub Action for Container Toolkit
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent 9a07de0 commit 9835100

File tree

5 files changed

+129
-15
lines changed

5 files changed

+129
-15
lines changed

.github/workflows/e2e.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Copyright 2025 NVIDIA CORPORATION
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: End-to-end Tests
16+
17+
on:
18+
workflow_run:
19+
workflows: [Image]
20+
types:
21+
- completed
22+
branches:
23+
- "pull-request/[0-9]+"
24+
- main
25+
- release-*
26+
27+
jobs:
28+
e2e-tests:
29+
runs-on: linux-amd64-cpu4
30+
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.event.workflow_run.event == 'push' }}
31+
steps:
32+
- name: Check out code
33+
uses: actions/checkout@v4
34+
35+
- name: Calculate build vars
36+
id: vars
37+
run: |
38+
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
39+
echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
40+
GOLANG_VERSION=$(./hack/golang-version.sh)
41+
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV
42+
43+
- name: Install Go
44+
uses: actions/setup-go@v5
45+
with:
46+
go-version: ${{ env.GOLANG_VERSION }}
47+
48+
- name: Set up Holodeck
49+
uses: NVIDIA/[email protected]
50+
with:
51+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
52+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53+
aws_ssh_key: ${{ secrets.AWS_SSH_KEY }}
54+
holodeck_config: "tests/e2e/infra/aws.yaml"
55+
56+
- name: Get public dns name
57+
id: holodeck_public_dns_name
58+
uses: mikefarah/yq@master
59+
with:
60+
cmd: yq '.status.properties[] | select(.name == "public-dns-name") | .value' /github/workspace/.cache/holodeck.yaml
61+
62+
- name: Run e2e tests
63+
env:
64+
IMAGE_NAME: ghcr.io/${LOWERCASE_REPO_OWNER}/container-toolkit
65+
VERSION: ${COMMIT_SHORT_SHA}
66+
SSH_KEY: ${{ secrets.AWS_SSH_KEY }}
67+
E2E_SSH_USER: ${{ secrets.E2E_SSH_USER }}
68+
run: |
69+
e2e_ssh_key=$(mktemp)
70+
echo "$SSH_KEY" > "$e2e_ssh_key"
71+
chmod 600 "$e2e_ssh_key"
72+
export E2E_SSH_KEY="$e2e_ssh_key"
73+
export E2E_SSH_HOST="${{ steps.get_public_dns_name.outputs.result }}"
74+
75+
make -f test/e2e/Makefile test
76+
77+
- name: Send Slack alert notification
78+
id: slack
79+
if: ${{ failure() }}
80+
uses: slackapi/[email protected]
81+
env:
82+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
83+
SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
84+
with:
85+
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
86+
slack-message: |
87+
:x: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed.
88+
89+
Details: ${{ env.SUMMARY_URL }}

.github/workflows/image.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,15 @@
1616
name: image
1717

1818
on:
19-
pull_request:
20-
types:
21-
- opened
22-
- synchronize
23-
branches:
24-
- main
25-
- release-*
2619
push:
2720
branches:
21+
- "pull-request/[0-9]+"
2822
- main
2923
- release-*
3024

3125
jobs:
3226
packages:
33-
runs-on: ubuntu-latest
27+
runs-on: linux-amd64-cpu4
3428
strategy:
3529
matrix:
3630
target:
@@ -74,7 +68,7 @@ jobs:
7468
path: ${{ github.workspace }}/dist/*
7569

7670
image:
77-
runs-on: ubuntu-latest
71+
runs-on: linux-amd64-cpu4
7872
strategy:
7973
matrix:
8074
dist:

deployments/container/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ DIST_DIR ?= $(CURDIR)/dist
2727
##### Global variables #####
2828
include $(CURDIR)/versions.mk
2929

30-
ifeq ($(IMAGE_NAME),)
31-
REGISTRY ?= nvidia
32-
IMAGE_NAME := $(REGISTRY)/container-toolkit
33-
endif
34-
35-
VERSION ?= $(LIB_VERSION)$(if $(LIB_TAG),-$(LIB_TAG))
3630
IMAGE_VERSION := $(VERSION)
3731

3832
IMAGE_TAG ?= $(VERSION)-$(DIST)

tests/e2e/infra/aws.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apiVersion: holodeck.nvidia.com/v1alpha1
2+
kind: Environment
3+
metadata:
4+
name: HOLODECK_NAME
5+
description: "end-to-end test infrastructure"
6+
spec:
7+
provider: aws
8+
auth:
9+
keyName: cnt-ci
10+
privateKey: HOLODECK_PRIVATE_KEY
11+
instance:
12+
type: g4dn.xlarge
13+
region: us-west-1
14+
ingressIpRanges:
15+
- 18.190.12.32/32
16+
- 3.143.46.93/32
17+
- 44.230.241.223/32
18+
- 44.235.4.62/32
19+
- 52.15.119.136/32
20+
- 52.24.205.48/32
21+
image:
22+
architecture: amd64
23+
imageId: ami-0ce2cb35386fc22e9
24+
containerRuntime:
25+
install: true
26+
name: docker
27+
nvidiaContainerToolkit:
28+
install: false
29+
nvidiaDriver:
30+
install: true

versions.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ GIT_COMMIT ?= $(shell git describe --match="" --dirty --long --always --abbrev=4
3030
GIT_COMMIT_SHORT ?= $(shell git rev-parse --short HEAD 2> /dev/null || echo "")
3131
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "${GIT_COMMIT}")
3232
SOURCE_DATE_EPOCH ?= $(shell git log -1 --format=%ct 2> /dev/null || echo "")
33+
34+
ifeq ($(IMAGE_NAME),)
35+
REGISTRY ?= nvidia
36+
IMAGE_NAME := $(REGISTRY)/container-toolkit
37+
endif
38+
39+
VERSION ?= $(LIB_VERSION)$(if $(LIB_TAG),-$(LIB_TAG))

0 commit comments

Comments
 (0)