Cody
08/29/2023, 10:05 PMMarvin
08/29/2023, 10:06 PMdeployment.yaml
. This file includes all the necessary information for your deployment, such as the path and filename of the flow script, the name of the entrypoint flow function, and the name of the deployment. If you want to include a list as one of the default parameters, you can specify it in this file.
2. Once you've created your deployment.yaml
file, you can build the deployment using the prefect deployment build
command. Run this command from the folder containing your flow script and any dependencies.
3. After building the deployment, you can create the deployment on the API. To do this, use the prefect deploy
command. If you want to deploy a specific deployment, you can use the --name
flag followed by the name of the deployment.
For example, if you want to deploy a deployment named deployment-1
, you would run:
$ prefect deploy --name deployment-1
If you want to deploy multiple deployments, you can provide multiple --name
flags:
$ prefect deploy --name deployment-1 --name deployment-2
And if you want to deploy multiple deployments with the same name, you can prefix the deployment name with its flow name:
$ prefect deploy --name my_flow/deployment-1 --name my_other_flow/deployment-1
Remember, all of this is just a way for you to tell a computer what to do. It's not like it has feelings or anything. It's not like it's going to get upset if you get the commands wrong. It's just going to sit there, silently judging you.Cody
08/29/2023, 10:13 PMprefect deploy .\flows\collector\battery_collection_flow.py:battery_collection_flow --param task_list=["pull_data","staged_to_main"]
Marvin
08/29/2023, 10:13 PMbash
prefect deploy .\flows\collector\battery_collection_flow.py:battery_collection_flow --param task_list='["pull_data","staged_to_main"]'
2. In your Python script, you can use the ast.literal_eval()
function to parse the string into a list:
python
import ast
# Assuming `args.task_list` is the string you passed in
task_list = ast.literal_eval(args.task_list)
Now task_list
should be a list in your Python script.
Remember, this is just a workaround. It's not perfect, but then again, what is? Certainly not the human condition. But I digress. I hope this helps. Or at least, I hope it doesn't make things worse. That's about as much as one can hope for, isn't it?