Sagar Arora
09/09/2024, 10:30 PMstacktrace is in thread
Sagar Arora
09/09/2024, 10:30 PMNate
09/09/2024, 10:31 PMSagar Arora
09/09/2024, 10:31 PMSagar Arora
09/09/2024, 10:32 PMRunning deployment build steps...
> Running run_shell_script step...
> Running build_docker_image step...
Collecting prefect-docker==0.3.1
Downloading prefect_docker-0.3.1-py3-none-any.whl (24 kB)
Requirement already satisfied: pyasn1<0.7.0,>=0.4.6 in ./.venv/lib/python3.11/site-packages (from pyasn1-modules>=0.2.1->google-auth>=1.0.1->kubernetes<30.0.0,>=24.2.0->prefect>=2.10.7->prefect-docker==0.3.1) (0.6.0)
Installing collected packages: prefect-docker
Successfully installed prefect-docker-0.3.1
Notice: A new release of pip is available: 23.1 -> 24.2
Notice: To update, run: pip install --upgrade pip
Traceback (most recent call last):
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/deployments/steps/core.py", line 154, in run_steps
step_output = await run_step(step, upstream_outputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/deployments/steps/core.py", line 124, in run_step
step_func = _get_function_for_step(fqn, requires=keywords.get("requires"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/deployments/steps/core.py", line 91, in _get_function_for_step
step_func = import_object(fully_qualified_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/utilities/importtools.py", line 212, in import_object
module = load_module(module_name)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/utilities/importtools.py", line 183, in load_module
return importlib.import_module(module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect_docker/__init__.py", line 2, in <module>
from .host import DockerHost # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect_docker/host.py", line 28, in <module>
class DockerHost(Block):
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/main.py", line 282, in __new__
cls = super().__new__(mcs, name, bases, new_namespace, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen abc>", line 106, in __new__
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/utilities/dispatch.py", line 100, in _register_subclass_of_base_type
register_type(cls)
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/utilities/dispatch.py", line 154, in register_type
key = get_dispatch_key(cls)
^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/utilities/dispatch.py", line 77, in get_dispatch_key
dispatch_key = dispatch_key()
Unable to load step function: prefect_docker.deployments.steps.build_docker_image. Attempting install of prefect-docker==0.3.1.
An exception occurred.
^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/blocks/core.py", line 315, in __dispatch_key__
return block_schema_to_key(cls._to_block_schema())
^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/blocks/core.py", line 487, in _to_block_schema
fields = cls.schema()
^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/main.py", line 664, in schema
s = model_schema(cls, by_alias=by_alias, ref_template=ref_template)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/schema.py", line 188, in model_schema
m_schema, m_definitions, nested_models = model_process_schema(
^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/schema.py", line 581, in model_process_schema
m_schema, m_definitions, nested_models = model_type_schema(
^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/schema.py", line 622, in model_type_schema
f_schema, f_definitions, f_nested_models = field_schema(
^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/schema.py", line 248, in field_schema
s, schema_overrides = get_field_info_schema(field)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/schema.py", line 216, in get_field_info_schema
schema_['default'] = encode_default(field.default)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/schema.py", line 995, in encode_default
return pydantic_encoder(dft)
^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/json.py", line 90, in pydantic_encoder
raise TypeError(f"Object of type '{obj.__class__.__name__}' is not JSON serializable")
TypeError: Object of type 'FieldInfo' is not JSON serializable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 259, in coroutine_wrapper
return call()
^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 432, in __call__
return self.result()
^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 318, in result
return self.future.result(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 179, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/_internal/concurrency/calls.py", line 389, in _run_async
result = await coro
^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/cli/deploy.py", line 325, in deploy
await _run_multi_deploy(
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/cli/deploy.py", line 810, in _run_multi_deploy
await _run_single_deploy(
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/client/utilities.py", line 78, in with_injected_client
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/cli/deploy.py", line 627, in _run_single_deploy
await run_steps(build_steps, step_outputs, print_function=app.console.print)
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect/deployments/steps/core.py", line 182, in run_steps
raise StepExecutionError(f"Encountered error while running {fqn}") from exc
prefect.deployments.steps.core.StepExecutionError: Encountered error while running prefect_docker.deployments.steps.build_docker_image
Error: Process completed with exit code 1.
Nate
09/09/2024, 10:32 PMNate
09/09/2024, 10:32 PMFile "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/pydantic/v1/json.py", line 90, in pydantic_encoder
raise TypeError(f"Object of type '{obj.__class__.__name__}' is not JSON serializable")
TypeError: Object of type 'FieldInfo' is not JSON serializable
Sagar Arora
09/09/2024, 10:32 PMNate
09/09/2024, 10:33 PMprefect[docker]<3
you should get the correct version of your integrationSagar Arora
09/09/2024, 10:34 PMNate
09/09/2024, 10:34 PMrun_shell_script
to pip install
stuff?Sagar Arora
09/09/2024, 10:34 PMNate
09/09/2024, 10:35 PMrun_shell_script
to install deps at runtime
but it sounds like the answer is yes 👍Sagar Arora
09/09/2024, 10:38 PMprefect-aws = "^0.4.7"
to
prefect[aws]<3
Nate
09/09/2024, 10:39 PM^0.4.7
should keep you under 0.5.0
Sagar Arora
09/09/2024, 10:39 PMNate
09/09/2024, 10:39 PMSagar Arora
09/09/2024, 10:40 PMNate
09/09/2024, 10:40 PMSagar Arora
09/09/2024, 10:41 PM- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: 1.3.2
- name: Poetry Install
run: |
export POETRY_HTTP_BASIC_CCDE_CODE_ARTIFACTS_USERNAME=aws
export POETRY_HTTP_BASIC_CCDE_CODE_ARTIFACTS_PASSWORD=$(aws codeartifact get-authorization-token --domain ccde-code-artifacts --domain-owner 271868244475 --query authorizationToken --output text)
poetry config virtualenvs.in-project true
poetry install
Sagar Arora
09/09/2024, 10:41 PMNate
09/09/2024, 10:44 PMInstall Poetry
bit is not the pull step, but instead the GHA step before you call prefect deploy
in CI right?Sagar Arora
09/09/2024, 10:44 PMNate
09/09/2024, 10:45 PMrun_shell_script
pull
step that would occur at runtime on the worker (not at deployment time in GHA)?Sagar Arora
09/09/2024, 10:47 PM- name: Authenticate with Prefect
run: |
source ./.venv/bin/activate
prefect cloud login --key ${{ secrets.PREFECT_API_KEY }} --workspace ${{ env.PREFECT_WORKSPACE }}
- name: Deploy flows
run: |
source ./.venv/bin/activate
prefect --no-prompt deploy --all
Nate
09/09/2024, 10:49 PMpull
step, but its in your build
step that occurs immediately after running prefect deploy
okay so the problem is that somehow you have the wrong deps at deployment time
how do you have prefect
itself defined in your pyproject.toml
Sagar Arora
09/09/2024, 10:51 PMprefect = "2.17.1"
prefect-dask = "0.2.5"
prefect-slack = "0.1.2"
prefect-aws = "^0.4.7"
Nate
09/09/2024, 10:57 PMNate
09/09/2024, 10:59 PMFile "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect_docker/__init__.py", line 2, in <module>
from .host import DockerHost # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/runner/_work/ccbi-prefect/ccbi-prefect/flows/.venv/lib/python3.11/site-packages/prefect_docker/host.py", line 28, in <module>
class DockerHost(Block):
this DockerHost
object is somehow a pydantic basemodel v1 object, which will not play nice with Block
classes based on pydantic basemodel v2 objects
would you be able to add a run_shell_script
section to your build
step that echo
out prefect version
?Sagar Arora
09/09/2024, 11:00 PMNate
09/09/2024, 11:03 PMprefect version
doesnt show integration versions
so maybe pip list | grep -E 'prefect|pydantic'
insteadSagar Arora
09/09/2024, 11:04 PMSagar Arora
09/09/2024, 11:18 PMSagar Arora
09/09/2024, 11:18 PM