Skip to content

Commit 5280561

Browse files
[no-relnote] Update Github Actions E2E
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent 7b0e2ee commit 5280561

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

.github/workflows/e2e.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ jobs:
7070

7171
- name: Run e2e tests
7272
env:
73-
IMAGE_NAME: ghcr.io/nvidia/container-toolkit
74-
VERSION: ${{ inputs.version }}
73+
E2E_IMAGE_REPO: ghcr.io/nvidia/container-toolkit
74+
E2E_IMAGE_TAG: ${{ inputs.version }}-ubuntu20.04
7575
SSH_KEY: ${{ secrets.AWS_SSH_KEY }}
7676
E2E_SSH_USER: ${{ secrets.E2E_SSH_USER }}
7777
E2E_SSH_HOST: ${{ steps.holodeck_public_dns_name.outputs.result }}
@@ -82,8 +82,15 @@ jobs:
8282
chmod 600 "$e2e_ssh_key"
8383
export E2E_SSH_KEY="$e2e_ssh_key"
8484
85-
make -f tests/e2e/Makefile test
85+
make -f tests/e2e/Makefile test-e2e
8686
87+
- name: Archive Ginkgo logs
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: ginkgo-logs
91+
path: ginkgo.json
92+
retention-days: 15
93+
8794
- name: Send Slack alert notification
8895
if: ${{ failure() }}
8996
uses: slackapi/[email protected]

tests/e2e/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ compatibility runs, and pre‑release validation of new CTK builds.
5959
| Variable | Required | Example | Description |
6060
|----------|----------|---------|-------------|
6161
| `INSTALL_CTK` || `true` | When `true` the test installs CTK on the remote host before running the image. When `false` it assumes CTK is already present. |
62-
| `TOOLKIT_IMAGE` || `nvcr.io/nvidia/cuda:12.4.0-runtime-ubi9` | Image that will be pulled & executed. |
63-
| `SSH_KEY` || `/home/ci/.ssh/id_rsa` | Private key used for authentication. |
64-
| `SSH_USER` || `ubuntu` | Username on the remote host. |
62+
| `E2E_IMAGE_REPO` || `ghcr.io/nvidia/container-toolkit` | Container Toolkit Image |
63+
| `E2E_IMAGE_TAG` || `latest` | Image tag |
64+
| `E2E_SSH_KEY` || `/home/ci/.ssh/id_rsa` | Private key used for authentication. |
65+
| `E2E_SSH_USER` || `ubuntu` | Username on the remote host. |
6566
| `REMOTE_HOST` || `gpurunner01.corp.local` | Hostname or IP address of the target node. |
6667
| `REMOTE_PORT` || `22` | SSH port of the target node. |
6768

tests/e2e/e2e_test.go

+18-6
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,16 @@ func getTestEnv() {
108108
ImageTag = os.Getenv("E2E_IMAGE_TAG")
109109
Expect(ImageTag).NotTo(BeEmpty(), "E2E_IMAGE_TAG environment variable must be set")
110110

111-
sshKey = os.Getenv("SSH_KEY")
112-
Expect(sshKey).NotTo(BeEmpty(), "SSH_KEY environment variable must be set")
111+
sshKey = os.Getenv("E2E_SSH_KEY")
112+
Expect(sshKey).NotTo(BeEmpty(), "E2E_SSH_KEY environment variable must be set")
113113

114-
sshUser = os.Getenv("SSH_USER")
114+
sshUser = os.Getenv("E2E_SSH_USER")
115115
Expect(sshUser).NotTo(BeEmpty(), "SSH_USER environment variable must be set")
116116

117-
host = os.Getenv("REMOTE_HOST")
117+
host = os.Getenv("E2E_SSH_HOST")
118118
Expect(host).NotTo(BeEmpty(), "REMOTE_HOST environment variable must be set")
119119

120-
sshPort = os.Getenv("REMOTE_PORT")
121-
Expect(sshPort).NotTo(BeEmpty(), "REMOTE_PORT environment variable must be set")
120+
sshPort = getIntEnvVar("E2E_SSH_PORT", 22)
122121

123122
// Get current working directory
124123
cwd, err = os.Getwd()
@@ -137,3 +136,16 @@ func getBoolEnvVar(key string, defaultValue bool) bool {
137136
}
138137
return boolValue
139138
}
139+
140+
// getIntEnvVar returns the integer value of the environment variable or the default value if not set.
141+
func getIntEnvVar(key string, defaultValue int) string {
142+
value := os.Getenv(key)
143+
if value == "" {
144+
return strconv.Itoa(defaultValue)
145+
}
146+
intValue, err := strconv.Atoi(value)
147+
if err != nil {
148+
return strconv.Itoa(defaultValue)
149+
}
150+
return strconv.Itoa(intValue)
151+
}

0 commit comments

Comments
 (0)