Skip to content

Commit 9c5b72c

Browse files
authored
feat(backend): Allow recurring runs to always use the latest pipeline version (kubeflow#11560)
* Allow recurring runs to always use the latest pipeline version This makes the pipeline_version_id optional and makes the Scheduled Workflow controller levarege the REST API to launch the run rather than rely on compiled Argo Workflows stored in the ScheduledWorkflow object. The previous behavior is preserved if the user is using the v1 API or specifies a pipeline version ID or pipeline spec manifest. Resolves: kubeflow#11542 Signed-off-by: mprahl <[email protected]> * Add instructions to debug the SWF controller Signed-off-by: mprahl <[email protected]> --------- Signed-off-by: mprahl <[email protected]>
1 parent 915cc55 commit 9c5b72c

35 files changed

+459
-131
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,8 @@ __pycache__
8686
# kfp local execution default directory
8787
local_outputs/
8888

89+
# Ignore the Kind cluster kubeconfig
90+
kubeconfig_dev-pipelines-api
91+
8992
# Ignore debug Driver Dockerfile produced from `make -C backend image_driver_debug`
9093
backend/Dockerfile.driver-debug

backend/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,39 @@ You can also directly connect to the MariaDB database server with:
159159
mysql -h 127.0.0.1 -u root
160160
```
161161

162+
### Scheduled Workflow Development
163+
164+
If you also want to run the Scheduled Workflow controller locally, stop the controller on the cluster with:
165+
166+
```bash
167+
kubectl -n kubeflow scale deployment ml-pipeline-scheduledworkflow --replicas=0
168+
```
169+
170+
Then you may leverage the following sample `.vscode/launch.json` file to run the Scheduled Workflow controller locally:
171+
172+
```json
173+
{
174+
"version": "0.2.0",
175+
"configurations": [
176+
{
177+
"name": "Launch Scheduled Workflow controller (Kind)",
178+
"type": "go",
179+
"request": "launch",
180+
"mode": "debug",
181+
"program": "${workspaceFolder}/backend/src/crd/controller/scheduledworkflow",
182+
"env": {
183+
"CRON_SCHEDULE_TIMEZONE": "UTC"
184+
},
185+
"args": [
186+
"-namespace=kubeflow",
187+
"-kubeconfig=${workspaceFolder}/kubeconfig_dev-pipelines-api",
188+
"-mlPipelineAPIServerName=localhost"
189+
]
190+
}
191+
]
192+
}
193+
```
194+
162195
### Remote Debug the Driver
163196

164197
These instructions assume you are leveraging the Kind cluster in the

backend/api/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
IMAGE_TAG=kfp-api-generator
1818
# Contact chensun or zijianjoy if this remote image needs an update.
1919
REMOTE_IMAGE=ghcr.io/kubeflow/kfp-api-generator
20+
# Assume the latest API version by default.
21+
API_VERSION ?= v2beta1
2022

2123
# Keep in sync with the version used in test/release/Dockerfile.release
2224
PREBUILT_REMOTE_IMAGE=ghcr.io/kubeflow/kfp-api-generator:1.0

backend/api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Tools needed:
1212
Set the environment variable `API_VERSION` to the version that you want to generate. We use `v1beta1` as example here.
1313

1414
```bash
15-
export API_VERSION="v1beta1"
15+
export API_VERSION="v2beta1"
1616
```
1717

1818
## Compiling `.proto` files to Go client and swagger definitions

backend/api/v1beta1/job.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ message Job {
210210
// Optional input field. Describing the purpose of the job
211211
string description = 3;
212212

213-
// Required input field.
213+
// Optional input field.
214214
// Describing what the pipeline manifest and parameters to use
215-
// for the scheduled job.
215+
// for the scheduled job. If unset, fetch the pipline_spec at runtime.
216216
PipelineSpec pipeline_spec = 4;
217217

218218
// Optional input field. Specify which resource this job belongs to.

backend/api/v2beta1/go_client/recurring_run.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/api/v2beta1/go_client/run.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/api/v2beta1/go_http_client/recurring_run_model/v2beta1_pipeline_version_reference.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/api/v2beta1/go_http_client/run_model/v2beta1_pipeline_version_reference.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/api/v2beta1/go_http_client/run_model/v2beta1_run.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)