Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(registry): Add support of memoryOverhead and coreLimit for Spark jobs #111

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ public class SparkDriverSpec {
private List<V1Toleration> tolerations;
private Integer cores;
private String coreRequest;
private String coreLimit;
private String mainApplicationFile;
private String mainClass;
private String memory;
private String memoryOverhead;
private String javaOptions;
private Map<String, String> labels;
private String serviceAccount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public class SparkExecutorSpec {
private List<V1Toleration> tolerations;
private Integer cores;
private String coreRequest;
private String coreLimit;
private Integer instances;
private String memory;
private String memoryOverhead;
private String javaOptions;
private Map<String, String> labels;
private Map<String, String> annotations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ public void shouldCreateStreamingJob() throws IOException, SparkOperatorApiExcep
SparkExecutorSpec templateExecutorSpec = new SparkExecutorSpec();
templateDriverSpec.setCores(1);
templateDriverSpec.setMemory("1g");
templateDriverSpec.setMemoryOverhead("250m");
templateDriverSpec.setLabels(Map.of("team", "${team}"));
templateExecutorSpec.setCores(2);
templateExecutorSpec.setCoreRequest("100m");
templateExecutorSpec.setCoreLimit("200m");
templateExecutorSpec.setMemory("2g");
templateSparkApplicationSpec.setDriver(templateDriverSpec);
templateSparkApplicationSpec.setExecutor(templateExecutorSpec);
Expand Down Expand Up @@ -205,10 +208,13 @@ public void shouldCreateStreamingJob() throws IOException, SparkOperatorApiExcep
SparkDriverSpec expectedDriverSpec = new SparkDriverSpec();
expectedDriverSpec.setCores(2);
expectedDriverSpec.setMemory("1g");
expectedDriverSpec.setMemoryOverhead("250m");
expectedDriverSpec.setLabels(Map.of("team", "some-team"));
expectedSparkApplicationSpec.setDriver(expectedDriverSpec);
SparkExecutorSpec expectedExecutorSpec = new SparkExecutorSpec();
expectedExecutorSpec.setCores(2);
expectedExecutorSpec.setCoreRequest("100m");
expectedExecutorSpec.setCoreLimit("200m");
expectedExecutorSpec.setMemory("3g");
expectedSparkApplicationSpec.setExecutor(expectedExecutorSpec);
expectedSparkApplicationSpec.setImage("sparkImage:latest");
Expand Down