Devin Dennis
07/29/2024, 9:25 PMprefect.exceptions.SignatureMismatchError: Function expects parameters ['args', 'kwargs'] but was provided with parameters ['upload_id', 'thumb_api_url']
Devin Dennis
07/29/2024, 9:28 PMprefect deployment inspect report/report
{
'id': '7e94e2fe-b992-4691-a03c-ba67e93b9136',
'created': '2024-07-29T21:20:58.999368+00:00',
'updated': '2024-07-29T21:28:05.170301+00:00',
'infra_overrides': {'image': 'harbor.mydomsin.com/project/prefect-flows:3d8d5cf-dirty', 'namespace': 'prefect'},
'name': 'report',
'version': None,
'description': None,
'flow_id': 'c196da83-14f9-4298-b70e-1ed1308351e3',
'schedule': None,
'is_schedule_active': True,
'paused': False,
'schedules': [],
'parameters': {'upload_id': None, 'thumb_api_url': None},
'pull_steps': [{'prefect.deployments.steps.set_working_directory': {'directory': '/opt/prefect/prefect'}}],
'tags': ['k3s'],
'work_queue_name': 'default',
'last_polled': '2024-07-29T21:28:05.171041+00:00',
'parameter_openapi_schema': {
'type': 'object',
'title': 'Parameters',
'properties': {
'upload_id': {'type': 'string', 'title': 'upload_id', 'default': '555e6c1e-110d-404f-86b9-cf18d2bc3ca0', 'position': 0},
'thumb_api_url': {'type': 'string', 'title': 'thumb_api_url', 'default': '<http://localhost:40785/api/s3/thumbs>', 'position': 1}
}
},
'path': None,
'entrypoint': 'flows/report.py:report',
'manifest_path': None,
'storage_document_id': None,
'infrastructure_document_id': None,
'created_by': None,
'updated_by': None,
'work_queue_id': None,
'enforce_parameter_schema': False,
'work_pool_name': 'hua',
'status': 'READY'
}
Nate
07/29/2024, 9:32 PM'parameter_openapi_schema': {
'type': 'object',
'title': 'Parameters',
'properties': {
'upload_id': {'type': 'string', 'title': 'upload_id', 'default': '555e6c1e-110d-404f-86b9-cf18d2bc3ca0', 'position': 0},
'thumb_api_url': {'type': 'string', 'title': 'thumb_api_url', 'default': '<http://localhost:40785/api/s3/thumbs>', 'position': 1}
}
},
• when your worker picks up the flow run, it tries to load your flow code, but if it can't we previously loaded a placeholder flow with signature (*args, **kwargs)
which may be what you're seeing if your flow is failing to loadDevin Dennis
07/29/2024, 9:34 PMFROM prefecthq/prefect:2.19.8-python3.11
RUN apt-get update \
&& apt-get -y install libpq-dev gcc
RUN pip install --upgrade pip && \
pip install pipenv
COPY . /opt/prefect/prefect/
RUN pipenv lock && \
pipenv install --system --deploy
WORKDIR /opt/prefect/prefect/
Devin Dennis
07/29/2024, 9:34 PM[[source]]
url = "<https://pypi.org/simple>"
verify_ssl = true
name = "pypi"
[packages]
prefect = "2.19.9"
s3fs = "2024.6.1"
[requires]
python_version = "3.11"
Devin Dennis
07/29/2024, 9:41 PM@flow
def hello(name: str = "Marvin"):
logger = get_run_logger()
<http://logger.info|logger.info>(f"Hello, {name}!")
Devin Dennis
07/29/2024, 9:43 PM@flow(flow_run_name="{upload_id}")
def report(
upload_id: str,
thumb_api_url: str
):
logger = get_run_logger()
<http://logger.info|logger.info>("Generating report")
generate_mobile_thumbs(upload_id, thumb_api_url)
generate_model_thumbs(upload_id, thumb_api_url)
Devin Dennis
07/29/2024, 9:56 PMNate
07/29/2024, 9:58 PM