-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/maven/com.google.guava-guava-32…
….0.0-jre
- Loading branch information
Showing
34 changed files
with
367 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
flytekit-api/src/main/java/org/flyte/api/v1/OnFailurePolicy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2021 Flyte Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.flyte.api.v1; | ||
|
||
import com.google.auto.value.AutoValue; | ||
|
||
/** Failure Handling Strategy. */ | ||
@AutoValue | ||
public abstract class OnFailurePolicy { | ||
public enum Kind { | ||
FAIL_IMMEDIATELY, | ||
FAIL_AFTER_EXECUTABLE_NODES_COMPLETE | ||
} | ||
|
||
public abstract Kind getKind(); | ||
|
||
public static OnFailurePolicy.Builder builder() { | ||
return new AutoValue_OnFailurePolicy.Builder(); | ||
} | ||
|
||
@AutoValue.Builder | ||
public abstract static class Builder { | ||
public abstract Builder kind(Kind kind); | ||
|
||
public abstract OnFailurePolicy build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
flytekit-examples/src/main/java/org/flyte/examples/SumWorkflow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2021 Flyte Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.flyte.examples; | ||
|
||
import com.google.auto.service.AutoService; | ||
import com.google.auto.value.AutoValue; | ||
import org.flyte.flytekit.SdkBindingData; | ||
import org.flyte.flytekit.SdkWorkflow; | ||
import org.flyte.flytekit.SdkWorkflowBuilder; | ||
import org.flyte.flytekit.jackson.Description; | ||
import org.flyte.flytekit.jackson.JacksonSdkType; | ||
|
||
@AutoService(SdkWorkflow.class) | ||
public class SumWorkflow extends SdkWorkflow<SumWorkflow.Input, SumWorkflow.Output> { | ||
|
||
public SumWorkflow() { | ||
super(JacksonSdkType.of(SumWorkflow.Input.class), JacksonSdkType.of(SumWorkflow.Output.class)); | ||
} | ||
|
||
@Override | ||
public Output expand(SdkWorkflowBuilder builder, Input input) { | ||
SdkBindingData<Long> result = | ||
builder | ||
.apply("sum", new SumTask(), SumTask.SumInput.create(input.left(), input.right())) | ||
.getOutputs(); | ||
return Output.create(result); | ||
} | ||
|
||
// Used in testing to mock this workflow | ||
@AutoValue | ||
public abstract static class Input { | ||
@Description("First operand") | ||
abstract SdkBindingData<Long> left(); | ||
|
||
@Description("Second operand") | ||
abstract SdkBindingData<Long> right(); | ||
|
||
public static Input create(SdkBindingData<Long> left, SdkBindingData<Long> right) { | ||
return new AutoValue_SumWorkflow_Input(left, right); | ||
} | ||
} | ||
|
||
@AutoValue | ||
public abstract static class Output { | ||
@Description("Summed results") | ||
abstract SdkBindingData<Long> result(); | ||
|
||
public static Output create(SdkBindingData<Long> result) { | ||
return new AutoValue_SumWorkflow_Output(result); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.