<@ULVA73B9P> can i use the command prefect --no-p...
# ask-marvin
d
@Marvin can i use the command prefect --no-prompt deploy --prefect-file prefect.yaml --all with a hybrid workpool?
m
thought for 325.0 seconds
d
I’m getting This deployment configuration references work pool ‘ecs-gvr-pool’ which does not exist. This means no worker will be able to pick up its runs. You can create a work pool in the Prefect UI.
n
yes, that works for any deployments defined in prefect.yaml files, regardless of work pool type
are you sure
prefect config view
shows what you expect?
ie you're not connected to a different workspace/server
d
i set the use profile and set the key and the url before the call to deploy…
n
why?
there's a top level
--profile
flag
Copy code
prefect --profile foo deploy ...
well i guess if you're seeing that work pool DNE error, i'd suggest that (if it does exist) you're likely talking to the wrong workspace/server one way or another
m
Yes. In Prefect 3.x you can run:
Copy code
prefect --no-prompt deploy --prefect-file prefect.yaml --all
This works regardless of the work pool type, including hybrid. That command just registers deployments from your `prefect.yaml`; it doesn’t execute them. A few notes: -
--no-prompt
is a global CLI toggle, so placing it before
deploy
is correct. -
--prefect-file
points to your project’s YAML (default is
prefect.yaml
, so it’s optional if you’re using the default name). -
--all
deploys all flows defined in the YAML; if you also pass an entrypoint or flow name,
--all
is ignored. For a hybrid work pool specifically: - Make sure your deployments in
prefect.yaml
reference your hybrid pool name. - Ensure a worker is running for that pool so scheduled runs get picked up:
Copy code
prefect work-pool create my-hybrid-pool --type docker
prefect worker start --pool my-hybrid-pool
Example
prefect.yaml
snippet:
Copy code
name: my-project
prefect-version: ">=3.0.0"
deployments:
  - name: my-flow
    entrypoint: flows/my_flow.py:my_flow
    work_pool:
      name: my-hybrid-pool
    job_variables:
      # e.g. image, env, resources, etc.
References: - CLI root (global --no-prompt): prefect/cli/root.py - Deploy command implementation (includes --prefect-file and --all): prefect/cli/deploy/_commands.py - Work pools (concepts): Work pools docs - Deployments overview: Deployments docs
d
@Nate my bad, I split prefect into two accounts and was reusing an old apikey.
n
no worries, done the same a bunch, usually why that happens IME