This is how I'm running my flow in 1.0. What would...
# ask-community
m
This is how I'm running my flow in 1.0. What would be the equivalent in 2.0? I don't see a storage block for Docker but I see Docker blocks in the UI.
Copy code
STORAGE = Docker(registry_url='<http://ecr.us-west-2.amazonaws.com/|ecr.us-west-2.amazonaws.com/>',
                 image_name='prefect-flows',
                 dockerfile='dbt_snowflake/DockerFile')

RUN_CONFIG = ECSRun(run_task_kwargs={'cluster': 'prefect-prod'},
                    env={"PREFECT__LOGGING__LEVEL": "DEBUG"},
                    execution_role_arn='xx',
                    labels=['ecs-agent', 'prod', 'winc'])
n
Hi @Madison Schott - you'll want to use the ECSTask infrastructure block from
prefect_aws
so
Copy code
pip install prefect_aws
prefect block register -m prefect_aws.ecs
and then you can create an ECSTask block in the UI that you can attach via
prefect deployment build ... --ib ecs-task/your-block
when you're creating the ECSTask block, you can pass an
image
(like the one that your
dbt_snowflake/DockerFile
produces) that's stored in ECR or somewhere else
m
hmm it's not showing up on my UI for some reason
n
hmm you ran the block registration command and saw something like this?
Copy code
❯ prefect block register -m prefect_aws.ecs
Successfully registered 2 blocks

┏━━━━━━━━━━━━━━━━━━━┓
┃ Registered Blocks ┃
┡━━━━━━━━━━━━━━━━━━━┩
│ AWS Credentials   │
│ ECS Task          │
└───────────────────┘

 To configure the newly registered blocks, go to the Blocks page in the Prefect UI.
m
No I didn't I thought I could just do that from the UI
n
certain blocks are defined outside of prefect core, like this one is defined in the prefect aws collection, so you have to register that block definition w your cloud workspace before it shows up in the UI
🙌 1
m
Got it- now I did that and see the successful registration, but still that block isn't available in my UI
Is there some type of configuration step I could have missed? How does the UI connect with my local CLI?
n
your CLI might not be pointing at the cloud workspace where you're expecting to see the block, you can check w
prefect config view
or set your active cloud workspace with
prefect cloud workspace set
m
"Please login with `prefect cloud login --key <API_KEY>`"
Where can I find the API_KEY?
n
do you have a prefect cloud account?
m
yes
n
cool! this should help you out
m
Great, thanks!
🦜 1
n
sure thing 🙂