Donny Flynn
10/27/2021, 4:53 PMAnna Geller
prefect agent kubernetes install --rbac --key YOUR_API_KEY | kubectl apply --namespace=YOUR_NAMESPACE -f -
Then in your flow, you need to configure KubernetesRun as your run configuration. Here are some examples: https://github.com/anna-geller/packaging-prefect-flows
Let us know if you have any issues.Anna Geller
Donny Flynn
10/27/2021, 5:06 PMDonny Flynn
11/01/2021, 8:02 PMexecution_role_arn
, but now it's not kicking the Flow offAnna Geller
Donny Flynn
11/01/2021, 8:06 PMrequirements.txt
in properly, but I'm not 100% sure I did that correctlyDonny Flynn
11/01/2021, 8:07 PMAnna Geller
Donny Flynn
11/01/2021, 8:08 PMAnna Geller
Donny Flynn
11/01/2021, 8:08 PMRUN_CONFIG = ECSRun(
labels=["prod"],
task_role_arn="arn:aws:iam::XXXXX:role/prefectTaskRole",
execution_role_arn="arn:aws:iam::XXXXX:role/prefectTaskRole",
image="<http://XXXXX.dkr.ecr.us-east-2.amazonaws.com/prefect-custom-image|XXXXX.dkr.ecr.us-east-2.amazonaws.com/prefect-custom-image>",
run_task_kwargs=dict(cluster="prefectEcsCluster", launchType="FARGATE",),
)
Anna Geller
Donny Flynn
11/01/2021, 8:10 PMDonny Flynn
11/01/2021, 8:10 PMAnna Geller
RUN_CONFIG = ECSRun(
labels=["prod"],
task_role_arn="arn:aws:iam::XXX:role/prefectTaskRole",
execution_role_arn="arn:aws:iam::XXX:role/prefectECSAgentTaskExecutionRole",
run_task_kwargs=dict(cluster="prefectEcsCluster", launchType="FARGATE",),
image="<http://XXX.dkr.ecr.us-east-1.amazonaws.com/community:latest|XXX.dkr.ecr.us-east-1.amazonaws.com/community:latest>"
)
just change the execution role to prefectECSAgentTaskExecutionRole and you should be good to goAnna Geller
@Donny Flynn What’s my source of truth for that? On AWS? Or what I pushed?I’d say your source of truth is Dockerfile - you can version-control and modify it anytime. As long as you use one of the official Prefect base images, your custom image should work.
Donny Flynn
11/01/2021, 8:54 PMDonny Flynn
11/01/2021, 8:55 PMAnna Geller
COPY requirements.txt .
RUN pip install -r requirements.txt