Hi everyone, firstly just want to say what an awes...
# announcements
h
Hi everyone, firstly just want to say what an awesome product you have created here. I have a question regarding the celery-k8s-job-executor. Is it possible to set k8s pod limits and requests per pipeline config when using this executor? If so how would one do it? Would be great to be able to do this so we can specify for example gpu pod resources.
j
Hi Hugo, you can specify k8s resource requests and node affinities via solid tags
Example from our release notes (we just added node affinities so the config isn’t in the docs yet): New
dagster-k8s/config
tag that lets users pass in custom configuration to the Kubernetes
Job
,
Job
metadata,
JobSpec
,
PodSpec
, and
PodTemplateSpec
metadata. • This allows users to specify settings like eviction policy annotations and node affinities. • Example:
Copy code
@solid(
    tags = {
      'dagster-k8s/config': {
        'container_config': {
          'resources': {
            'requests': { 'cpu': '250m', 'memory': '64Mi' },
            'limits': { 'cpu': '500m', 'memory': '2560Mi' },
          }
        },
        'pod_template_spec_metadata': {
          'annotations': { "<http://cluster-autoscaler.kubernetes.io/safe-to-evict|cluster-autoscaler.kubernetes.io/safe-to-evict>": "true"}
        },
        'pod_spec_config': {
          'affinity': {
            'nodeAffinity': {
              'requiredDuringSchedulingIgnoredDuringExecution': {
                'nodeSelectorTerms': [{
                  'matchExpressions': [{
                    'key': '<http://beta.kubernetes.io/os|beta.kubernetes.io/os>', 'operator': 'In', 'values': ['windows', 'linux'],
                  }]
                }]
              }
            }
          }
        },
      },
    },
  )
  def my_solid(context):
    <http://context.log.info|context.log.info>('running')
per pipeline config
Unfortunately we currently just do this per solid. If you use the syntax on a pipeline tag, it will apply to the run coordinator pod. If you’d like to make a github issue for the feature that would be great!
h
this is awesome, thanks for the reply, its even better at the solid level than in the pipeline config so this seems like it covers what I need
👍 1