Page MenuHomeElementl

[helm] Add k8s fields to pydantic schema
ClosedPublic

Authored by sidkmenon on Jun 17 2021, 7:21 PM.
Tags
None
Referenced Files
F2438774: D8439.id39983.diff
Tue, Aug 16, 5:58 PM
F2438772: D8439.id.diff
Tue, Aug 16, 5:58 PM
F2438288: D8439.id39930.diff
Tue, Aug 16, 1:02 PM
Unknown Object (File)
Mon, Aug 15, 10:50 PM
Unknown Object (File)
Mon, Aug 15, 7:55 AM
Unknown Object (File)
Sat, Aug 13, 7:19 PM
Unknown Object (File)
Fri, Aug 12, 9:32 AM
Unknown Object (File)
Fri, Aug 12, 6:50 AM
Subscribers

Details

Summary

Adding more k8s fields to the pydantic schema, including InitContainers & VolumeMounts.

Test Plan

helm lint + bk

Diff Detail

Repository
R1 dagster
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

sidkmenon held this revision as a draft.

Also increase number of retires on helm checks since that appears to be a problem

helm/dagster/schema/schema/charts/utils/kubernetes.py
99–101

we shouldn't be adding fields to these classes - the point is that they exactly match the kubernetes object that they represent (as expressed through schema extra)

sidkmenon added a child revision: Restricted Differential Revision.Jun 18 2021, 7:39 AM

responding to @rexledesma's comments

helm/dagster/schema/schema/charts/utils/kubernetes.py
99–101

Ah ok - I saw some classes with fields and some without, so wasn't sure. I'll remove them.

helm/dagster/schema/schema/charts/utils/kubernetes.py
99–101

Decided to refrain from schema_extra here since InitContainer isn't supported by the JSON schema API we use - was thinking about trying to hand-roll some validation hooks to show the difference between this and Container but to keep things simple decided to just provide these fields for now.

johann added inline comments.
.buildkite/dagster-buildkite/dagster_buildkite/steps/helm.py
51

What causes the flakes?

helm/dagster/schema/schema/charts/utils/kubernetes.py
99–101

Looks like they type InitContainer as Container in https://kubernetesjsonschema.dev/v1.15.0/_definitions.json - let's just use Container as the schema for InitContainer to keep it simple.

Allowing for imagePullPolicy as well

Based on discussion with @rexledesma, refactoring to just use Container as a schema

.buildkite/dagster-buildkite/dagster_buildkite/steps/helm.py
51

400s from the JSON schema endpoint we use

This revision is now accepted and ready to land.Jun 18 2021, 9:50 PM