Skip to content

Commit 917247c

Browse files
authored
Merge branch 'kubeflow:master' into odh
2 parents 2026de4 + a349e3d commit 917247c

File tree

7 files changed

+411
-0
lines changed

7 files changed

+411
-0
lines changed
Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
name: Release Latest Images
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.actor }}
13+
cancel-in-progress: true
14+
15+
env:
16+
IMAGE_REGISTRY: ghcr.io
17+
OPERATOR_IMAGE_REPOSITORY: ${{ github.repository }}/controller
18+
KUBECTL_IMAGE_REPOSITORY: ${{ github.repository }}/kubectl
19+
KUBECTL_VERSION: 1.33.2
20+
21+
jobs:
22+
build_operator_images:
23+
runs-on: ubuntu-latest
24+
25+
permissions:
26+
contents: read
27+
packages: write
28+
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
platform:
33+
- linux/amd64
34+
- linux/arm64
35+
36+
steps:
37+
- name: Prepare
38+
run: |
39+
platform=${{ matrix.platform }}
40+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
41+
42+
- name: Checkout source code
43+
uses: actions/checkout@v5
44+
45+
- name: Docker meta
46+
id: meta
47+
uses: docker/metadata-action@v5
48+
with:
49+
images: ${{ env.IMAGE_REGISTRY }}/${{ env.OPERATOR_IMAGE_REPOSITORY }}
50+
tags: |
51+
type=raw,pattern={{version}},value=latest
52+
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v3
55+
56+
- name: Set up Docker buildx
57+
uses: docker/setup-buildx-action@v3
58+
59+
- name: Login to container registry
60+
uses: docker/login-action@v3
61+
with:
62+
registry: ${{ env.IMAGE_REGISTRY }}
63+
username: ${{ github.actor }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Build and push by digest
67+
id: build
68+
uses: docker/build-push-action@v6
69+
with:
70+
platforms: ${{ matrix.platform }}
71+
labels: ${{ steps.meta.outputs.labels }}
72+
outputs: type=image,name=${{ env.IMAGE_REGISTRY }}/${{ env.OPERATOR_IMAGE_REPOSITORY }},push-by-digest=true,name-canonical=true,push=true
73+
74+
- name: Export digest
75+
run: |
76+
mkdir -p /tmp/digests
77+
digest="${{ steps.build.outputs.digest }}"
78+
touch "/tmp/digests/${digest#sha256:}"
79+
80+
- name: Upload digest
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: digests-operator-${{ env.PLATFORM_PAIR }}
84+
path: /tmp/digests/*
85+
if-no-files-found: error
86+
retention-days: 1
87+
88+
build_kubectl_images:
89+
runs-on: ubuntu-latest
90+
91+
permissions:
92+
contents: read
93+
packages: write
94+
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
platform:
99+
- linux/amd64
100+
- linux/arm64
101+
102+
steps:
103+
- name: Prepare
104+
run: |
105+
platform=${{ matrix.platform }}
106+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
107+
108+
- name: Checkout source code
109+
uses: actions/checkout@v5
110+
111+
- name: Docker meta
112+
id: meta
113+
uses: docker/metadata-action@v5
114+
with:
115+
images: ${{ env.IMAGE_REGISTRY }}/${{ env.KUBECTL_IMAGE_REPOSITORY }}
116+
tags: |
117+
type=raw,value=latest
118+
119+
- name: Set up QEMU
120+
uses: docker/setup-qemu-action@v3
121+
122+
- name: Set up Docker buildx
123+
uses: docker/setup-buildx-action@v3
124+
125+
- name: Login to container registry
126+
uses: docker/login-action@v3
127+
with:
128+
registry: ${{ env.IMAGE_REGISTRY }}
129+
username: ${{ github.actor }}
130+
password: ${{ secrets.GITHUB_TOKEN }}
131+
132+
- name: Build and push by digest
133+
id: build
134+
uses: docker/build-push-action@v6
135+
with:
136+
file: docker/Dockerfile.kubectl
137+
platforms: ${{ matrix.platform }}
138+
build-args: |
139+
KUBECTL_VERSION=${{ env.KUBECTL_VERSION }}
140+
labels: ${{ steps.meta.outputs.labels }}
141+
outputs: type=image,name=${{ env.IMAGE_REGISTRY }}/${{ env.KUBECTL_IMAGE_REPOSITORY }},push-by-digest=true,name-canonical=true,push=true
142+
143+
- name: Export digest
144+
run: |
145+
mkdir -p /tmp/digests
146+
digest="${{ steps.build.outputs.digest }}"
147+
touch "/tmp/digests/${digest#sha256:}"
148+
149+
- name: Upload digest
150+
uses: actions/upload-artifact@v4
151+
with:
152+
name: digests-kubectl-${{ env.PLATFORM_PAIR }}
153+
path: /tmp/digests/*
154+
if-no-files-found: error
155+
retention-days: 1
156+
157+
release_operator_images:
158+
needs:
159+
- build_operator_images
160+
161+
runs-on: ubuntu-latest
162+
163+
permissions:
164+
contents: read
165+
packages: write
166+
167+
steps:
168+
- name: Checkout source code
169+
uses: actions/checkout@v5
170+
171+
- name: Read version from VERSION file
172+
run: |
173+
VERSION=$(cat VERSION)
174+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
175+
176+
- name: Docker meta
177+
id: meta
178+
uses: docker/metadata-action@v5
179+
with:
180+
images: ${{ env.IMAGE_REGISTRY }}/${{ env.OPERATOR_IMAGE_REPOSITORY }}
181+
tags: |
182+
type=raw,value=latest
183+
184+
- name: Download digests
185+
uses: actions/download-artifact@v5
186+
with:
187+
path: /tmp/digests
188+
pattern: digests-operator-*
189+
merge-multiple: true
190+
191+
- name: Set up Docker buildx
192+
uses: docker/setup-buildx-action@v3
193+
194+
- name: Login to container registry
195+
uses: docker/login-action@v3
196+
with:
197+
registry: ${{ env.IMAGE_REGISTRY }}
198+
username: ${{ github.actor }}
199+
password: ${{ secrets.GITHUB_TOKEN }}
200+
201+
- name: Create manifest list and push
202+
working-directory: /tmp/digests
203+
run: |
204+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
205+
$(printf '${{ env.IMAGE_REGISTRY }}/${{ env.OPERATOR_IMAGE_REPOSITORY }}@sha256:%s ' *)
206+
207+
- name: Inspect image
208+
run: |
209+
docker buildx imagetools inspect ${{ env.IMAGE_REGISTRY }}/${{ env.OPERATOR_IMAGE_REPOSITORY }}:${{ steps.meta.outputs.version }}
210+
211+
release_kubectl_images:
212+
needs:
213+
- build_kubectl_images
214+
215+
runs-on: ubuntu-latest
216+
217+
permissions:
218+
contents: read
219+
packages: write
220+
221+
steps:
222+
- name: Checkout source code
223+
uses: actions/checkout@v5
224+
225+
- name: Read version from VERSION file
226+
run: |
227+
VERSION=$(cat VERSION)
228+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
229+
230+
- name: Docker meta
231+
id: meta
232+
uses: docker/metadata-action@v5
233+
with:
234+
images: ${{ env.IMAGE_REGISTRY }}/${{ env.KUBECTL_IMAGE_REPOSITORY }}
235+
tags: |
236+
type=raw,value=latest
237+
238+
- name: Download digests
239+
uses: actions/download-artifact@v5
240+
with:
241+
path: /tmp/digests
242+
pattern: digests-kubectl-*
243+
merge-multiple: true
244+
245+
- name: Set up Docker buildx
246+
uses: docker/setup-buildx-action@v3
247+
248+
- name: Login to container registry
249+
uses: docker/login-action@v3
250+
with:
251+
registry: ${{ env.IMAGE_REGISTRY }}
252+
username: ${{ github.actor }}
253+
password: ${{ secrets.GITHUB_TOKEN }}
254+
255+
- name: Create manifest list and push
256+
working-directory: /tmp/digests
257+
run: |
258+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
259+
$(printf '${{ env.IMAGE_REGISTRY }}/${{ env.KUBECTL_IMAGE_REPOSITORY }}@sha256:%s ' *)
260+
261+
- name: Inspect image
262+
run: |
263+
docker buildx imagetools inspect ${{ env.IMAGE_REGISTRY }}/${{ env.KUBECTL_IMAGE_REPOSITORY }}:${{ steps.meta.outputs.version }}

charts/spark-operator-chart/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall) for command docum
122122
| controller.priorityClassName | string | `""` | Priority class for controller pods. |
123123
| controller.podSecurityContext | object | `{"fsGroup":185}` | Security context for controller pods. |
124124
| controller.topologySpreadConstraints | list | `[]` | Topology spread constraints rely on node labels to identify the topology domain(s) that each Node is in. Ref: [Pod Topology Spread Constraints](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/). The labelSelector field in topology spread constraint will be set to the selector labels for controller pods if not specified. |
125+
| controller.hostUsers | string | `nil` | Whether to use user namespace or not Kubernetes version 1.30 for feature beta (1.33 for GA) or higher is required with support from OS and OCI runtime ref: https://kubernetes.io/docs/concepts/workloads/pods/user-namespaces/ |
125126
| controller.env | list | `[]` | Environment variables for controller containers. |
126127
| controller.envFrom | list | `[]` | Environment variable sources for controller containers. |
127128
| controller.volumeMounts | list | `[{"mountPath":"/tmp","name":"tmp","readOnly":false}]` | Volume mounts for controller containers. |
@@ -164,6 +165,7 @@ See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall) for command docum
164165
| webhook.priorityClassName | string | `""` | Priority class for webhook pods. |
165166
| webhook.podSecurityContext | object | `{"fsGroup":185}` | Security context for webhook pods. |
166167
| webhook.topologySpreadConstraints | list | `[]` | Topology spread constraints rely on node labels to identify the topology domain(s) that each Node is in. Ref: [Pod Topology Spread Constraints](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/). The labelSelector field in topology spread constraint will be set to the selector labels for webhook pods if not specified. |
168+
| webhook.hostUsers | string | `nil` | Whether to use user namespace or not Kubernetes version 1.30 for feature beta (1.33 for GA) or higher is required with support from OS and OCI runtime ref: https://kubernetes.io/docs/concepts/workloads/pods/user-namespaces/ |
167169
| webhook.env | list | `[]` | Environment variables for webhook containers. |
168170
| webhook.envFrom | list | `[]` | Environment variable sources for webhook containers. |
169171
| webhook.volumeMounts | list | `[{"mountPath":"/etc/k8s-webhook-server/serving-certs","name":"serving-certs","readOnly":false,"subPath":"serving-certs"}]` | Volume mounts for webhook containers. |

charts/spark-operator-chart/templates/controller/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ spec:
184184
affinity:
185185
{{- toYaml . | nindent 8 }}
186186
{{- end }}
187+
{{- if and (semverCompare ">=1.30-0" .Capabilities.KubeVersion.Version) (kindIs "bool" .Values.controller.hostUsers) }}
188+
hostUsers: {{ .Values.controller.hostUsers }}
189+
{{- end }}
187190
{{- with .Values.controller.tolerations }}
188191
tolerations:
189192
{{- toYaml . | nindent 6 }}

charts/spark-operator-chart/templates/webhook/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ spec:
144144
affinity:
145145
{{- toYaml . | nindent 8 }}
146146
{{- end }}
147+
{{- if and (semverCompare ">=1.30-0" .Capabilities.KubeVersion.Version) (kindIs "bool" .Values.webhook.hostUsers) }}
148+
hostUsers: {{ .Values.webhook.hostUsers }}
149+
{{- end }}
147150
{{- with .Values.webhook.tolerations }}
148151
tolerations:
149152
{{- toYaml . | nindent 8 }}

charts/spark-operator-chart/tests/controller/deployment_test.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,71 @@ tests:
668668
- failedTemplate:
669669
errorMessage: "controller.replicas must be greater than 1 to enable topology spread constraints for controller pods"
670670

671+
- it: Should include hostUsers when kubernetes version >= 1.30 and hostUsers is true
672+
capabilities:
673+
majorVersion: 1
674+
minorVersion: 30
675+
set:
676+
controller:
677+
hostUsers: true
678+
asserts:
679+
- equal:
680+
path: spec.template.spec.hostUsers
681+
value: true
682+
683+
- it: Should include hostUsers when kubernetes version >= 1.30 and hostUsers is false
684+
capabilities:
685+
majorVersion: 1
686+
minorVersion: 34
687+
set:
688+
controller:
689+
hostUsers: false
690+
asserts:
691+
- equal:
692+
path: spec.template.spec.hostUsers
693+
value: false
694+
695+
- it: Should not contain hostUsers when kubernetes version < 1.29 and hostUsers is set
696+
capabilities:
697+
majorVersion: 1
698+
minorVersion: 29
699+
set:
700+
controller:
701+
hostUsers: true
702+
asserts:
703+
- notExists:
704+
path: spec.template.spec.hostUsers
705+
706+
- it: Should not include hostUsers when kubernetes version >= 1.30 but value not set
707+
capabilities:
708+
majorVersion: 1
709+
minorVersion: 34
710+
asserts:
711+
- notExists:
712+
path: spec.template.spec.hostUsers
713+
714+
- it: Should should NOT include hostUsers when kubernetes version >= 1.30 but value is string
715+
capabilities:
716+
majorVersion: 1
717+
minorVersion: 34
718+
set:
719+
controller:
720+
hostUsers: "true"
721+
asserts:
722+
- notExists:
723+
path: spec.template.spec.hostUsers
724+
725+
- it: Should not include hostUsers when kubernetes version >= 1.30 but value is null
726+
capabilities:
727+
majorVersion: 1
728+
minorVersion: 34
729+
set:
730+
controller:
731+
hostUsers: null
732+
asserts:
733+
- notExists:
734+
path: spec.template.spec.hostUsers
735+
671736
- it: Should contain `--pprof-bind-address` arg if `controller.pprof.enable` is set to `true`
672737
set:
673738
controller:

0 commit comments

Comments
 (0)