Gaurav
03/30/2022, 10:48 PMjob_template={
"apiVersion": "batch/v1",
"kind": "Job",
"spec": {
"template": {
"metadata": {
"labels": {
"execution-model": "serverless"
}
},
"spec": {
"containers": [
{
"name": "flow"
}
],
"nodeSelector": {
"execution-model": "serverless"
},
"tolerations": [
{
"key": "<http://virtual-kubelet.io/provider|virtual-kubelet.io/provider>",
"operator": "Exists"
}
]
}
}
}
However the flow fails. When i ran kubectl get events. I notice the following output:
Warning ProviderCreateFailed pod/prefect-job-XXXXX-XXXXX ACI does not support providing args without specifying the command. Please supply both command and args to the pod spec.
Just some more information - I also ran the same flow successfully on a alternate deployment on AWS EKS Fargate, using an AWS Kubernetes Agent.
Any guidance is really appreciated :)Kyle McChesney
03/30/2022, 10:56 PMKyle McChesney
03/30/2022, 10:56 PMGaurav
03/30/2022, 11:00 PMKevin Kho
Matthias
03/31/2022, 7:10 AMAnna Geller
KubeCluster
, while you mentioned you are using a LocalDaskExecutor
which should just use local threads and processes rather than a KubeCluster.
For troubleshooting, I'd recommend taking it more step-by-step and trying a simple hello world flow on AKS with no custom job template first (just using the Prefect base image) to ensure your Prefect AKS setup is working fine before moving to custom job templates and Dask.Matthias
03/31/2022, 11:31 AMKubeCluster
). The real problem is that if you want to use AKS with virtual nodes, not only do you have to add custom annotations/node selectors, but you also have to supply both a command and args to the pod spec (which is the exact error message you got). Apparently, ACI uses the combination under the hood and would lead to unexpected behaviour if you supply one without the other see https://github.com/virtual-kubelet/azure-aci/pull/11Matthias
03/31/2022, 11:32 AMGaurav
04/01/2022, 2:28 AMMatthias
04/01/2022, 6:36 AMMatthias
04/01/2022, 8:59 AMAnna Geller
Anna Geller
image
and imagePullPolicy
to your job template spec instead of on the normal KubernetesRun args? basically moving those two values after line 25 because I saw it being set here this way.
If you do this, the spec should have all the info it needs:
def set_run_config() -> RunConfig:
return KubernetesRun(
labels=["azure"],
cpu_request="2",
memory_request="4G",
job_template={
"apiVersion": "batch/v1",
"kind": "Job",
"spec": {
"template": {
"metadata": {
"labels": {
"execution-model": "serverless"
}
},
"spec": {
"containers": [
{
"name": "flow",
"image": "purplebeast786/dummy:latest",
"imagePullPolicy": "IfNotPresent",
"command": ["/bin/sh", "-c"],
"args": ["prefect execute flow-run"]
}
],
"nodeSelector": {
"execution-model": "serverless"
},
"tolerations": [
{
"key": "<http://virtual-kubelet.io/provider|virtual-kubelet.io/provider>",
"operator": "Exists"
}
]
}
}
}
}
)
Matthias
04/01/2022, 12:09 PMspec.container.args
, which is done in by the agent when deploying the flow (see my comment above), then you have to specify spec.container.command
too (which doesn't happen by default). So if you uncomment that one alone, it should be fine…Gaurav
04/01/2022, 4:41 PMGaurav
04/01/2022, 4:42 PMkubectl get events
and the UI:Gaurav
04/01/2022, 4:45 PMGaurav
04/01/2022, 4:55 PMMatthias
04/01/2022, 5:03 PMGaurav
04/01/2022, 5:07 PMGaurav
04/01/2022, 5:18 PMkubectl logs -c flow --follow <pod name>
while it was in the running state. And i see the following output: (looks like just the default CLI help that shows up when running a wrong command?) - got terminated shortly after.Matthias
04/01/2022, 5:20 PMMatthias
04/01/2022, 5:26 PMGaurav
04/01/2022, 5:32 PMMatthias
04/01/2022, 5:43 PMMatthias
04/01/2022, 5:50 PMGaurav
04/01/2022, 6:43 PMPod prefect-job-13744367-thlwn failed.
Container 'flow' state: waiting
(2) Im not sure what you meant by get the manifest of the job when running somewhere else. I ran the job on AKS provisioned node pool, by commenting out the command, args and the taints. It worked successfully as expected, but the logs of the pod were just the output that shows in prefect:Anna Geller
Gaurav
04/01/2022, 7:06 PMGaurav
04/01/2022, 7:06 PMBring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by