Skip to content

Commit 294ff41

Browse files
authored
feat(agentless): add agentless build to agent build workflow (#9)
* feat(agentless): add agentless build to agent build workflow * fix: remove typo --------- Co-authored-by: Michael Skalka <mskalka@nvidia.com>
1 parent e0b0431 commit 294ff41

38 files changed

+205
-156
lines changed

.github/workflows/build_agent_container.yaml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
push:
66
branches:
77
- main
8-
- docker_ci
98
paths:
109
- agent/**
1110
- .github/workflows/build_agent_container.yaml
@@ -18,10 +17,11 @@ on:
1817
env:
1918
REGISTRY: ghcr.io
2019
IMAGE_NAME: ${{ github.repository }}
20+
DOCKER_CMD: docker
2121

2222
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
2323
jobs:
24-
build-and-push-image:
24+
build-and-push-agent:
2525
runs-on: ubuntu-latest
2626
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
2727
permissions:
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434
- name: Checkout repository
3535
uses: actions/checkout@v4
36-
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
36+
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
3737
- name: Log in to the Container registry
3838
uses: docker/login-action@v3
3939
with:
@@ -72,3 +72,52 @@ jobs:
7272
subject-digest: ${{ steps.build.outputs.digest }}
7373
push-to-registry: true
7474

75+
build-and-publish-agentless:
76+
runs-on: ubuntu-latest
77+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
78+
permissions:
79+
contents: read
80+
packages: write
81+
attestations: write
82+
id-token: write
83+
steps:
84+
- name: Checkout repository
85+
uses: actions/checkout@v4
86+
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
87+
- name: Log in to the Container registry
88+
uses: docker/login-action@v3
89+
with:
90+
registry: ${{ env.REGISTRY }}
91+
username: ${{ github.actor }}
92+
password: ${{ secrets.GITHUB_TOKEN }}
93+
94+
# Setup for multi-platform
95+
- name: Set up QEMU
96+
uses: docker/setup-qemu-action@v3
97+
98+
- name: Set up Docker Buildx
99+
uses: docker/setup-buildx-action@v3
100+
101+
- name: Build the agent container image
102+
id: build
103+
run: |
104+
source ./containers/agentless/versions.sh
105+
cd agent
106+
export TAGS=()
107+
for version in $TEST_VERSIONS; do
108+
TAGS+="-t ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}/agentless:$version "
109+
done
110+
111+
docker buildx build --push --platform linux/amd64,linux/arm64 $TAGS --metadata-file=metadata.json -f ../containers/agentless/Dockerfile ../containers/agentless
112+
113+
cat metadata.json
114+
echo "digest=$(cat metadata.json | jq -r .\"containerimage.digest\")" >> $GITHUB_OUTPUT
115+
cat $GITHUB_OUTPUT
116+
117+
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
118+
- name: Generate artifact attestation
119+
uses: actions/attest-build-provenance@v2
120+
with:
121+
subject-name: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}/agentless
122+
subject-digest: ${{ steps.build.outputs.digest }}
123+
push-to-registry: true

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"LOG_LEVEL": "info",
1818
"REAPPLY_ON_REBOOT": "false",
1919
// "AGENT_IMAGE": "nvcr.io/nvidian/swgpu-baseos/skyhook-agent:25.01.02-233800-38d9732d",
20-
"AGENT_IMAGE": "nvcr.io/nvidian/swgpu-baseos/agentless-test:6.2.0", // this is the mock image, if you need to test for real, use the real image.
20+
"AGENT_IMAGE": "ghcr.io/nvidia/skyhook/agentless:6.2.0", // this is the mock image, if you need to test for real, use the real image.
2121
// "COPY_DIR_ROOT": "/var/lib/google/skyhook"
2222
},
2323
"args": [],
2424
"showLog": true
25-
},
25+
},
2626
{
2727
"name": "Test Current File",
2828
"type": "go",
@@ -32,6 +32,6 @@
3232
"env": {},
3333
"args": [],
3434
"showLog": true
35-
}
35+
}
3636
]
3737
}

k8s-tests/chainsaw/skyhook/config-skyhook/assert-update-no-interrupt.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ metadata:
1111
"baxter|3.2.1": {
1212
"name": "baxter",
1313
"version": "3.2.1",
14-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
14+
"image": "ghcr.io/nvidia/skyhook/agentless",
1515
"stage": "config",
1616
"state": "complete"
1717
},
1818
"dexter|1.2.3": {
1919
"name": "dexter",
2020
"version": "1.2.3",
21-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
21+
"image": "ghcr.io/nvidia/skyhook/agentless",
2222
"stage": "config",
2323
"state": "complete"
2424
},
2525
"spencer|3.2.3": {
2626
"name": "spencer",
2727
"version": "3.2.3",
28-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
28+
"image": "ghcr.io/nvidia/skyhook/agentless",
2929
"stage": "post-interrupt",
3030
"state": "complete"
3131
}
@@ -53,19 +53,19 @@ status:
5353
state: complete
5454
version: '1.2.3'
5555
stage: config
56-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
56+
image: ghcr.io/nvidia/skyhook/agentless
5757
baxter|3.2.1:
5858
name: baxter
5959
state: complete
6060
version: '3.2.1'
6161
stage: config
62-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
62+
image: ghcr.io/nvidia/skyhook/agentless
6363
spencer|3.2.3:
6464
name: spencer
6565
state: complete
6666
version: '3.2.3'
6767
stage: post-interrupt
68-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
68+
image: ghcr.io/nvidia/skyhook/agentless
6969
nodeStatus:
7070
# grab values should be one and is complete
7171
(values(@)):

k8s-tests/chainsaw/skyhook/config-skyhook/assert-update-while-running.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ metadata:
1111
"baxter|3.2.1": {
1212
"name": "baxter",
1313
"version": "3.2.1",
14-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
14+
"image": "ghcr.io/nvidia/skyhook/agentless",
1515
"stage": "post-interrupt",
1616
"state": "complete"
1717
},
1818
"dexter|1.2.3": {
1919
"name": "dexter",
2020
"version": "1.2.3",
21-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
21+
"image": "ghcr.io/nvidia/skyhook/agentless",
2222
"stage": "post-interrupt",
2323
"state": "complete"
2424
},
2525
"spencer|3.2.3": {
2626
"name": "spencer",
2727
"version": "3.2.3",
28-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
28+
"image": "ghcr.io/nvidia/skyhook/agentless",
2929
"stage": "post-interrupt",
3030
"state": "complete"
3131
}
@@ -53,19 +53,19 @@ status:
5353
state: complete
5454
version: '1.2.3'
5555
stage: post-interrupt
56-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
56+
image: ghcr.io/nvidia/skyhook/agentless
5757
baxter|3.2.1:
5858
name: baxter
5959
state: complete
6060
version: '3.2.1'
6161
stage: post-interrupt
62-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
62+
image: ghcr.io/nvidia/skyhook/agentless
6363
spencer|3.2.3:
6464
name: spencer
6565
state: complete
6666
version: '3.2.3'
6767
stage: post-interrupt
68-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
68+
image: ghcr.io/nvidia/skyhook/agentless
6969
nodeStatus:
7070
# grab values should be one and is complete
7171
(values(@)):

k8s-tests/chainsaw/skyhook/config-skyhook/assert-update.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ metadata:
1111
"baxter|3.2.1": {
1212
"name": "baxter",
1313
"version": "3.2.1",
14-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
14+
"image": "ghcr.io/nvidia/skyhook/agentless",
1515
"stage": "post-interrupt",
1616
"state": "complete"
1717
},
1818
"dexter|1.2.3": {
1919
"name": "dexter",
2020
"version": "1.2.3",
21-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
21+
"image": "ghcr.io/nvidia/skyhook/agentless",
2222
"stage": "post-interrupt",
2323
"state": "complete"
2424
},
2525
"spencer|3.2.3": {
2626
"name": "spencer",
2727
"version": "3.2.3",
28-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
28+
"image": "ghcr.io/nvidia/skyhook/agentless",
2929
"stage": "post-interrupt",
3030
"state": "complete"
3131
}
@@ -53,19 +53,19 @@ status:
5353
state: complete
5454
version: '1.2.3'
5555
stage: post-interrupt
56-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
56+
image: ghcr.io/nvidia/skyhook/agentless
5757
baxter|3.2.1:
5858
name: baxter
5959
state: complete
6060
version: '3.2.1'
6161
stage: post-interrupt
62-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
62+
image: ghcr.io/nvidia/skyhook/agentless
6363
spencer|3.2.3:
6464
name: spencer
6565
state: complete
6666
version: '3.2.3'
6767
stage: post-interrupt
68-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
68+
image: ghcr.io/nvidia/skyhook/agentless
6969
nodeStatus:
7070
# grab values should be one and is complete
7171
(values(@)):

k8s-tests/chainsaw/skyhook/config-skyhook/assert.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ metadata:
1010
"baxter|3.2.1": {
1111
"name": "baxter",
1212
"version": "3.2.1",
13-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
13+
"image": "ghcr.io/nvidia/skyhook/agentless",
1414
"stage": "apply",
1515
"state": "in_progress"
1616
},
1717
"dexter|1.2.3": {
1818
"name": "dexter",
1919
"version": "1.2.3",
20-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
20+
"image": "ghcr.io/nvidia/skyhook/agentless",
2121
"stage": "apply",
2222
"state": "in_progress"
2323
},
2424
"spencer|3.2.3": {
2525
"name": "spencer",
2626
"version": "3.2.3",
27-
"image": "nvcr.io/nvidian/swgpu-baseos/agentless-test",
27+
"image": "ghcr.io/nvidia/skyhook/agentless",
2828
"stage": "apply",
2929
"state": "in_progress"
3030
}
@@ -51,19 +51,19 @@ status:
5151
state: in_progress
5252
version: '1.2.3'
5353
stage: apply
54-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
54+
image: ghcr.io/nvidia/skyhook/agentless
5555
baxter|3.2.1:
5656
name: baxter
5757
state: in_progress
5858
version: '3.2.1'
5959
stage: apply
60-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
60+
image: ghcr.io/nvidia/skyhook/agentless
6161
spencer|3.2.3:
6262
name: spencer
6363
state: in_progress
6464
version: '3.2.3'
6565
stage: apply
66-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
66+
image: ghcr.io/nvidia/skyhook/agentless
6767
nodeStatus:
6868
# grab values should be one and is complete
6969
(values(@)):

k8s-tests/chainsaw/skyhook/config-skyhook/skyhook.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ spec:
1414
packages:
1515
spencer:
1616
version: "3.2.3"
17-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
17+
image: ghcr.io/nvidia/skyhook/agentless
1818
interrupt:
1919
type: service
2020
services: [cron]
2121
dexter:
2222
version: "1.2.3"
23-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
23+
image: ghcr.io/nvidia/skyhook/agentless
2424
interrupt:
2525
type: reboot
2626
configInterrupts:
@@ -40,7 +40,7 @@ spec:
4040
how.nice.to.look=fairlyNice
4141
baxter:
4242
version: "3.2.1"
43-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
43+
image: ghcr.io/nvidia/skyhook/agentless
4444
configInterrupts:
4545
game.properties:
4646
type: service

k8s-tests/chainsaw/skyhook/config-skyhook/update-no-interrupt.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ spec:
1414
packages:
1515
spencer:
1616
version: "3.2.3"
17-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
17+
image: ghcr.io/nvidia/skyhook/agentless
1818
interrupt:
1919
type: service
2020
services: [cron]
2121
dexter:
2222
version: "1.2.3"
23-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
23+
image: ghcr.io/nvidia/skyhook/agentless
2424
interrupt:
2525
type: reboot
2626
configInterrupts:
@@ -34,7 +34,7 @@ spec:
3434
changed
3535
baxter:
3636
version: "3.2.1"
37-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
37+
image: ghcr.io/nvidia/skyhook/agentless
3838
configInterrupts:
3939
game.properties:
4040
type: service

k8s-tests/chainsaw/skyhook/config-skyhook/update-while-running.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ spec:
1414
packages:
1515
spencer:
1616
version: "3.2.3"
17-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
17+
image: ghcr.io/nvidia/skyhook/agentless
1818
interrupt:
1919
type: service
2020
services: [cron]
2121
dexter:
2222
version: "1.2.3"
23-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
23+
image: ghcr.io/nvidia/skyhook/agentless
2424
interrupt:
2525
type: reboot
2626
configInterrupts:
@@ -40,7 +40,7 @@ spec:
4040
how.nice.to.look=fairlyNice
4141
baxter:
4242
version: "3.2.1"
43-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
43+
image: ghcr.io/nvidia/skyhook/agentless
4444
configInterrupts:
4545
game.properties:
4646
type: service

k8s-tests/chainsaw/skyhook/config-skyhook/update.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ spec:
1414
packages:
1515
spencer:
1616
version: "3.2.3"
17-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
17+
image: ghcr.io/nvidia/skyhook/agentless
1818
interrupt:
1919
type: service
2020
services: [cron]
2121
dexter:
2222
version: "1.2.3"
23-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
23+
image: ghcr.io/nvidia/skyhook/agentless
2424
interrupt:
2525
type: reboot
2626
configInterrupts:
@@ -37,7 +37,7 @@ spec:
3737
how.nice.to.look=fairlyNice
3838
baxter:
3939
version: "3.2.1"
40-
image: nvcr.io/nvidian/swgpu-baseos/agentless-test
40+
image: ghcr.io/nvidia/skyhook/agentless
4141
configInterrupts:
4242
game.properties:
4343
type: service

0 commit comments

Comments
 (0)