File tree 15 files changed +24
-8
lines changed
docs/examples/workflows/misc
15 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 16
16
Workflow,
17
17
)
18
18
19
- with Workflow(generate_name="data-") as w:
19
+ with Workflow(generate_name="data-", entrypoint="list-log-files" ) as w:
20
20
Data(
21
21
name="list-log-files",
22
22
source=S3Artifact(name="test-bucket", bucket="my-bucket"),
33
33
metadata:
34
34
generateName: data-
35
35
spec:
36
+ entrypoint: list-log-files
36
37
templates:
37
38
- data:
38
39
source:
Original file line number Diff line number Diff line change 21
21
22
22
with Workflow(generate_name="secret-env-from-", entrypoint="whalesay") as w:
23
23
whalesay = Container(
24
+ name="whalesay",
24
25
image="docker/whalesay:latest",
25
26
command=["cowsay"],
26
27
env_from=[
76
77
optional: false
77
78
prefix: abc
78
79
image: docker/whalesay:latest
80
+ name: whalesay
79
81
```
80
82
Original file line number Diff line number Diff line change 12
12
13
13
with Workflow(generate_name="secret-env-from-", entrypoint="whalesay") as w:
14
14
whalesay = Container(
15
+ name="whalesay",
15
16
image="docker/whalesay:latest",
16
17
command=["cowsay"],
17
18
env_from=[
44
45
optional: false
45
46
prefix: abc
46
47
image: docker/whalesay:latest
48
+ name: whalesay
47
49
```
48
50
Original file line number Diff line number Diff line change 11
11
from hera.expr import g
12
12
from hera.workflows import HTTP, Parameter, Workflow
13
13
14
- with Workflow(generate_name="http-") as w:
14
+ with Workflow(generate_name="http-", entrypoint="http" ) as w:
15
15
HTTP(
16
16
name="http",
17
- inputs=[Parameter(name="url")],
17
+ inputs=[Parameter(name="url", value="https://example.com" )],
18
18
timeout_seconds=20,
19
19
url=f"{g.inputs.parameters.url:$}",
20
20
method="GET",
32
32
metadata:
33
33
generateName: http-
34
34
spec:
35
+ entrypoint: http
35
36
templates:
36
37
- http:
37
38
body: test body
45
46
inputs:
46
47
parameters:
47
48
- name: url
49
+ value: https://example.com
48
50
name: http
49
51
```
50
52
Original file line number Diff line number Diff line change 10
10
```python linenums="1"
11
11
from hera.workflows import Parameter, Suspend, Workflow
12
12
13
- with Workflow(generate_name="suspend-") as w:
13
+ with Workflow(generate_name="suspend-", entrypoint="suspend-without-duration" ) as w:
14
14
Suspend(name="suspend-without-duration")
15
15
Suspend(name="suspend-with-duration", duration=30)
16
16
Suspend(
31
31
metadata:
32
32
generateName: suspend-
33
33
spec:
34
+ entrypoint: suspend-without-duration
34
35
templates:
35
36
- name: suspend-without-duration
36
37
suspend: {}
Original file line number Diff line number Diff line change 6
6
Workflow ,
7
7
)
8
8
9
- with Workflow (generate_name = "data-" ) as w :
9
+ with Workflow (generate_name = "data-" , entrypoint = "list-log-files" ) as w :
10
10
Data (
11
11
name = "list-log-files" ,
12
12
source = S3Artifact (name = "test-bucket" , bucket = "my-bucket" ),
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ kind: Workflow
3
3
metadata :
4
4
generateName : data-
5
5
spec :
6
+ entrypoint : list-log-files
6
7
templates :
7
8
- data :
8
9
source :
Original file line number Diff line number Diff line change 18
18
optional : false
19
19
prefix : abc
20
20
image : docker/whalesay:latest
21
+ name : whalesay
Original file line number Diff line number Diff line change 11
11
12
12
with Workflow (generate_name = "secret-env-from-" , entrypoint = "whalesay" ) as w :
13
13
whalesay = Container (
14
+ name = "whalesay" ,
14
15
image = "docker/whalesay:latest" ,
15
16
command = ["cowsay" ],
16
17
env_from = [
Original file line number Diff line number Diff line change 35
35
optional : false
36
36
prefix : abc
37
37
image : docker/whalesay:latest
38
+ name : whalesay
Original file line number Diff line number Diff line change 2
2
3
3
with Workflow (generate_name = "secret-env-from-" , entrypoint = "whalesay" ) as w :
4
4
whalesay = Container (
5
+ name = "whalesay" ,
5
6
image = "docker/whalesay:latest" ,
6
7
command = ["cowsay" ],
7
8
env_from = [
Original file line number Diff line number Diff line change 1
1
from hera .expr import g
2
2
from hera .workflows import HTTP , Parameter , Workflow
3
3
4
- with Workflow (generate_name = "http-" ) as w :
4
+ with Workflow (generate_name = "http-" , entrypoint = "http" ) as w :
5
5
HTTP (
6
6
name = "http" ,
7
- inputs = [Parameter (name = "url" )],
7
+ inputs = [Parameter (name = "url" , value = "https://example.com" )],
8
8
timeout_seconds = 20 ,
9
9
url = f"{ g .inputs .parameters .url :$} " ,
10
10
method = "GET" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ kind: Workflow
3
3
metadata :
4
4
generateName : http-
5
5
spec :
6
+ entrypoint : http
6
7
templates :
7
8
- http :
8
9
body : test body
16
17
inputs :
17
18
parameters :
18
19
- name : url
20
+ value : https://example.com
19
21
name : http
Original file line number Diff line number Diff line change 1
1
from hera .workflows import Parameter , Suspend , Workflow
2
2
3
- with Workflow (generate_name = "suspend-" ) as w :
3
+ with Workflow (generate_name = "suspend-" , entrypoint = "suspend-without-duration" ) as w :
4
4
Suspend (name = "suspend-without-duration" )
5
5
Suspend (name = "suspend-with-duration" , duration = 30 )
6
6
Suspend (
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ kind: Workflow
3
3
metadata :
4
4
generateName : suspend-
5
5
spec :
6
+ entrypoint : suspend-without-duration
6
7
templates :
7
8
- name : suspend-without-duration
8
9
suspend : {}
You can’t perform that action at this time.
0 commit comments