File tree Expand file tree Collapse file tree 5 files changed +47
-12
lines changed Expand file tree Collapse file tree 5 files changed +47
-12
lines changed Original file line number Diff line number Diff line change 3535 run : echo "version=$(echo $GITHUB_SHA | cut -c1-8)" >> "$GITHUB_OUTPUT"
3636
3737 golang :
38+ needs : [variables]
39+ secrets : inherit
3840 uses : ./.github/workflows/golang.yaml
3941
4042 image :
Original file line number Diff line number Diff line change @@ -16,13 +16,6 @@ name: Golang
1616
1717on :
1818 workflow_call : {}
19- pull_request :
20- types :
21- - opened
22- - synchronize
23- branches :
24- - main
25- - release-*
2619
2720jobs :
2821 check :
7164 uses : actions/setup-go@v5
7265 with :
7366 go-version : ${{ env.GOLANG_VERSION }}
74-
67+
7568 - name : Run unit tests and generate coverage report
7669 run : make coverage
7770
8376
8477 build :
8578 name : Build
86- runs-on : ubuntu-latest
79+ runs-on : linux-amd64-cpu4
80+ permissions :
81+ contents : read
82+ id-token : write
8783 steps :
8884 - name : Checkout code
8985 uses : actions/checkout@v4
9995 with :
10096 go-version : ${{ env.GOLANG_VERSION }}
10197
102- - run : make build
98+ - name : Setup JFrog CLI
99+ id : jfrog
100+ uses : jfrog/setup-jfrog-cli@v4
101+ env :
102+ JF_URL : https://${{ secrets.OIDC_ARTIFACTORY_ENDPOINT }}/
103+ with :
104+ oidc-provider-name : nvgithub
105+ oidc-audience : ${{ secrets.OIDC_ARTIFACTORY_ENDPOINT }}
106+ - env :
107+ OIDC_USER : ${{ steps.jfrog.outputs.oidc-user }}
108+ OIDC_TOKEN : ${{ steps.jfrog.outputs.oidc-token }}
109+ OIDC_ARTIFACTORY_ENDPOINT : ${{ secrets.OIDC_ARTIFACTORY_ENDPOINT }}
110+ run : |
111+ OIDC_USER_ENCODED=$(python3 -c 'import urllib.parse, os; print(urllib.parse.quote_plus(os.environ["OIDC_USER"]))')
112+ export GOPROXY="https://${OIDC_USER_ENCODED}:${OIDC_TOKEN}@${OIDC_ARTIFACTORY_ENDPOINT}/artifactory/api/go/edge-go-remote-virtual"
113+ make build
Original file line number Diff line number Diff line change 2727
2828jobs :
2929 build-image :
30- runs-on : ubuntu-latest
30+ runs-on : linux-amd64-cpu4
31+ permissions :
32+ contents : read
33+ id-token : write
34+ packages : write
3135 strategy :
3236 matrix :
3337 dist : [ubi9]
@@ -49,13 +53,25 @@ jobs:
4953 registry : ghcr.io
5054 username : ${{ github.actor }}
5155 password : ${{ secrets.GITHUB_TOKEN }}
52-
56+ - name : Setup JFrog CLI
57+ id : jfrog
58+ uses : jfrog/setup-jfrog-cli@v4
59+ env :
60+ JF_URL : https://${{ secrets.OIDC_ARTIFACTORY_ENDPOINT }}/
61+ with :
62+ oidc-provider-name : nvgithub
63+ oidc-audience : ${{ secrets.OIDC_ARTIFACTORY_ENDPOINT }}
5364 - name : Build image
5465 env :
5566 IMAGE_NAME : ghcr.io/nvidia/k8s-driver-manager
5667 VERSION : ${{ inputs.version }}
5768 PUSH_ON_BUILD : " true"
5869 BUILD_MULTI_ARCH_IMAGES : ${{ inputs.build_multi_arch_images }}
70+ OIDC_USER : ${{ steps.jfrog.outputs.oidc-user }}
71+ OIDC_TOKEN : ${{ steps.jfrog.outputs.oidc-token }}
72+ OIDC_ARTIFACTORY_ENDPOINT : ${{ secrets.OIDC_ARTIFACTORY_ENDPOINT }}
5973 run : |
74+ OIDC_USER_ENCODED=$(python3 -c 'import urllib.parse, os; print(urllib.parse.quote_plus(os.environ["OIDC_USER"]))')
75+ export GOPROXY="https://${OIDC_USER_ENCODED}:${OIDC_TOKEN}@${OIDC_ARTIFACTORY_ENDPOINT}/artifactory/api/go/edge-go-remote-virtual"
6076 echo "${VERSION}"
6177 make -f deployments/container/Makefile build-${{ matrix.dist }}
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ FROM nvcr.io/nvidia/cuda:13.0.1-base-ubi9 AS build
1616
1717WORKDIR /work
1818
19+ ARG GOPROXY=direct
20+ ENV GOPROXY=$GOPROXY
21+
1922COPY go.mod go.mod
2023COPY go.sum go.sum
2124COPY vendor vendor
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ REGISTRY ?= nvidia
2727IMAGE_NAME := $(REGISTRY ) /k8s-driver-manager
2828endif
2929
30+ GOPROXY ?= direct
31+
3032IMAGE_VERSION := $(VERSION )
3133
3234IMAGE = $(IMAGE_NAME ) :$(IMAGE_VERSION )
@@ -66,6 +68,7 @@ $(BUILD_TARGETS): build-%:
6668 --build-arg VERSION=" $( VERSION) " \
6769 --build-arg GIT_COMMIT=" $( GIT_COMMIT) " \
6870 --build-arg CVE_UPDATES=" $( CVE_UPDATES) " \
71+ --build-arg GOPROXY=" $( GOPROXY) " \
6972 --file $(DOCKERFILE ) \
7073 $(CURDIR )
7174
You can’t perform that action at this time.
0 commit comments