https://prefect.io logo
s

sqlboi

08/31/2023, 8:32 PM
another question for you guys...anyone know how to dynamically set deploy configs:
Copy code
(job) root@f469932fdcb1:/job# prefect deploy listval/main.py:validate_list
? Would you like to use an existing deployment configuration? [Use arrows to move; enter to select; n to select none]
┏━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃   ┃ Name             ┃ Entrypoint                    ┃ Description             ┃
┡━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ > │ {{ $LIST_NAME }} │ listval/main.py:validate_list │ {{ $LIST_DESCRIPTION }} │
└───┴──────────────────┴───────────────────────────────┴─────────────────────────┘
im using the
prefect.yml
file
1
Copy code
root@f758eb182396:/job# prefect deploy listval/main.py:validate_list --name ${LIST_NAME}
The following deployment(s) could not be found and will not be deployed: "podman_test"
Could not find any deployment configurations with the given name(s): "podman_test". Your flow will be deployed with a new deployment configuration.
starting flow
starting flow
? Would you like to schedule when this flow runs? [y/n] (y): ^C
Aborted.
i ended up just writing a bash script to replace variables in the prefect.yaml file
s

Serina

09/01/2023, 3:47 PM
I’m glad you were able to find a solution for what you wanted to do. It may also be helpful for you to pass in
--no-prompt
during
prefect deploy
to disable interactive mode (e.g.
prefect --no-prompt deploy
, which could be useful for you in future. I’ll add this to our documentation as well. You can also change this setting via the
PREFECT_CLI_PROMPT
. Additionally, passing in the args via
prefect deploy
, e.g.
prefect deploy -n $my-deployment-name
or something like that could be useful to you.
🙌 1
s

sqlboi

09/07/2023, 1:00 PM
@Serina thanks for this! not sure how i missed it in https://docs.prefect.io/latest/concepts/deployments/#deployment-fields
@Serina i spoke to soon, i get
Copy code
Try 'prefect deploy --help' for help.
╭─ Error ──────────────────────────────────────────────────────────────────────╮
│ No such option: --tags Did you mean --tag?                                   │
╰──────────────────────────────────────────────────────────────────────────────╯
when using
--tags ${LIST_TAGS}
which are:
"LIST_TAGS=[Tag1,Tag2]"
s

Serina

09/07/2023, 2:02 PM
Copy code
No such option: --tags Did you mean --tag?
The error message specifies to use
--tag
🙂 You can check out all available commands at
prefect deploy --help
s

sqlboi

09/07/2023, 2:03 PM
@Serina i tried
--tag
😕 did it one by one like
--tag blahblah
and
--tag "blahblah"
ok got this to work:
"pipenv run prefect --no-prompt deploy main.py:validate_list --name ${LIST_NAME} --description ${LIST_DESCRIPTION} --tag ${LIST_TAGS}"
it's kind of annoying to go tag by tag so will stick to bash 😕