사람
05/31/2024, 2:41 PM##flow.py
from prefect import flow
from prefect.deployments import DeploymentImage
@flow(log_prints=True)
def hello():
print("Hello!")
if __name__ == "__main__":
hello.deploy(
name="test-prefect-docker-deployment",
work_pool_name="docker-agent-pool",
work_queue_name="docker-agent",
image=DeploymentImage(
name="test-prefect-docker",
tag="0.3",
buildargs={"PYTHON_VERSION": "3.11"},
platform="linux/arm64"
),
cron="0 * * * *",
)
When the platform option is not specified, I confirmed that the x86 image is created without any issues. However, since the Prefect server is in an ARM environment, when I add the platform=linux/arm64 option, I encounter the following error.
Building wheels for collected packages: pendulum
Building wheel for pendulum (pyproject.toml): started
Building wheel for pendulum (pyproject.toml): finished with status 'done'
Created wheel for pendulum: filename=pendulum-2.1.2-cp311-cp311-manylinux_2_35_x86_64.whl size=160101 sha256=404c2563203315e7e5c57ae9f99d65f9f597a9fcf29ffe9f7e7eac51effd437b
Stored in directory: /home/runner/.cache/pip/wheels/a4/b7/10/a86f4f49b1bdf8a0cf3da42d48f499e4cb7529ebab7aad3550
Successfully built pendulum
Installing collected packages: text-unidecode, pytz, coolname, websockets, websocket-client, urllib3, ujson, tzlocal, typing-extensions, toml, sniffio, six, shellingham, ruamel.yaml.clib, rpds-py, regex, readchar, pyyaml, pytzdata, python-slugify, python-multipart, pygments, pycparser, pyasn1, pathspec, packaging, orjson, oauthlib, mdurl, MarkupSafe, markdown, jsonpointer, itsdangerous, importlib-resources, idna, hyperframe, humanize, hpack, h11, greenlet, graphviz, fsspec, dnspython, colorama, cloudpickle, click, charset-normalizer, certifi, cachetools, attrs, async-timeout, annotated-types, uvicorn, sqlalchemy, ruamel.yaml, rsa, rfc3339-validator, requests, referencing, python-dateutil, pydantic-core, pyasn1-modules, markdown-it-py, Mako, jsonpatch, jinja2, httpcore, h2, griffe, email-validator, cffi, asyncpg, asgi-lifespan, anyio, aiosqlite, rich, requests-oauthlib, pydantic, pendulum, jsonschema-specifications, jinja2-humanize-extension, httpx, google-auth, docker, dateparser, cryptography, croniter, alembic, typer, kubernetes, jsonschema, apprise, prefect
Successfully installed Mako-1.3.5 MarkupSafe-2.1.5 aiosqlite-0.20.0 alembic-1.13.1 annotated-types-0.7.0 anyio-3.7.1 apprise-1.8.0 asgi-lifespan-2.1.0 async-timeout-4.0.3 asyncpg-0.29.0 attrs-23.2.0 cachetools-5.3.3 certifi-2024.2.2 cffi-1.16.0 charset-normalizer-3.3.2 click-8.1.7 cloudpickle-3.0.0 colorama-0.4.6 coolname-2.2.0 croniter-2.0.5 cryptography-42.0.7 dateparser-1.2.0 dnspython-2.6.1 docker-6.1.3 email-validator-2.1.1 fsspec-2024.5.0 google-auth-2.29.0 graphviz-0.20.3 greenlet-3.0.3 griffe-0.45.2 h11-0.14.0 h2-4.1.0 hpack-4.0.0 httpcore-1.0.5 httpx-0.27.0 humanize-4.9.0 hyperframe-6.0.1 idna-3.7 importlib-resources-6.1.3 itsdangerous-2.2.0 jinja2-3.1.4 jinja2-humanize-extension-0.4.0 jsonpatch-1.33 jsonpointer-2.4 jsonschema-4.22.0 jsonschema-specifications-2023.12.1 kubernetes-29.0.0 markdown-3.6 markdown-it-py-3.0.0 mdurl-0.1.2 oauthlib-3.2.2 orjson-3.10.3 packaging-24.0 pathspec-0.12.1 pendulum-2.1.2 prefect-2.18.3 pyasn1-0.6.0 pyasn1-modules-0.4.0 pycparser-2.22 pydantic-2.7.2 pydantic-core-2.18.3 pygments-2.18.0 python-dateutil-2.9.0.post0 python-multipart-0.0.9 python-slugify-8.0.4 pytz-2024.1 pytzdata-2020.1 pyyaml-6.0.1 readchar-4.1.0 referencing-0.35.1 regex-2024.5.15 requests-2.31.0 requests-oauthlib-2.0.0 rfc3339-validator-0.1.4 rich-13.7.1 rpds-py-0.18.1 rsa-4.9 ruamel.yaml-0.18.6 ruamel.yaml.clib-0.2.8 shellingham-1.5.4 six-1.16.0 sniffio-1.3.1 sqlalchemy-2.0.30 text-unidecode-1.3 toml-0.10.2 typer-0.12.3 typing-extensions-4.12.0 tzlocal-5.2 ujson-5.10.0 urllib3-2.2.1 uvicorn-0.28.1 websocket-client-1.8.0 websockets-12.0
Traceback (most recent call last):
File "/home/runner/work/test_prefect_slack/test_prefect_slack/flow.py", line 9, in <module>
hello.deploy(
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 259, in coroutine_wrapper
return call()
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 432, in __call__
return self.result()
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 318, in result
return self.future.result(timeout=timeout)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 179, in result
return self.__get_result()
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 389, in _run_async
result = await coro
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/flows.py", line 1098, in deploy
deployment_ids = await deploy(
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/deployments/runner.py", line 972, in deploy
image.build()
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/deployments/runner.py", line 824, in build
build_image(**build_kwargs)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/prefect/utilities/dockerutils.py", line 186, in build_image
raise BuildError(event["error"])
prefect.utilities.dockerutils.BuildError: The command '/bin/sh -c python -m pip install -r /opt/prefect/test_prefect_slack/requirements.txt' returned a non-zero code: 1
Is there something I am missing? Any help would be appreciated!