https://dagster.io/ logo
#dagster-kubernetes
Title
# dagster-kubernetes
k

Kirk Stennett

01/07/2022, 9:40 PM
Hey all I'm on an older version of dagster
0.11.13
and attempting to get k8s pod affinity working at the solid level. I'm currently using something like:
Copy code
tags = {
    "dagster-k8s/config": {
        "pod_spec_config": {
            "affinity": {
                "nodeAffinity": {
                    "requiredDuringSchedulingIgnoredDuringExecution": {
                        "nodeSelectorTerms": [
                            {
                                "matchExpressions": [
                                    {
                                        "key": "lifecycle",
                                        "operator": "In",
                                        "values": ["spot"],
                                    }
                                ]
                            }
                        ]
                    }
                }
            }
        }
    }
}
and it's still attaching to some ON_DEMAND nodes that I have set up. Any idea why? Or is this potentially a known bug this older version? I'm using the K8sJobExecutor as well, not sure if that could be problematic too
I've verified that the label in question is present on the spot nodes as well,
lifecycle=spot
j

johann

01/07/2022, 9:46 PM
Could you verify that the affinity is showing up in the K8s Job spec?
k

Kirk Stennett

01/07/2022, 9:52 PM
I see nothing in the jobs for the job or run
Am I missing some sort of configuration that lets dagster utilize the solid config?
j

johann

01/07/2022, 9:59 PM
I see nothing in the jobs for the job or run
Just to confirm, you’re looking at the Job created for the solid that you’ve tagged?
k

Kirk Stennett

01/07/2022, 10:02 PM
Correct, I just verified by running
describe job
and saw nothing related to affinity. Is there some other place I should validate?
j

johann

01/07/2022, 10:06 PM
Ah I believe this was a bug with the
k8s_job_executor
in 0.11.13
k

Kirk Stennett

01/07/2022, 10:07 PM
👍 Any idea what version resolved it? We're finally getting back on the update track here.
j

johann

01/07/2022, 10:09 PM
Looks like it was resolved in 0.12.0
While on
0.11.13
, it looks like if you set that tag on the pipeline, it will be applied to all solids and then run worker. Which is probably not quite what you want
k

Kirk Stennett

01/07/2022, 10:13 PM
Perfect, thanks! We'll be updating to that soon.
j

johann

01/07/2022, 10:15 PM
back on the update track
The executor has been getting more stable, but there have been some recent bugfixes even up to 0.13.13. There’s no migration required from 0.12 to 0.13, so you could consider the jump
k

Kirk Stennett

01/07/2022, 10:19 PM
I've been pleased with the executor so far even on this version. Are the naming changes for solids / pipelines not enforced in 0.13? We haven't updated to ops/jobs yet
j

johann

01/07/2022, 10:19 PM
It’s fully backwards compatible, there will just be a legacy icon on them in dagit
💯 1
k

Kirk Stennett

01/07/2022, 10:24 PM
Awesome! Then I will definitely be making moves to that ASAP. Any recommendations on update path? I was going to do 0.11.13 -> 0.11.16 -> 0.12.0 -> 0.12.X -> 0.13.0. But it sounds like if there's no migration I can just do 0.12.0 -> 0.13.0?
j

johann

01/07/2022, 10:27 PM
You may actually be able to just go to the latest 0.13 and run the migration from there. cc @daniel, is a stop on 0.12 needed?
d

daniel

01/07/2022, 10:28 PM
yeah, a single upgrade from 0.11 to 0.13 should be fine
👍 1
k

Kirk Stennett

01/07/2022, 10:28 PM
Wow that's awesome! Thanks a bunch guys, I'll get on that
d

daniel

01/07/2022, 10:28 PM
always a good idea to backup just in case, but the schema migration should be able to start at 0.11 and end on 0.13
j

johann

01/07/2022, 10:29 PM
Also note the upgrade doesn’t need to be to 0.13.0, any dot version should be fine
👍 1