diff --git a/src/fondant/compiler.py b/src/fondant/compiler.py index e1161fcf7..0e8b3290c 100644 --- a/src/fondant/compiler.py +++ b/src/fondant/compiler.py @@ -303,12 +303,13 @@ def kfp_pipeline(): def _set_configuration(self, task, fondant_component_operation): # Unpack optional specifications number_of_gpus = fondant_component_operation.number_of_gpus + node_pool_label = fondant_component_operation.node_pool_label node_pool_name = fondant_component_operation.node_pool_name # Assign optional specification if number_of_gpus is not None: task.set_gpu_limit(number_of_gpus) - if node_pool_name is not None: - task.add_node_selector_constraint("node_pool", node_pool_name) + if node_pool_name is not None and node_pool_label is not None: + task.add_node_selector_constraint(node_pool_label, node_pool_name) return task diff --git a/tests/example_pipelines/compiled_pipeline/kubeflow_pipeline.yml b/tests/example_pipelines/compiled_pipeline/kubeflow_pipeline.yml index 5795cda60..68a2a0f78 100644 --- a/tests/example_pipelines/compiled_pipeline/kubeflow_pipeline.yml +++ b/tests/example_pipelines/compiled_pipeline/kubeflow_pipeline.yml @@ -87,7 +87,7 @@ spec: pipelines.kubeflow.org/pipeline-sdk-type: kfp name: first-component nodeSelector: - node_pool: a_node_pool + a_node_pool_label: a_node_pool outputs: artifacts: - name: first-component-output_manifest_path