You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "Store settings for interacting with a Docker host. This block is part of the prefect-docker collection. Install prefect-docker with `pip install prefect-docker` to use this block.",
10
+
"code_example": "Get a Docker Host client.\n```python\nfrom prefect_docker import DockerHost\n\ndocker_host = DockerHost(\nbase_url=\"tcp://127.0.0.1:1234\",\n max_pool_size=4\n)\nwith docker_host.get_client() as client:\n ... # Use the client for Docker operations\n```",
"description": "Store credentials for interacting with a Docker Registry. This block is part of the prefect-docker collection. Install prefect-docker with `pip install prefect-docker` to use this block.",
60
+
"code_example": "Log into Docker Registry.\n```python\nfrom prefect_docker import DockerHost, DockerRegistryCredentials\n\ndocker_host = DockerHost()\ndocker_registry_credentials = DockerRegistryCredentials(\n username=\"my_username\",\n password=\"my_password\",\n registry_url=\"registry.hub.docker.com\",\n)\nwith docker_host.get_client() as client:\n docker_registry_credentials.login(client)\n```",
"description": "Configuration class used by the Docker worker.\n\nAn instance of this class is passed to the Docker worker's `run` method\nfor each flow run. It contains all the information necessary to execute the\nflow run as a Docker container.\n\nAttributes:\n name: The name to give to created Docker containers.\n command: The command executed in created Docker containers to kick off\n flow run execution.\n env: The environment variables to set in created Docker containers.\n labels: The labels to set on created Docker containers.\n image: The image reference of a container image to use for created jobs.\n If not set, the latest Prefect image will be used.\n image_pull_policy: The image pull policy to use when pulling images.\n networks: Docker networks that created containers should be connected to.\n network_mode: The network mode for the created containers (e.g. host, bridge).\n If 'networks' is set, this cannot be set.\n auto_remove: If set, containers will be deleted on completion.\n volumes: Docker volumes that should be mounted in created containers.\n stream_output: If set, the output from created containers will be streamed\n to local standard output.\n mem_limit: Memory limit of created containers. Accepts a value\n with a unit identifier (e.g. 100000b, 1000k, 128m, 1g.) If a value is\n given without a unit, bytes are assumed.\n memswap_limit: Total memory (memory + swap), -1 to disable swap. Should only be\n set if `mem_limit` is also set. If `mem_limit` is set, this defaults to\n allowing the container to use as much swap as memory. For example, if\n `mem_limit` is 300m and `memswap_limit` is not set, containers can use\n 600m in total of memory and swap.\n privileged: Give extended privileges to created containers.",
24
+
"type": "object",
25
+
"properties": {
26
+
"command": {
27
+
"title": "Command",
28
+
"description": "The command to use when starting a flow run. In most cases, this should be left blank and the command will be automatically generated by the worker.",
29
+
"type": "string"
30
+
},
31
+
"env": {
32
+
"title": "Environment Variables",
33
+
"description": "Environment variables to set when starting a flow run.",
34
+
"type": "object",
35
+
"additionalProperties": {
36
+
"type": "string"
37
+
}
38
+
},
39
+
"labels": {
40
+
"title": "Labels",
41
+
"description": "Labels applied to infrastructure created by the worker using this job configuration.",
42
+
"type": "object",
43
+
"additionalProperties": {
44
+
"type": "string"
45
+
}
46
+
},
47
+
"name": {
48
+
"title": "Name",
49
+
"description": "Name given to infrastructure created by the worker using this job configuration.",
50
+
"type": "string"
51
+
},
52
+
"image": {
53
+
"title": "Image",
54
+
"description": "The image reference of a container image to use for created jobs. If not set, the latest Prefect image will be used.",
"description": "Credentials for logging into a Docker registry to pull images from.",
61
+
"allOf": [
62
+
{
63
+
"$ref": "#/definitions/DockerRegistryCredentials"
64
+
}
65
+
]
66
+
},
67
+
"image_pull_policy": {
68
+
"title": "Image Pull Policy",
69
+
"description": "The image pull policy to use when pulling images.",
70
+
"enum": [
71
+
"IfNotPresent",
72
+
"Always",
73
+
"Never"
74
+
],
75
+
"type": "string"
76
+
},
77
+
"networks": {
78
+
"title": "Networks",
79
+
"description": "Docker networks that created containers should be connected to.",
80
+
"type": "array",
81
+
"items": {
82
+
"type": "string"
83
+
}
84
+
},
85
+
"network_mode": {
86
+
"title": "Network Mode",
87
+
"description": "The network mode for the created containers (e.g. host, bridge). If 'networks' is set, this cannot be set.",
88
+
"type": "string"
89
+
},
90
+
"auto_remove": {
91
+
"title": "Auto Remove",
92
+
"description": "If set, containers will be deleted on completion.",
93
+
"default": false,
94
+
"type": "boolean"
95
+
},
96
+
"volumes": {
97
+
"title": "Volumes",
98
+
"description": "A list of volume to mount into created containers.",
99
+
"example": [
100
+
"/my/local/path:/path/in/container"
101
+
],
102
+
"type": "array",
103
+
"items": {
104
+
"type": "string"
105
+
}
106
+
},
107
+
"stream_output": {
108
+
"title": "Stream Output",
109
+
"description": "If set, the output from created containers will be streamed to local standard output.",
110
+
"default": true,
111
+
"type": "boolean"
112
+
},
113
+
"mem_limit": {
114
+
"title": "Memory Limit",
115
+
"description": "Memory limit of created containers. Accepts a value with a unit identifier (e.g. 100000b, 1000k, 128m, 1g.) If a value is given without a unit, bytes are assumed.",
116
+
"type": "string"
117
+
},
118
+
"memswap_limit": {
119
+
"title": "Memory Swap Limit",
120
+
"description": "Total memory (memory + swap), -1 to disable swap. Should only be set if `mem_limit` is also set. If `mem_limit` is set, this defaults toallowing the container to use as much swap as memory. For example, if `mem_limit` is 300m and `memswap_limit` is not set, containers can use 600m in total of memory and swap.",
121
+
"type": "string"
122
+
},
123
+
"privileged": {
124
+
"title": "Privileged",
125
+
"description": "Give extended privileges to created container.",
126
+
"default": false,
127
+
"type": "boolean"
128
+
}
129
+
},
130
+
"definitions": {
131
+
"DockerRegistryCredentials": {
132
+
"title": "DockerRegistryCredentials",
133
+
"description": "Store credentials for interacting with a Docker Registry.",
134
+
"type": "object",
135
+
"properties": {
136
+
"username": {
137
+
"title": "Username",
138
+
"description": "The username to log into the registry with.",
139
+
"type": "string"
140
+
},
141
+
"password": {
142
+
"title": "Password",
143
+
"description": "The password to log into the registry with.",
144
+
"type": "string",
145
+
"writeOnly": true,
146
+
"format": "password"
147
+
},
148
+
"registry_url": {
149
+
"title": "Registry Url",
150
+
"description": "The URL to the registry. Generally, \"http\" or \"https\" can be omitted.",
151
+
"example": "index.docker.io",
152
+
"type": "string"
153
+
},
154
+
"reauth": {
155
+
"title": "Reauth",
156
+
"description": "Whether or not to reauthenticate on each interaction.",
157
+
"default": true,
158
+
"type": "boolean"
159
+
}
160
+
},
161
+
"required": [
162
+
"username",
163
+
"password",
164
+
"registry_url"
165
+
],
166
+
"block_type_slug": "docker-registry-credentials",
167
+
"secret_fields": [
168
+
"password"
169
+
],
170
+
"block_schema_references": {}
171
+
}
172
+
}
173
+
}
174
+
},
175
+
"description": "Execute flow runs within Docker containers. Works well for managing flow execution environments via Docker images. Requires access to a running Docker daemon.",
"description": "Credentials block for generating configured Kubernetes API clients. This block is part of the prefect-kubernetes collection. Install prefect-kubernetes with `pip install prefect-kubernetes` to use this block.",
0 commit comments