Skip to content

Commit 94bd1eb

Browse files
authored
Merge pull request #27 from stackabletech/no-image-case
Refactor code and stabilize CRDs
2 parents 6b55f6e + d412b70 commit 94bd1eb

File tree

10 files changed

+541
-233
lines changed

10 files changed

+541
-233
lines changed

Cargo.lock

Lines changed: 97 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/ny_tlc_report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
from pyspark.sql import SparkSession, DataFrame
1616
from pyspark.sql.functions import dayofweek
1717

18+
import tabulate
19+
1820

1921
def check_args() -> Namespace:
2022
"""Parse the given CLI arguments"""
@@ -54,7 +56,7 @@ def build_report(spark: SparkSession, args: Namespace) -> DataFrame:
5456

5557
try:
5658
report = build_report(spark, args)
57-
report.show()
59+
print(tabulate.tabulate(report.collect()))
5860
if args.output:
5961
report.coalesce(1).write.mode("overwrite").options(header=True).csv(
6062
args.output

docs/modules/ROOT/pages/usage.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,4 @@ Environment variables can be (over)written by adding them to `spark-env.sh` file
4444

4545
=== Development
4646

47-
export KUBERNETES_SERVICE_PORT_HTTPS=443
48-
export KUBERNETES_SERVICE_HOST=10.96.0.1
4947
kubectl create clusterrolebinding spark-role --clusterrole=edit --serviceaccount=default:default

examples/ny-tlc-report-external-dependencies.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ metadata:
66
namespace: default
77
spec:
88
version: "1.0"
9-
image: docker.stackable.tech/stackable/ny-tlc-report:0.1.0
109
sparkImage: docker.stackable.tech/stackable/spark-k8s:3.2.1-hadoop3.2-python39-aws1.11.375-stackable0.3.0
1110
mode: cluster
1211
mainApplicationFile: s3a://stackable-spark-k8s-jars/jobs/ny_tlc_report.py

examples/spark-examples-s3.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ kind: SparkApplication
44
metadata:
55
name: spark-examples-s3
66
spec:
7-
# TODO : remove the image
8-
image: docker.stackable.tech/stackable/ny-tlc-report:0.1.0
97
version: "1.0"
108
sparkImage: docker.stackable.tech/stackable/spark-k8s:3.2.1-hadoop3.2-python39-aws1.11.375-stackable0.3.0
119
mode: cluster

rust/crd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository = "https://github.com/stackabletech/spark-k8s-operator"
88
version = "0.1.0-nightly"
99

1010
[dependencies]
11-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.13.0" }
11+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.15.0" }
1212

1313
semver = "1.0"
1414
serde = { version = "1.0", features = ["derive"] }

rust/crd/src/constants.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pub const VOLUME_MOUNT_NAME_POD_TEMPLATES: &str = "pod-template";
2+
pub const VOLUME_MOUNT_PATH_POD_TEMPLATES: &str = "/stackable/spark/pod-templates";
3+
4+
pub const CONTAINER_NAME_JOB: &str = "job";
5+
pub const VOLUME_MOUNT_NAME_JOB: &str = "job-files";
6+
pub const VOLUME_MOUNT_PATH_JOB: &str = "/stackable/spark/jobs";
7+
8+
pub const CONTAINER_NAME_REQ: &str = "requirements";
9+
pub const VOLUME_MOUNT_NAME_REQ: &str = "req-files";
10+
pub const VOLUME_MOUNT_PATH_REQ: &str = "/stackable/spark/requirements";
11+
12+
pub const CONTAINER_IMAGE_NAME_DRIVER: &str = "dummy-overwritten-by-command-line";
13+
pub const CONTAINER_NAME_DRIVER: &str = "spark-driver";
14+
15+
pub const CONTAINER_IMAGE_NAME_EXECUTOR: &str = "dummy-overwritten-by-command-line";
16+
pub const CONTAINER_NAME_EXECUTOR: &str = "spark-executor";

0 commit comments

Comments
 (0)