Samuel Hinton
08/20/2024, 4:13 AMtask_role_arn
and an execution_role_arn
I want to set in my provisioned ECS worker service, but have no idea how to do so. Right now I am trying to use sed to manually modify a template on worker launch (which first tries to create a work-pool with the sed-modified template), but this is a code smell I'd love to get rid of.
Ideally I'd love to simply do this via an environment variable, but nothing in the documentation here or here seems to indicate you need to either hardcode them in a template or specify it explicitly in the deployment.yaml (the latter not being ideal because a deployment shouldnt need to know about infrastructure subnets). Similarly, the documentation here shows a bunch of configuration options like the arns and vpc_id, but not the ways you can set this configuration. I'm really at a loss with this oneSamuel Hinton
08/20/2024, 5:14 AMNate
08/20/2024, 5:54 PMNate
08/20/2024, 5:56 PMSamuel Hinton
08/21/2024, 12:27 AMNate
08/21/2024, 12:48 AMNate
08/21/2024, 12:48 AMSamuel Hinton
08/21/2024, 12:58 AMSamuel Hinton
08/21/2024, 4:57 AMvpc_id
variable, and want to confirm its being set in the deployment, but I can't see any information about the ecs task variables in the logs, Details, Parameters, etc, of the crashed flow. Do you know how to view that final deployment configuration?Nate
08/22/2024, 3:14 AMSamuel Hinton
08/22/2024, 3:19 AMSamuel Hinton
08/22/2024, 3:27 AM{{ vpc_id }}
in it, that it will pick up a vpc_id
variable. But from this page maybe I need to have every deployment yaml specify something like vpc_id: "{{ prefect.variables.vpc_id}}"
If that's the case, then please let me know and I'll put the sed command back, as I dont want every downstream flow having to configure infrastructure networking when I can just munt the template to add defaults 🙂Samuel Hinton
08/22/2024, 3:28 AMNate
08/22/2024, 4:23 AMprefect.variables.
e.g. {{ <http://prefect.variables.my|prefect.variables.my>_vpc_id }}
, since just {{ vpc_id }}
would look in the above variables
section for a job variable by that name, not a Prefect Variable in your workspace - we could document this better) in the base job template of your work pool, meaning downstream deployments do not need to configure this job variable
perhaps you're fine with hardcoding the vpc_id in your template (since deployment creators wont need to configure it), I just suggested a Prefect Variable since it would provide a clear place for you (or other infra configure-ers) to set this value without messing with the work pool, or needing to re-run something like your sed'd prefect worker start
command if that vpc value changes, since we render that template at runtime, and therefore the current value of that Prefect Variable would be the thing that matters
i'm technically out of office this week but ill work on adding an example / clarifying docs on this when i get back, since I think we need some more color on this in the docsNate
08/22/2024, 4:26 AMValue error, The variables specified in the job configuration template must be present as properties in the variables schema. Your job configuration uses the following undeclared variable(s)
Samuel Hinton
08/22/2024, 8:08 AMSamuel Hinton
08/22/2024, 8:40 AMVariable.set(name, value, overwrite=True)
than something akin to
try:
client.create_variable(...)
except PrefectHTTPStatusError as e:
if e.code == 409:
client.update_variable(...)
but apply that to create work pool vs update work pool
Ive reproduced the same error too, but am struggling to fix it.Samuel Hinton
08/23/2024, 2:08 AMSamuel Hinton
08/23/2024, 2:11 AMSamuel Hinton
09/02/2024, 1:58 AMclient.create_work_pool
without that variable error? If I can get it working I'll put it in the github link for posterityMitch Nielsen
10/28/2024, 5:17 PMCloud
reference from the resources that are not cloud-only)Samuel Hinton
10/29/2024, 1:50 AMNate
10/29/2024, 2:23 AMprefect.variable.thing
as a default in the template like i mentioned earlier, but the below should help hopefully in the meantime?Samuel Hinton
12/12/2024, 6:53 AM