forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…oj#7067) Signed-off-by: maybaby <[email protected]>
- Loading branch information
1 parent
b05eaa8
commit 5eab921
Showing
12 changed files
with
301 additions
and
101 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# This example demonstrates the 'resource' template type, which provides a | ||
# convenient way to create/update/delete any type of kubernetes resources | ||
# in a workflow. The resource template type accepts any k8s manifest | ||
# (including CRDs) and can perform any kubectl action against it (e.g. create, | ||
# apply, delete, patch). | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: k8s-kubeflow-jobs- | ||
spec: | ||
entrypoint: tf-jobtmpl | ||
templates: | ||
- name: tf-jobtmpl | ||
resource: | ||
action: create | ||
# successCondition and failureCondition are optional expressions which are | ||
# evaluated upon every update of the resource. If failureCondition is ever | ||
# evaluated to true, the step is considered failed. Likewise, if successCondition | ||
# is ever evaluated to true the step is considered successful. It uses kubernetes | ||
# label selection syntax and can be applied against any field of the resource | ||
# (not just labels). Multiple AND conditions can be represented by comma | ||
# delimited expressions. For more details, see: | ||
# https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ | ||
successCondition: status.succeeded = 2 | ||
failureCondition: status.failed > 0 | ||
# You can also create Any other distributed k8s resource here. This is an example | ||
# that using KubeFlow TFJob. See more comment in the below. ↓ | ||
manifest: | | ||
apiVersion: kubeflow.org/v1 | ||
kind: TFJob | ||
metadata: | ||
name: tfjob-examples | ||
spec: | ||
tfReplicaSpecs: | ||
Worker: | ||
replicas: 2 | ||
restartPolicy: Never | ||
template: | ||
metadata: | ||
# This label is important, so that you can use `argo logs -c tensorflow` to see the pod's logs. | ||
# workflow.name is global varaibles that argo support. | ||
# And the TFJob controller crd will automatically add worker pod with some labels ,such as | ||
# job-role, replica-index. then you can use `argo logs -c tensorflow -l replica-index=0` to see | ||
# work-0's podlogs. | ||
# To see detail, please refer to: https://github.com/argoproj/argo-workflows/pull/7067 | ||
labels: | ||
workflows.argoproj.io/workflow: {{workflow.name}} | ||
spec: | ||
containers: | ||
- name: tensorflow | ||
image: "your image here" | ||
# Resource templates can have output parameters extracted from fields of the | ||
# resource. Two techniques are provided: jsonpath and a jq filter. | ||
outputs: | ||
parameters: | ||
# job-name is extracted using a jsonPath expression and is equivalent to: | ||
# `kubectl get job <jobname> -o jsonpath='{.metadata.name}'` | ||
- name: job-name | ||
valueFrom: | ||
jsonPath: '{.metadata.name}' | ||
# job-obj is extracted using a jq filter and is equivalent to: | ||
# `kubectl get job <jobname> -o json | jq -c '.' | ||
# which returns the entire job object in json format | ||
- name: job-obj | ||
valueFrom: | ||
jqFilter: '.' |
Oops, something went wrong.