Skip to content

Commit 714f15f

Browse files
authored
Merge branch 'main' into chore/spark-3.5.6
2 parents 35a284f + 1e7686d commit 714f15f

File tree

10 files changed

+32
-12
lines changed

10 files changed

+32
-12
lines changed

.github/workflows/dev_ny-tlc-report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and publish ny-tlc-report
33

44
env:
55
IMAGE_NAME: ny-tlc-report
6-
IMAGE_VERSION: 0.2.0
6+
IMAGE_VERSION: 0.3.0
77
REGISTRY_PATH: stackable
88
DOCKERFILE_PATH: "apps/docker/Dockerfile"
99

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ All notable changes to this project will be documented in this file.
2929
- Use versioned common structs ([#572]).
3030
- BREAKING: Change the label `app.kubernetes.io/name` for Spark history and connect objects to use `spark-history` and `spark-connect` instead of `spark-k8s` ([#573]).
3131
- BREAKING: The history Pods now have their own ClusterRole named `spark-history-clusterrole` ([#573]).
32+
- BREAKING: Previously this operator would hardcode the UID and GID of the Pods being created to 1000/0, this has changed now ([#575])
33+
- The `runAsUser` and `runAsGroup` fields will not be set anymore by the operator
34+
- The defaults from the docker images itself will now apply, which will be different from 1000/0 going forward
35+
- This is marked as breaking because tools and policies might exist, which require these fields to be set
3236

3337
### Fixed
3438

@@ -54,6 +58,8 @@ All notable changes to this project will be documented in this file.
5458
[#573]: https://github.com/stackabletech/spark-k8s-operator/pull/573
5559
[#574]: https://github.com/stackabletech/spark-k8s-operator/pull/574
5660
[#580]: https://github.com/stackabletech/spark-k8s-operator/pull/580
61+
[#575]: https://github.com/stackabletech/spark-k8s-operator/pull/575
62+
5763

5864
## [25.3.0] - 2025-03-21
5965

apps/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
# Provision Spark applications from seaparate image
12

2-
# Generate report from the public data set
3+
## Build the image
4+
5+
docker build -t oci.stackable.tech/stackable/ny-tlc-report:0.3.0 -f apps/docker/Dockerfile .
6+
docker push oci.stackable.tech/stackable/ny-tlc-report:0.3.0
7+
8+
## Generate report from the public data set
39

410
spark-submit --conf spark.hadoop.fs.s3a.aws.credentials.provider=org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider --packages org.apache.hadoop:hadoop-aws:3.2.0,com.amazonaws:aws-java-sdk-s3:1.12.180,com.amazonaws:aws-java-sdk-core:1.12.180 ny_tlc_report.py --input 's3a://nyc-tlc/trip data/yellow_tripdata_2021-07.csv'
511

apps/docker/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ LABEL maintainer="Stackable GmbH"
55

66
WORKDIR /jobs
77

8+
# A user must be specified for the container to run on OpenShift
9+
# with the nonroot-v2 security context constraint and
10+
# without a runAsUser container annotation.
11+
USER 1000
12+
813
COPY apps/ny_tlc_report.py .

deploy/helm/spark-k8s-operator/templates/roles.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,13 @@ rules:
151151
- patch
152152
- create
153153
- delete
154+
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
155+
- apiGroups:
156+
- security.openshift.io
157+
resources:
158+
- securitycontextconstraints
159+
resourceNames:
160+
- nonroot-v2
161+
verbs:
162+
- use
163+
{{ end }}

rust/operator-binary/src/connect/server.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use crate::{
4848
constants::{
4949
JVM_SECURITY_PROPERTIES_FILE, LISTENER_VOLUME_DIR, LISTENER_VOLUME_NAME,
5050
LOG4J2_CONFIG_FILE, MAX_SPARK_LOG_FILES_SIZE, METRICS_PROPERTIES_FILE,
51-
POD_TEMPLATE_FILE, SPARK_DEFAULTS_FILE_NAME, SPARK_UID, VOLUME_MOUNT_NAME_CONFIG,
51+
POD_TEMPLATE_FILE, SPARK_DEFAULTS_FILE_NAME, VOLUME_MOUNT_NAME_CONFIG,
5252
VOLUME_MOUNT_NAME_LOG, VOLUME_MOUNT_NAME_LOG_CONFIG, VOLUME_MOUNT_PATH_CONFIG,
5353
VOLUME_MOUNT_PATH_LOG, VOLUME_MOUNT_PATH_LOG_CONFIG,
5454
},
@@ -246,8 +246,6 @@ pub(crate) fn build_stateful_set(
246246
)
247247
.context(AddVolumeSnafu)?
248248
.security_context(PodSecurityContext {
249-
run_as_user: Some(SPARK_UID),
250-
run_as_group: Some(0),
251249
fs_group: Some(1000),
252250
..PodSecurityContext::default()
253251
});

rust/operator-binary/src/crd/constants.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ pub const SPARK_DEFAULTS_FILE_NAME: &str = "spark-defaults.conf";
8686
pub const SPARK_ENV_SH_FILE_NAME: &str = "spark-env.sh";
8787

8888
pub const SPARK_CLUSTER_ROLE: &str = "spark-k8s-clusterrole";
89-
pub const SPARK_UID: i64 = 1000;
9089
pub const METRICS_PORT: u16 = 18081;
9190
pub const HISTORY_UI_PORT: u16 = 18080;
9291

rust/operator-binary/src/history/history_controller.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ use crate::{
5858
HISTORY_UI_PORT, JVM_SECURITY_PROPERTIES_FILE, LISTENER_VOLUME_DIR,
5959
LISTENER_VOLUME_NAME, MAX_SPARK_LOG_FILES_SIZE, METRICS_PORT, OPERATOR_NAME,
6060
SECRET_ACCESS_KEY, SPARK_DEFAULTS_FILE_NAME, SPARK_ENV_SH_FILE_NAME,
61-
SPARK_IMAGE_BASE_NAME, SPARK_UID, STACKABLE_TRUST_STORE, VOLUME_MOUNT_NAME_CONFIG,
61+
SPARK_IMAGE_BASE_NAME, STACKABLE_TRUST_STORE, VOLUME_MOUNT_NAME_CONFIG,
6262
VOLUME_MOUNT_NAME_LOG, VOLUME_MOUNT_NAME_LOG_CONFIG, VOLUME_MOUNT_PATH_CONFIG,
6363
VOLUME_MOUNT_PATH_LOG, VOLUME_MOUNT_PATH_LOG_CONFIG,
6464
},
@@ -544,8 +544,6 @@ fn build_stateful_set(
544544
)
545545
.context(AddVolumeSnafu)?
546546
.security_context(PodSecurityContext {
547-
run_as_user: Some(SPARK_UID),
548-
run_as_group: Some(0),
549547
fs_group: Some(1000),
550548
..PodSecurityContext::default()
551549
});

rust/operator-binary/src/spark_k8s_controller.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,6 @@ fn build_spark_role_serviceaccount(
10231023

10241024
fn security_context() -> PodSecurityContext {
10251025
PodSecurityContext {
1026-
run_as_user: Some(SPARK_UID),
1027-
run_as_group: Some(0),
10281026
fs_group: Some(1000),
10291027
..PodSecurityContext::default()
10301028
}

tests/test-definition.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dimensions:
3434
- 3.9.3
3535
- name: ny-tlc-report
3636
values:
37-
- 0.2.0
37+
- 0.3.0
3838
- name: s3-use-tls
3939
values:
4040
- "false"

0 commit comments

Comments
 (0)