Skip to content

Commit

Permalink
fix: fix wrong type in runnables written by runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-s committed Jul 19, 2024
1 parent 8929233 commit 0d3d950
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public R delete(@NotNull Run run) {
}

log.warn("Error deleting run {}", run.getId());
throw new NoSuchEntityException("Error deleting run");
throw new NoSuchEntityException("run");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import it.smartcommunitylabdhub.framework.kaniko.runnables.K8sKanikoRunnable;
import it.smartcommunitylabdhub.runtime.container.ContainerRuntime;
import it.smartcommunitylabdhub.runtime.container.specs.ContainerBuildTaskSpec;
import it.smartcommunitylabdhub.runtime.container.specs.ContainerDeployTaskSpec;
import it.smartcommunitylabdhub.runtime.container.specs.ContainerFunctionSpec;
import it.smartcommunitylabdhub.runtime.container.specs.ContainerFunctionSpec.SourceCodeLanguages;
import it.smartcommunitylabdhub.runtime.container.specs.ContainerRunSpec;
Expand Down Expand Up @@ -47,8 +48,6 @@ public class ContainerBuildRunner implements Runner<K8sKanikoRunnable> {
private static final String RUN_DEBUG =
"PWD=`pwd`;echo \"DEBUG: dir ${PWD}\";LS=`ls -R`;echo \"DEBUG: dir content:\" && echo \"${LS}\";";

private static final String TASK = "job";

private final ContainerFunctionSpec functionSpec;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -143,7 +142,7 @@ public K8sKanikoRunnable produce(Run run) {
.id(run.getId())
.project(run.getProject())
.runtime(ContainerRuntime.RUNTIME)
.task(TASK)
.task(ContainerDeployTaskSpec.KIND)
.state(State.READY.name())
.labels(
k8sBuilderHelper != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
*/
public class ContainerDeployRunner implements Runner<K8sDeploymentRunnable> {

private static final String TASK = "deploy";

private final ContainerFunctionSpec functionSpec;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -63,7 +61,7 @@ public K8sDeploymentRunnable produce(Run run) {
K8sDeploymentRunnable k8sDeploymentRunnable = K8sDeploymentRunnable
.builder()
.runtime(ContainerRuntime.RUNTIME)
.task(TASK)
.task(ContainerDeployTaskSpec.KIND)
.state(State.READY.name())
.labels(
k8sBuilderHelper != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
*/
public class ContainerJobRunner implements Runner<K8sRunnable> {

private static final String TASK = "job";

private final ContainerFunctionSpec functionSpec;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -66,7 +64,7 @@ public K8sRunnable produce(Run run) {
K8sRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(ContainerRuntime.RUNTIME)
.task(TASK)
.task(ContainerJobTaskSpec.KIND)
.state(State.READY.name())
.labels(
k8sBuilderHelper != null
Expand Down Expand Up @@ -96,7 +94,7 @@ public K8sRunnable produce(Run run) {
K8sCronJobRunnable
.builder()
.runtime(ContainerRuntime.RUNTIME)
.task(TASK)
.task(ContainerJobTaskSpec.KIND)
.state(State.READY.name())
//base
.image(functionSpec.getImage())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
*/
public class ContainerServeRunner implements Runner<K8sServeRunnable> {

private static final String TASK = "serve";

private final ContainerFunctionSpec functionSpec;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -63,7 +61,7 @@ public K8sServeRunnable produce(Run run) {
K8sServeRunnable k8sServeRunnable = K8sServeRunnable
.builder()
.runtime(ContainerRuntime.RUNTIME)
.task(TASK)
.task(ContainerServeTaskSpec.KIND)
.state(State.READY.name())
.labels(
k8sBuilderHelper != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
*/
public class DbtTransformRunner implements Runner<K8sJobRunnable> {

private static final String TASK = "transform";

private final String image;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -54,7 +52,7 @@ public K8sJobRunnable produce(Run run) {
K8sJobRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(DbtRuntime.RUNTIME)
.task(TASK)
.task(DbtTransformSpec.KIND)
.image(image)
.command("python")
.args(List.of("wrapper.py").toArray(String[]::new))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
*/
public class KFPPipelineRunner implements Runner<K8sRunnable> {

private static final String TASK = "pipeline";

private final String image;
private final Map<String, Set<String>> groupedSecrets;

Expand All @@ -55,7 +53,7 @@ public K8sRunnable produce(Run run) {
K8sRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(KFPRuntime.RUNTIME)
.task(TASK)
.task(KFPPipelineTaskSpec.KIND)
.image(image)
.command("python")
.args(List.of("wrapper.py").toArray(String[]::new))
Expand All @@ -75,7 +73,7 @@ public K8sRunnable produce(Run run) {
K8sCronJobRunnable
.builder()
.runtime(KFPRuntime.RUNTIME)
.task(TASK)
.task(KFPPipelineTaskSpec.KIND)
//base
.image(image)
.command("python")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class MlrunBuildRunner implements Runner<K8sJobRunnable> {

private static final String TASK = "build";
private final String image;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -53,7 +52,7 @@ public K8sJobRunnable produce(Run run) {
K8sJobRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(MlrunRuntime.RUNTIME)
.task(TASK)
.task(MlrunBuildTaskSpec.KIND)
.image(image)
.command("python")
.args(List.of("wrapper.py").toArray(String[]::new))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class MlrunJobRunner implements Runner<K8sJobRunnable> {

private static final String TASK = "job";
private final String image;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -53,7 +52,7 @@ public K8sJobRunnable produce(Run run) {
K8sJobRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(MlrunRuntime.RUNTIME)
.task(TASK)
.task(MlrunJobTaskSpec.KIND)
.image(image)
.command("python")
.args(List.of("wrapper.py").toArray(String[]::new))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class NefertemInferRunner implements Runner<K8sJobRunnable> {

private static final String TASK = "infer";
private final String image;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -53,7 +52,7 @@ public K8sJobRunnable produce(Run run) {
K8sJobRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(NefertemRuntime.RUNTIME)
.task(TASK)
.task(NefertemInferTaskSpec.KIND)
.image(image)
.command("python")
.args(List.of("wrapper.py").toArray(String[]::new))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class NefertemMetricRunner implements Runner<K8sJobRunnable> {

private static final String TASK = "metric";
private final String image;

private final Map<String, Set<String>> groupedSecrets;
Expand Down Expand Up @@ -54,7 +53,7 @@ public K8sJobRunnable produce(Run run) {
K8sJobRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(NefertemRuntime.RUNTIME)
.task(TASK)
.task(NefertemMetricTaskSpec.KIND)
.image(image)
.command("python")
.args(List.of("wrapper.py").toArray(String[]::new))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class NefertemProfileRunner implements Runner<K8sJobRunnable> {

private static final String TASK = "profile";
private final String image;

private final Map<String, Set<String>> groupedSecrets;
Expand Down Expand Up @@ -54,7 +53,7 @@ public K8sJobRunnable produce(Run run) {
K8sJobRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(NefertemRuntime.RUNTIME)
.task(TASK)
.task(NefertemProfileTaskSpec.KIND)
.image(image)
.command("python")
.args(List.of("wrapper.py").toArray(String[]::new))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
public class NefertemValidateRunner implements Runner<K8sJobRunnable> {

private static final String TASK = "validate";
private final String image;
private final Map<String, Set<String>> groupedSecrets;

Expand Down Expand Up @@ -53,7 +52,7 @@ public K8sJobRunnable produce(Run run) {
K8sJobRunnable k8sJobRunnable = K8sJobRunnable
.builder()
.runtime(NefertemRuntime.RUNTIME)
.task(TASK)
.task(NefertemValidateTaskSpec.KIND)
.image(image)
.command("python")
.args(List.of("wrapper.py").toArray(String[]::new))
Expand Down

0 comments on commit 0d3d950

Please sign in to comment.