wooden-state-97148
12/07/2022, 11:12 PMunschedulable: 0/3 nodes are available: 3 insufficient memory displayed in the argo-workflows UI. The flow is the simple BranchFlow visible elsewhere in these threads.
The pod that gets spawned on kubernetes by argo-flows seems to default to 1 CPU and 4G memory (see output from k9s below) ... I have tried to add --with resources:cpu=1,memory=256 .. as part of the argo-workflows create/trigger commands, but these seem to be disregarded. The 3-node cluster is only at 3% CPU utilisation and 30% memory utilisation. What am I missing?
NAME↑ PF IMAGE READY STATE INIT RESTARTS PROBES(L:R) CPU MEM CPU/R:L MEM/R:L
<http://quay.io/argoproj/argoexec:v3.4.4|quay.io/argoproj/argoexec:v3.4.4> false <none> true 0 off:off 0 0 0:0 0:0
python:3.9 false <none> false 0 off:off 0 0 1000:0 3906:0
<http://quay.io/argoproj/argoexec:v3.4.4|quay.io/argoproj/argoexec:v3.4.4> false <none> false 0 off:off 0 0 0:0 0:0wooden-state-97148
12/07/2022, 11:12 PMfrom metaflow import FlowSpec, step, batch
class BranchFlow(FlowSpec):
@step
def start(self):
self.next(self.a, self.b)
@step
def a(self):
self.x = 1
self.next(self.join)
@step
def b(self):
self.x = 2
self.next(self.join)
@step
def join(self, inputs):
print('a is %s' % inputs.a.x)
print('b is %s' % inputs.b.x)
print('total is %d' % sum(input.x for input in inputs))
self.next(self.end)
@step
def end(self):
pass
if __name__ == '__main__':
BranchFlow()ancient-application-36103
12/07/2022, 11:41 PMpython flow.py argo-workflows create --only-json ?user
12/08/2022, 12:29 AM--with resources. There are some positional arguments.
I just ran the branchFlow in the following manner and the pods created by Argo indeed used 264MB of mem as the cli suggested:
$ python3 branch.py --with resources:memory=264 argo-workflows create
...
Workflow branchflow for flow BranchFlow pushed to Argo Workflows successfully.
$ python3 branch.py --with resources:memory=264 argo-workflows trigger
...
Workflow branchflow triggered on Argo Workflows (run-id argo-branchflow-ksw8p).
$ kubectl get pods -n jobs-default branchflow-ksw8p-start-588656901 -o json | jq .spec.containers[].resources
{}
{
"requests": {
"cpu": "1",
"ephemeral-storage": "10240M",
"memory": "264M" <<<<------------------
}
}user
12/08/2022, 12:36 AM@kubernetes decorator in your code so that you can run specific steps with specific resources. I just ran the flow with the following config:
@kubernetes(memory=256)
@step
def start(self):
self.next(self.a, self.b)
@kubernetes(memory=512)
@step
def a(self):
self.x = 1
self.next(self.join)
In this case, you need not specify --with resources on the cli. Simply doing a python3 branch.py argo-workflows create should work.
# start step
$ kp branchflow-pmzk7-start-2902377495 -o json | jq .spec.containers[].resources
{}
{
"requests": {
"cpu": "1",
"ephemeral-storage": "10240M",
"memory": "256M"
}
}
...
# step a
$ kp branchflow-pmzk7-a-1288646276 -o json | jq .spec.containers[].resources
{}
{
"requests": {
"cpu": "1",
"ephemeral-storage": "10240M",
"memory": "512M"
}
}user
12/09/2022, 4:25 AMwooden-state-97148
12/15/2022, 11:41 AM~/.metaflow sub-folder and let it regenerate. I added some observations in general working with a k8s set-up with metaflow-service/UI here. https://github.com/outerbounds/metaflow-tools/issues/26 ... I know the preferred approach is to run the full terraform/cloud-formation template, but I was looking for a faster/cheaper set-up that allowed me to explore the capabilities. Maybe you could have a quick read-through and suggest any obvious fixes. I'll flag @narrow-lion-2703 here, as I know this is his area of expertise too. Finally, I'm banging my head against the wall trying to get tensorflow-gpu working ... I asked for some help in the #C0377J7A23V channel ... maybe that was the wrong place to ask! Best. Columuser
12/15/2022, 4:37 PMwooden-state-97148
12/15/2022, 4:40 PMwooden-state-97148
12/20/2022, 3:43 PMuser
12/20/2022, 4:07 PMuser
12/20/2022, 4:09 PMMETAFLOW_SERVICE_URL in your metaflow config. Can you remove it and try once as an experiment? Only specify on the CLIwooden-state-97148
12/20/2022, 4:10 PMwooden-state-97148
12/20/2022, 4:19 PM"METAFLOW_SERVICE_URL": "<http://metaflow-metaflow-service:8080>"
I'm also passing the same value as part of the CLI, as per point 7.
METAFLOW_DEFAULT_METADATA=service METAFLOW_PROFILE=k8s-helm-civo METAFLOW_KUBERNETES_SERVICE_ACCOUNT_NAME=argo-workflow METAFLOW_KUBERNETES_NAMESPACE=argo METAFLOW_S3_ENDPOINT_URL=<http://minio.default:9000> METAFLOW_SERVICE_URL=<http://metaflow-metaflow-service.default:8080> AWS_PROFILE=minio-metaflow python branch_flow_argo.py --datastore=s3 argo-workflows trigger
For good measure ... I also passed as a decorator in the flow, also per point 7.
@environment(vars=dict(METAFLOW_SERVICE_URL="<http://metaflow-metaflow-service.default:8080/>"))
In spite of this, it still ended up as <http://localhost:8083/api> in the argo workflows-template. Are you suggesting to remove the METAFLOW_SERVICE_INTERNAL_URL (below) from the config file (point 4) ... could that be somehow contributing to this over-ride?
"METAFLOW_SERVICE_INTERNAL_URL": "<http://localhost:8083/api>",user
12/20/2022, 4:23 PMMETAFLOW_DEFAULT_METADATA=service METAFLOW_PROFILE=k8s-helm-civo METAFLOW_KUBERNETES_SERVICE_ACCOUNT_NAME=argo-workflow METAFLOW_KUBERNETES_NAMESPACE=argo METAFLOW_S3_ENDPOINT_URL=<http://minio.default:9000> METAFLOW_SERVICE_URL=<http://metaflow-metaflow-service.default:8080> AWS_PROFILE=minio-metaflow python branch_flow_argo.py --datastore=s3 argo-workflows create
to update the argo-workflow template.wooden-state-97148
12/20/2022, 4:31 PMcreate, I was playing around with --only-json ... and piping that to grep to see if that URL was getting passed to the argo-workflows spec and it was NOT ... ie. it would only return something if I used | grep :8083 ... eventhough I wasn't passing that end-point anywhere ... other than in the METAFLOW_SERVICE_INTERNAL_URL in the config file, as mentioned above.
METAFLOW_DEFAULT_METADATA=service METAFLOW_PROFILE=k8s-helm-civo METAFLOW_KUBERNETES_SERVICE_ACCOUNT_NAME=argo-workflow METAFLOW_KUBERNETES_NAMESPACE=argo METAFLOW_S3_ENDPOINT_URL=<http://minio.default:9000> METAFLOW_SERVICE_URL=<http://metaflow-metaflow-service.default:8080> AWS_PROFILE=minio-metaflow python branch_flow_argo.py --datastore=s3 argo-workflows create --only-json | grep :8080user
12/20/2022, 4:36 PMargo-workflows create generated the config with the correct METAFLOW_SERVICE_URL . Is that right?