Hey all, I'm working on a Prefect 2.0 implementation on docker running on GCP compute engine. One issue is the bash script to get everything up and running. This is what I came up with, which seems to work. I'm wondering if I am overcomplicating this and there is an easier way to do it? The same thing was much simpler with Prefect 1.0 (set api key, register flow, then start agent).
prefect cloud login --key <MY_KEY> -w <MY_WORKSPACE>
rand="GCS_"$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 16)
output=$(printf '%s\n' 2 <MY_BUCKET> <MY_PROJECT> $rand | prefect storage create)
storage_id=$(echo $output | grep -oP "(?<=identifier \').+?(?=\')")
prefect storage set-default $storage_id
prefect deployment create my_flow.py
output=$(prefect work-queue create my_queue | grep -oP "(?<=UUID\(\').+?(?=\'\))")
prefect agent start $output