Hi, I have different input files for my flow which...
# prefect-kubernetes
n
Hi, I have different input files for my flow which requires different amount of resources needed. For small files 1GB memory is sufficient while for big files I need e.g. 64GB of memory. I would like to place flows with small files on small nodes and for larger input files I need larger nodes. Is it possible to override the customizations when starting a flow? If that’s not possible my only idea would be to deploy the flow multiple times with a different deployment name and customization settings. I am using the latest prefect version on AWS EKS and prefect cloud.
Copy code
overrides = {
    "customizations": [
        {
            "op": "add",
            "path": "/spec/template/spec/containers/0/resources",
            "value": {"requests": {"memory": "...", "cpu": "..."}, "limits": {"memory": "...", "cpu": "..."}},
        },
        {
            "op": "add",
            "path": "/spec/template/spec/nodeSelector",
            "value": {"partition": "..."},
        },
    ]
}

infrastructure = KubernetesJob(
    # ...
    customizations=overrides,
)

deployment = Deployment.build_from_flow(
    # ...
    infrastructure=infrastructure,
)
deployment.apply()
Copy code
paramters = {"s3_file": "example/..."}
customizations = get_customizations_based_on(parameters)
flow_run = run_deployment(
    name=name,
    parameters=parameters,
    # set customizations/overrides somehow here?
)
r
You would need to deploy multiple - you cant override the settings at flow run time as they are a deployment concern
🙏 1