<@ULVA73B9P>, in this Dockerfile stage, will the ...
# ask-marvin
j
@Marvin, in this Dockerfile stage, will the
PREFECT_EXPERIMENTAL_ENABLED_ENHANCED_CANCELLATION
Prefect setting be used in the
ENTRYPOINT
command,
prefect worker start
command or does it need to be set somewhere else?
Copy code
# ---HELM_WORKER stage---
FROM python_base as helm_worker

WORKDIR /app

RUN prefect config set PREFECT_EXPERIMENTAL_ENABLE_ENHANCED_CANCELLATION=True

RUN prefect block register --module prefect_gcp

ENTRYPOINT prefect worker start -p helm-$IMAGE_TAG --type cloud-run-v2
m
The
PREFECT_EXPERIMENTAL_ENABLE_ENHANCED_CANCELLATION
setting is being set in the Dockerfile using the
prefect config set
command. This means that it will be available to all Prefect commands run within this Docker container, including the
prefect worker start
command in the
ENTRYPOINT
. However, please note that the
prefect config set
command writes to the user configuration file, which is located by default at
~/.prefect/config.toml
. If the Docker container does not preserve this file across runs (which is often the case), the setting may not be preserved. To ensure that the setting is always available, you might consider setting it as an environment variable in the Dockerfile, like so:
Copy code
Dockerfile
ENV PREFECT__EXPERIMENTAL__ENABLE_ENHANCED_CANCELLATION=True
This will ensure that the setting is always available to Prefect commands run within the Docker container, regardless of whether the user configuration file is preserved.
j
@Marvin,Is this logging message mean that the
PREFECT__EXPERIMENTAL__ENABLE_ENHANCED_CANCELLATION
setting is not being used as True? 😬
Copy code
00:32:05.316 | INFO    | prefect.worker.cloud-run-v2.cloudrunworkerv2 f44392e9-50bf-4891-8a41-ba430d0aee75 - Skipping cancellation because flow run '0b6ef0fe-2dd6-460e-8c3b-938e3367737c' is using enhanced cancellation. A dedicated runner will handle cancellation.
m
This log message actually indicates that the
PREFECT__EXPERIMENTAL__ENABLE_ENHANCED_CANCELLATION
setting is being used and is set to
True
. When the
PREFECT__EXPERIMENTAL__ENABLE_ENHANCED_CANCELLATION
setting is enabled, Prefect uses a dedicated runner to handle task cancellation. This is why the log message says "A dedicated runner will handle cancellation." So, in this case, the log message is indicating that the normal cancellation process is being skipped because the enhanced cancellation feature is enabled and a dedicated runner is handling the cancellation instead.
sonic 1
j
Needed to set my Prefect command in worker to
Copy code
prefect flow-run execute