Michel Rouly
05/10/2023, 4:18 AMK8sRunLauncher
. Is it possible to configure the K8sRunLauncher
to set certain specific metadata on run pods only, but not on step pods?Michel Rouly
05/10/2023, 4:19 AMMichel Rouly
05/10/2023, 4:20 AMfargate=true
on the Dagster user code location server, every pod it schedules (run and step) will get fargate=true
because of includeConfigInLaunchedRuns
Michel Rouly
05/10/2023, 4:21 AMk8sRunLauncher: {
// labels: {
// fargate: 'true',
// },
// runK8sConfig: {
// podTemplateSpecMetadata: {
// labels: {
// fargate: 'true',
// }
// }
// },
Michel Rouly
05/10/2023, 4:31 AMk8s_job_executor
inheriting some configurations from the K8sRunLauncher
possibly? since it's technically the executor that's responsible for scheduling step podsMichel Rouly
05/10/2023, 4:32 AMpipelineRun
value in the Helm chart that might be relevant but I can't quite figure it out yetMichel Rouly
05/10/2023, 4:44 AMMichel Rouly
05/10/2023, 4:47 AMdaniel
05/10/2023, 2:44 PMMichel Rouly
05/10/2023, 3:09 PMMichel Rouly
05/10/2023, 10:53 PMK8sRunLauncher
with this:
class EksFargateRunLauncher(K8sRunLauncher):
def get_container_context_for_run(self, dagster_run: DagsterRun) -> K8sContainerContext:
container_context = super().get_container_context_for_run(dagster_run)
container_context.labels["fargate"] = "true"
return container_context
and configured it appropriately as the custom run launcher for Dagit/Daemon via the Dagster Helm chart. Packaged it up in a custom Docker image and everything.
It even appropriately schedules runs on Fargate (yay!!).Michel Rouly
05/10/2023, 10:54 PMMichel Rouly
05/10/2023, 10:56 PMdagster._check.CheckError: Failure condition: Couldn't import module lib_dagster.aws.eks when attempting to load the configurable class lib_dagster.aws.eks.EksFargateRunLauncher
this gets thrown after the run pod is scheduled and started up.
I'm fairly certain this means Dagit/Daemon are working OK since the run pod even got scheduled. And that it's the run pod which, for whatever reason, needs to have a copy of the run launcher?Michel Rouly
05/10/2023, 11:04 PMMichel Rouly
05/10/2023, 11:04 PMfargate
label from themMichel Rouly
05/10/2023, 11:07 PMK8sRunLauncher
configured to pass fargate=true
for run pods
• running user code locations on Fargate
• subclassing the k8s_job_executor
instead to ignore fargate=true
unfortunately this means I'll need to use a custom executor in my downstream Dagster code locations which I think is probably lower impact to users than mucking with job tags. since there's only one Definitions per location, but there are potentially many jobs per location.Michel Rouly
05/11/2023, 12:12 AM@configured(dagster_k8s_job_executor, config_schema=dagster_k8s_job_executor.config_schema)
def k8s_job_executor(config: dict) -> dict:
return {
**config,
"labels": {
# Disable Fargate for step pods unless requested. Otherwise, the K8s executor will cheerfully inherit
# Fargate settings from the user code deployment and/or the run launcher.
"fargate": "false",
**config.get("labels", {}),
},
}