https://prefect.io logo
#prefect-community
Title
# prefect-community
m

Madison Schott

11/14/2022, 9:51 PM
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

Nate

11/14/2022, 10:05 PM
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

Madison Schott

11/14/2022, 10:11 PM
hmm it's not showing up on my UI for some reason
n

Nate

11/14/2022, 10:12 PM
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

Madison Schott

11/14/2022, 10:13 PM
No I didn't I thought I could just do that from the UI
n

Nate

11/14/2022, 10:14 PM
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

Madison Schott

11/14/2022, 10:17 PM
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

Nate

11/14/2022, 10:19 PM
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

Madison Schott

11/14/2022, 10:21 PM
"Please login with `prefect cloud login --key <API_KEY>`"
Where can I find the API_KEY?
n

Nate

11/14/2022, 10:21 PM
do you have a prefect cloud account?
m

Madison Schott

11/14/2022, 10:22 PM
yes
n

Nate

11/14/2022, 10:23 PM
cool! this should help you out
m

Madison Schott

11/14/2022, 10:25 PM
Great, thanks!
🦜 1
n

Nate

11/14/2022, 10:26 PM
sure thing 🙂