Description:
The goal is to automate the execution of Kubeflow pipelines through GitLab. However, I am encountering issues when attempting to connect to and launch runs in the Pipelines client from GitLab CI/CD.
When running the pipeline/pipeline_run.py script in the GitLab CI/CD pipeline, I encounter the following error:
ERROR:root:Failed to read a token from file '/var/run/secrets/kubeflow/pipelines/token' ([Errno 2] No such file or directory: '/var/run/secrets/kubeflow/pipelines/token').
Configure GitLab Runner with Kubernetes executor and necessary permissions.
Create a .gitlab-ci.yml file in gitlab
Run the pipeline in GitLab CI/CD and observe the error
Environment
Kubernetes Setup: Single-node Kubernetes cluster set up with kubeadm
Kubernetes Version: v1.29.3
Kubeflow Version: Installed using kustomize with the following components:
Kubeflow Pipelines: 2.2.0
GitLab Runner Version: 16.11.0
GitLab Runner Helm Chart Version: 0.64.0
KFP Python SDK Version: 2.4.0
Relevant Log Output
ERROR:root:Failed to read a token from file '/var/run/secrets/kubeflow/pipelines/token' ([Errno 2] No such file or directory: '/var/run/secrets/kubeflow/pipelines/token').
Additional Context
I referred to GitHub issue Notebook cannot implicitly connect to/launch runs in the Pipelines client #423 for methods to resolve a similar issue in a notebook. Based on this, I attempted to use PodDefault for configuration. However, while this method worked when using the Jupyter notebook client, it did not work with GitLab Runner.
Correctly generating a token with the appropriate audience for the Kubeflow pipeline.
Ensuring that the GitLab Runner mounts this token correctly for CI/CD pipeline runs.
Any guidance or suggestions on how to resolve this issue would be greatly appreciated. Thank you!
Bug Description
Description: The goal is to automate the execution of Kubeflow pipelines through GitLab. However, I am encountering issues when attempting to connect to and launch runs in the Pipelines client from GitLab CI/CD.
When running the pipeline/pipeline_run.py script in the GitLab CI/CD pipeline, I encounter the following error:
ERROR:root:Failed to read a token from file '/var/run/secrets/kubeflow/pipelines/token' ([Errno 2] No such file or directory: '/var/run/secrets/kubeflow/pipelines/token').
.gitlab-ci.yml Configuration
pipeline/pipeline_run.py Content
To Reproduce
Environment
Relevant Log Output
Additional Context
I referred to GitHub issue Notebook cannot implicitly connect to/launch runs in the Pipelines client #423 for methods to resolve a similar issue in a notebook. Based on this, I attempted to use PodDefault for configuration. However, while this method worked when using the Jupyter notebook client, it did not work with GitLab Runner.
Troubleshooting Steps Taken:
Created PodDefault in gitlab-runner namespace:
Granted necessary permissions:
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: gitlab-runner-kf-view-binding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: kubeflow-pipelines-view subjects:
Request for Assistance: I am seeking help on: