Simonas Jakubonis
05/29/2024, 7:23 AMChris Guidry
05/29/2024, 1:18 PM$ docker image ls prefecthq/prefect:2.19*
REPOSITORY TAG IMAGE ID CREATED SIZE
prefecthq/prefect 2.19.2-python3.12 b8d1dcb5eb14 5 days ago 671MB
I'm on an amd64 architecture here, how about you?Simonas Jakubonis
05/29/2024, 1:19 PMSimonas Jakubonis
05/29/2024, 1:19 PMSimonas Jakubonis
05/29/2024, 1:19 PMChris Guidry
05/29/2024, 1:22 PMdocker image inspect prefecthq/prefect:2.19.2-python3.12
from your system?Simonas Jakubonis
05/29/2024, 1:27 PMdocker image inspect prefecthq/prefect:2.19.2-python3.12
[
{
"Id": "sha256:320e98a341628635b59f3a15533d49ba7eb1f95995a4f04051b3e39a5e0f0ebd",
"RepoTags": [
"prefecthq/prefect:2.19.2-python3.12"
],
"RepoDigests": [
"prefecthq/prefect@sha256:320e98a341628635b59f3a15533d49ba7eb1f95995a4f04051b3e39a5e0f0ebd"
],
"Parent": "",
"Comment": "buildkit.dockerfile.v0",
"Created": "2024-05-23T20:42:43.418121443Z",
"ContainerConfig": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": null,
"Cmd": null,
"Image": "",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": null
},
"DockerVersion": "26.1.1",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"GPG_KEY=7169605F62C751356D054A26A821E680E5FA6305",
"PYTHON_VERSION=3.12.3",
"PYTHON_PIP_VERSION=24.0",
"PYTHON_GET_PIP_URL=<https://github.com/pypa/get-pip/raw/dbf0c85f76fb6e1ab42aa672ffca6f0a675d9ee4/public/get-pip.py>",
"PYTHON_GET_PIP_SHA256=dfe9fd5c28dc98b5ac17979a953ea550cec37ae1b47a5116007395bfacff2ab9",
"LC_ALL=C.UTF-8"
],
"Cmd": null,
"ArgsEscaped": true,
"Image": "",
"Volumes": null,
"WorkingDir": "/opt/prefect",
"Entrypoint": [
"/usr/bin/tini",
"-g",
"--",
"/opt/prefect/entrypoint.sh"
],
"OnBuild": null,
"Labels": {
"io.prefect.python-version": "3.12.3",
"maintainer": "<mailto:help@prefect.io|help@prefect.io>",
"org.label-schema.name": "prefect",
"org.label-schema.schema-version": "= 1.0",
"org.label-schema.url": "<https://www.prefect.io/>"
}
},
"Architecture": "arm64",
"Os": "linux",
"Size": 217847620,
"GraphDriver": {
"Data": null,
"Name": "stargz"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:2bd1a2222589b50b52ff960c3d004829633df61532e7a670a91618cd775f2d47",
"sha256:e8a6046370e74bc223a160c93d52211667439f18cc90cdfb0243d4a632db90b9",
"sha256:291b21563fd4c6487c270c885bbad3515be769561455e67ed0b60d96743ecf25",
"sha256:9e14e2775382594c54bb6e3583819618f40825b2c43d6d1722981d1513170801",
"sha256:ab71a4ac32c1efb2b57a9b3e636ed0b97253f0ff4a86df74dca409d9d8edc779",
"sha256:73ade58fd89b151b8a1360023d6e11d514a7b58fc736ab758efc16bceb61f70a",
"sha256:de3f65ae0c8789df3f7ea17c4fb0a21a9f1e46b8e302c9f7a138360a1661354c",
"sha256:27af10708daedcc3b0c1e80dfb31b782f499b86ca744c744bbf98a8092b4c624",
"sha256:3dff399ad379f60e361cf66534532a14ce598f2a8264625948b4bdef92c2ee2e",
"sha256:80b301eda11b72c7f8c6d072be5afac76a8ac2828d8995b326839f5f7a4da46a",
"sha256:b1f72ce46c6550de5ae3f915850a287479fce5edd28cc1dc62229353b32683da",
"sha256:5afb03f61dc7ac1a10d8790c70aab9f6f4b57c9652915395b43f1941e6033ee9",
"sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
"sha256:31b2e017b279e85f52506ea19e8dd3d59d61a48b3c977f09b0bb8dcc431e3f20",
"sha256:8cea6e634d67cf684036292c2c5b66e403f8ec634cab5324f6373e34c8332d8c"
]
},
"Metadata": {
"LastTagTime": "2024-05-29T09:39:58.851620918Z"
},
"Container": ""
}
Chris Guidry
05/29/2024, 1:30 PMChris Guidry
05/29/2024, 1:32 PM$ docker image ls prefecthq/prefect
REPOSITORY TAG IMAGE ID CREATED SIZE
prefecthq/prefect 2.19.2-python3.12 5b0d9b3e4d7b 5 days ago 678MB
prefecthq/prefect <none> b8d1dcb5eb14 5 days ago 671MB
That's very surprising. I'll consult with some colleagues on Mac m1s to see what they're gettingSimonas Jakubonis
05/29/2024, 1:36 PMChris Guidry
05/29/2024, 1:38 PM"Size": 217847620,
But your docker image ls
output shows 2GB? That's oddSimonas Jakubonis
05/29/2024, 1:39 PMChris Guidry
05/29/2024, 1:46 PMSimonas Jakubonis
05/29/2024, 1:47 PMdocker --version
Docker version 26.1.1, build 4cf5afa
Chris Guidry
05/29/2024, 1:48 PMChris Guidry
05/29/2024, 1:51 PMamd64
and arm64
. My colleague on an M1 is also seeing the same results. Are you pulling from a different registry than the public Docker index?Chris Guidry
05/29/2024, 1:54 PMdocker image ls
for some reason? What it's showing there doesn't agree with the Size
from your docker image inspect
output either ๐คSimonas Jakubonis
05/29/2024, 1:57 PMSimonas Jakubonis
05/29/2024, 1:57 PMChris Guidry
05/29/2024, 2:00 PM$ docker pull python:3.12 && docker image ls python:3.12
Here's what I get:
$ docker pull python:3.12 && docker image ls python:3.12
3.12: Pulling from library/python
c6cf28de8a06: Pull complete
891494355808: Pull complete
6582c62583ef: Pull complete
bf2c3e352f3d: Pull complete
a99509a32390: Pull complete
d46a03def8d9: Pull complete
4429b810e09e: Pull complete
2a4ca5af09fa: Pull complete
Digest: sha256:3966b81808d864099f802080d897cef36c01550472ab3955fdd716d1c665acd6
Status: Downloaded newer image for python:3.12
<http://docker.io/library/python:3.12|docker.io/library/python:3.12>
REPOSITORY TAG IMAGE ID CREATED SIZE
python 3.12 12e5ab9d51c8 7 weeks ago 1.02GB
Chris Guidry
05/29/2024, 2:00 PM-slim
variant:
$ docker pull python:3.12-slim && docker image ls python:3.12-slim
3.12-slim: Pulling from library/python
09f376ebb190: Already exists
276709cbedc1: Already exists
2e133733af76: Already exists
ded8879d9a79: Already exists
3cf9507408dc: Already exists
Digest: sha256:afc139a0a640942491ec481ad8dda10f2c5b753f5c969393b12480155fe15a63
Status: Downloaded newer image for python:3.12-slim
<http://docker.io/library/python:3.12-slim|docker.io/library/python:3.12-slim>
REPOSITORY TAG IMAGE ID CREATED SIZE
python 3.12-slim cf001c2f8af7 7 weeks ago 130MB
Simonas Jakubonis
05/29/2024, 2:01 PMChris Guidry
05/29/2024, 2:02 PM-slim
variation too?Simonas Jakubonis
05/29/2024, 2:02 PMdocker pull python:3.12-slim && docker image ls python:3.12-slim
3.12-slim: Pulling from library/python
Digest: sha256:afc139a0a640942491ec481ad8dda10f2c5b753f5c969393b12480155fe15a63
Status: Downloaded newer image for python:3.12-slim
<http://docker.io/library/python:3.12-slim|docker.io/library/python:3.12-slim>
What's Next?
View a summary of image vulnerabilities and recommendations โ docker scout quickview python:3.12-slim
REPOSITORY TAG IMAGE ID CREATED SIZE
python 3.12-slim afc139a0a640 7 weeks ago 221MB
Chris Guidry
05/29/2024, 2:02 PMSimonas Jakubonis
05/29/2024, 2:03 PMChris Guidry
05/29/2024, 2:05 PMSimonas Jakubonis
05/29/2024, 2:06 PMChris Guidry
05/29/2024, 2:07 PMChris Guidry
05/29/2024, 2:09 PMtzdata
package: https://pkgs.alpinelinux.org/package/edge/main/x86/tzdataSimonas Jakubonis
05/29/2024, 2:13 PM# Generic metadata about this project
name: super-research
prefect-version: 2.19.2
# pull section allows you to provide instructions for cloning this project in remote locations
pull:
- prefect.deployments.steps.set_working_directory:
directory: /app
# the definitions section allows you to define reusable components for your deployments
definitions:
tags: &common_tags
- eks
- '{{ get-commit-hash.stdout }}'
work_pool: &common_work_pool
name: test-worker-pool
job_variables:
image: '{{ $IMAGE_URI }}'
# the deployments section allows you to provide configuration for deploying flows
deployments:
- name: run_agent
tags: *common_tags
entrypoint: src/research/services/agents/base.py:run_agent
work_pool: *common_work_pool
version:
description:
parameters: {}
schedules: []
and run_agent
function with @flow
decorator should trigger the k8s job? However, I saw that it was not triggered in the k8s worker. Is it possible that it ran on prefect cloud , but not on k8s worker?Simonas Jakubonis
05/29/2024, 2:15 PMSimonas Jakubonis
05/29/2024, 2:16 PMChris Guidry
05/29/2024, 2:22 PMrun_agent
as a regular Python function, then that flow will just run locally within that same process:
@flow
def my_flow():
print('hello')
def my_other_application():
my_flow()
If this is what's happening, then the flow will run in the process of your application.
If you want to trigger the deployment, try this:
from prefect.deployments import run_deployment
def my_other_application():
run_deployment(name="my_flow/my_deployment")
Simonas Jakubonis
05/29/2024, 3:06 PMSimonas Jakubonis
05/29/2024, 3:10 PMChris Guidry
05/29/2024, 3:11 PMSimonas Jakubonis
05/29/2024, 3:13 PMrun_deployment(name="my_flow_name/my_deployment_name")
api call -> payload -> worker -> processingChris Guidry
05/29/2024, 3:14 PMrun_deployment(name="...", parameters={"hello": "world"})
Simonas Jakubonis
05/29/2024, 3:14 PMChris Guidry
05/29/2024, 3:14 PMasync def run_deployment(
name: Union[str, UUID],
client: Optional["PrefectClient"] = None,
parameters: Optional[dict] = None,
scheduled_time: Optional[datetime] = None,
flow_run_name: Optional[str] = None,
timeout: Optional[float] = None,
poll_interval: Optional[float] = 5,
tags: Optional[Iterable[str]] = None,
idempotency_key: Optional[str] = None,
work_queue_name: Optional[str] = None,
as_subflow: Optional[bool] = True,
infra_overrides: Optional[dict] = None,
job_variables: Optional[dict] = None,
) -> "FlowRun":
Simonas Jakubonis
05/30/2024, 1:54 PMenvFrom:
-
secretRef:
name: app-secrets -
configMapRef:
name: app-envs
Simonas Jakubonis
05/30/2024, 1:55 PMChris Guidry
05/30/2024, 1:58 PMSimonas Jakubonis
05/30/2024, 2:01 PMprefect-worker/templates/deployment.yaml
with new env and secrets it should propagate them to the job, right?Simonas Jakubonis
05/30/2024, 2:02 PMChris Guidry
05/30/2024, 2:04 PMSimonas Jakubonis
05/30/2024, 2:04 PMSimonas Jakubonis
05/30/2024, 2:04 PMChris Guidry
05/30/2024, 2:05 PMSimonas Jakubonis
05/30/2024, 2:05 PMSimonas Jakubonis
05/30/2024, 2:06 PMChris Guidry
05/30/2024, 2:07 PMSimonas Jakubonis
05/30/2024, 2:13 PMChris Guidry
05/30/2024, 2:15 PMAdvanced
tab in the UI, you can modify the entire job manifest for the work pool (this will apply to every job that's created to run a flow), and you can also do this via the API if you want to modify this during a CI processChris Guidry
05/30/2024, 2:15 PMjob_variables
which are per-flow-run adjustments you can make to the job template as wellSimonas Jakubonis
05/30/2024, 2:16 PMSimonas Jakubonis
05/30/2024, 2:23 PMprefect work-pool update --base-job-template base-job-template.json my-work-pool
Simonas Jakubonis
05/30/2024, 2:23 PMbase-job-template.json
in the git repoChris Guidry
05/30/2024, 2:24 PMSimonas Jakubonis
06/03/2024, 10:29 AMCould not find flow 'start_research' in 'src/research/router.py'
$ cat src/research/router.py | grep start_research
@flow(name="start_research")
async def start_research(
f"deployment: {f'start_research/research-{app_settings.environment}'}"
name=f"start_research/research-{app_settings.environment}",
Simonas Jakubonis
06/03/2024, 10:31 AM- name: Run Prefect Deploy
run: |
pip install prefect
echo "Updated Prefect envs:"
echo "PREFECT_API_KEY=$PREFECT_API_KEY"
echo "PREFECT_CLOUD_URL=$PREFECT_CLOUD_URL"
prefect --no-prompt cloud login --key $PREFECT_API_KEY --workspace ismailsuperagentsh/superagent
prefect deployment ls
prefect --no-prompt deploy --prefect-file ./prefect.yaml --name research-${{ inputs.environment }}
Simonas Jakubonis
06/03/2024, 11:39 AMChris Guidry
06/03/2024, 2:39 PMImportError
while trying to load the flow, we'd give that message.Simonas Jakubonis
06/03/2024, 6:31 PMChris Guidry
06/03/2024, 6:31 PMSimonas Jakubonis
06/03/2024, 6:33 PMChris Guidry
06/03/2024, 6:41 PMSimonas Jakubonis
06/03/2024, 7:02 PM