Skip to content

Commit

Permalink
Merge branch 'main' into remove-causal-ordering-from-task-run-recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
cicdw authored Sep 5, 2024
2 parents 2f53d0f + 76c4323 commit f52cf51
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 58 deletions.
86 changes: 43 additions & 43 deletions docs/3.0/deploy/infrastructure-concepts/prefect-yaml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ deployments:

# infra-specific fields
work_pool:
name: null
work_queue_name: null
job_variables: {}
name: null
work_queue_name: null
job_variables: {}
```
The metadata fields are always pre-populated for you. These fields are for bookkeeping purposes only. The other sections are
Expand Down Expand Up @@ -266,9 +266,9 @@ Below is an example of how to use an existing `GitHubCredentials` block to clone

```yaml
pull:
- prefect.deployments.steps.git_clone:
repository: https://github.com/org/repo.git
credentials: "{{ prefect.blocks.github-credentials.my-credentials }}"
- prefect.deployments.steps.git_clone:
repository: https://github.com/org/repo.git
credentials: "{{ prefect.blocks.github-credentials.my-credentials }}"
```

Alternatively, you can specify a `BitBucketCredentials` or `GitLabCredentials` block to clone from Bitbucket or GitLab. In
Expand All @@ -277,9 +277,9 @@ Use a Secret block to do this securely:

```yaml
pull:
- prefect.deployments.steps.git_clone:
repository: https://bitbucket.org/org/repo.git
access_token: "{{ prefect.blocks.secret.bitbucket-token }}"
- prefect.deployments.steps.git_clone:
repository: https://bitbucket.org/org/repo.git
access_token: "{{ prefect.blocks.secret.bitbucket-token }}"
```

### Utility steps
Expand All @@ -295,15 +295,15 @@ Here is an example of retrieving the short Git commit hash of the current reposi

```yaml
build:
- prefect.deployments.steps.run_shell_script:
id: get-commit-hash
script: git rev-parse --short HEAD
stream_output: false
- prefect_docker.deployments.steps.build_docker_image:
requires: prefect-docker>=0.3.0
image_name: my-image
tag: "{{ get-commit-hash.stdout }}"
dockerfile: auto
- prefect.deployments.steps.run_shell_script:
id: get-commit-hash
script: git rev-parse --short HEAD
stream_output: false
- prefect_docker.deployments.steps.build_docker_image:
requires: prefect-docker>=0.3.0
image_name: my-image
tag: "{{ get-commit-hash.stdout }}"
dockerfile: auto
```

<Warning>
Expand All @@ -328,12 +328,12 @@ Here is an example of installing dependencies from a `requirements.txt` file aft

```yaml
pull:
- prefect.deployments.steps.git_clone:
id: clone-step # needed to be referenced in subsequent steps
repository: https://github.com/org/repo.git
- prefect.deployments.steps.pip_install_requirements:
directory: {{ clone-step.directory }} # `clone-step` is a user-provided `id` field
requirements_file: requirements.txt
- prefect.deployments.steps.git_clone:
id: clone-step # needed to be referenced in subsequent steps
repository: https://github.com/org/repo.git
- prefect.deployments.steps.pip_install_requirements:
directory: "{{ clone-step.directory }}" # `clone-step` is a user-provided `id` field
requirements_file: requirements.txt
```
Here is an example that retrieves an access token from a third party key vault and uses it in a private clone step:
Expand Down Expand Up @@ -394,25 +394,25 @@ build:
deployments:
- # base metadata
name: null
version: "{{ build-image.tag }}"
tags:
- "{{ $my_deployment_tag }}"
- "{{ prefect.variables.some_common_tag }}"
description: null
schedule: null
# flow-specific fields
entrypoint: null
parameters: {}
# infra-specific fields
work_pool:
name: "my-k8s-work-pool"
work_queue_name: null
job_variables:
image: "{{ build-image.image }}"
cluster_config: "{{ prefect.blocks.kubernetes-cluster-config.my-favorite-config }}"
name: null
version: "{{ build-image.tag }}"
tags:
- "{{ $my_deployment_tag }}"
- "{{ prefect.variables.some_common_tag }}"
description: null
schedule: null
# flow-specific fields
entrypoint: null
parameters: {}
# infra-specific fields
work_pool:
name: "my-k8s-work-pool"
work_queue_name: null
job_variables:
image: "{{ build-image.image }}"
cluster_config: "{{ prefect.blocks.kubernetes-cluster-config.my-favorite-config }}"
```

So long as your `build` steps produce fields called `image_name` and `tag`, every time you deploy a new version of our deployment,
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0/deploy/infrastructure-examples/managed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if __name__ == "__main__":
)
```

Alternatively, you can create a `requirements.txt` file and reference it in your `prefect.yaml` `pull_step`.
Alternatively, you can create a `requirements.txt` file and reference it in your [prefect.yaml pull step](/3.0/deploy/infrastructure-concepts/prefect-yaml#utility-steps).

## Limitations

Expand Down
28 changes: 14 additions & 14 deletions tests/utilities/test_callables.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def f(x: Color = "RED"):
"type": "object",
"properties": {
"x": {
"allOf": [{"$ref": "#/definitions/Color"}],
"$ref": "#/definitions/Color",
"default": "RED",
"position": 0,
"title": "x",
Expand Down Expand Up @@ -296,7 +296,7 @@ def f(x: Foo):
},
"properties": {
"x": {
"allOf": [{"$ref": "#/definitions/Foo"}],
"$ref": "#/definitions/Foo",
"title": "x",
"position": 0,
}
Expand Down Expand Up @@ -324,7 +324,7 @@ def f(foo: Foo = Foo(bar="baz")):
"type": "object",
"properties": {
"foo": {
"allOf": [{"$ref": "#/definitions/Foo"}],
"$ref": "#/definitions/Foo",
"default": {"bar": "baz"},
"position": 0,
"title": "foo",
Expand Down Expand Up @@ -409,14 +409,14 @@ def f(
"type": "array",
},
"m": {
"allOf": [{"$ref": "#/definitions/Foo"}],
"$ref": "#/definitions/Foo",
"position": 2,
"title": "m",
},
"i": {"default": 0, "position": 3, "title": "i", "type": "integer"},
"x": {"default": 1.0, "position": 4, "title": "x", "type": "number"},
"model": {
"allOf": [{"$ref": "#/definitions/Foo"}],
"$ref": "#/definitions/Foo",
"default": {"bar": "bar"},
"position": 5,
"title": "model",
Expand All @@ -434,7 +434,7 @@ def f(
"title": "c",
"default": "BLUE",
"position": 9,
"allOf": [{"$ref": "#/definitions/Color"}],
"$ref": "#/definitions/Color",
},
},
"required": ["a", "s", "m"],
Expand Down Expand Up @@ -540,7 +540,7 @@ def h(color: Color = "RED"):
"type": "object",
"properties": {
"color": {
"allOf": [{"$ref": "#/definitions/Color"}],
"$ref": "#/definitions/Color",
"default": "RED",
"position": 0,
"title": "color",
Expand Down Expand Up @@ -1034,7 +1034,7 @@ def f(x: Color = Color.RED):
"type": "object",
"properties": {
"x": {
"allOf": [{"$ref": "#/definitions/Color"}],
"$ref": "#/definitions/Color",
"default": "RED",
"position": 0,
"title": "x",
Expand Down Expand Up @@ -1155,7 +1155,7 @@ def f(x: Foo):
},
"properties": {
"x": {
"allOf": [{"$ref": "#/definitions/Foo"}],
"$ref": "#/definitions/Foo",
"title": "x",
"position": 0,
}
Expand Down Expand Up @@ -1187,7 +1187,7 @@ def f(foo: Foo = Foo(bar="baz")):
"type": "object",
"properties": {
"foo": {
"allOf": [{"$ref": "#/definitions/Foo"}],
"$ref": "#/definitions/Foo",
"default": {"bar": "baz"},
"position": 0,
"title": "foo",
Expand Down Expand Up @@ -1279,14 +1279,14 @@ def f(
"type": "array",
},
"m": {
"allOf": [{"$ref": "#/definitions/Foo"}],
"$ref": "#/definitions/Foo",
"position": 2,
"title": "m",
},
"i": {"default": 0, "position": 3, "title": "i", "type": "integer"},
"x": {"default": 1.0, "position": 4, "title": "x", "type": "number"},
"model": {
"allOf": [{"$ref": "#/definitions/Foo"}],
"$ref": "#/definitions/Foo",
"default": {"bar": "bar"},
"position": 5,
"title": "model",
Expand All @@ -1304,7 +1304,7 @@ def f(
"title": "c",
"default": "BLUE",
"position": 9,
"allOf": [{"$ref": "#/definitions/Color"}],
"$ref": "#/definitions/Color",
},
},
"required": ["a", "s", "m"],
Expand Down Expand Up @@ -1504,7 +1504,7 @@ def f(
"type": "object",
"properties": {
"param": {
"allOf": [{"$ref": "#/definitions/MyModel"}],
"$ref": "#/definitions/MyModel",
"position": 0,
"title": "param",
}
Expand Down

0 comments on commit f52cf51

Please sign in to comment.