Skip to content

Commit 1b0e653

Browse files
authored
docs: add GoLand-specific configs to backend Readme (kubeflow#11919)
Updates V2_DRIVER_COMMAND argument and adds runtime arguments for starting a remote debug session in GoLand. Signed-off-by: agoins <[email protected]>
1 parent 6c32514 commit 1b0e653

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

backend/README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ docker build -f backend/Dockerfile . --tag $API_SERVER_IMAGE
3535
```
3636
### Deploying the APIServer (from the image you built) on Kubernetes
3737

38-
First, push your image to a registry that is accessible from your Kubernetes cluster.
38+
First, push your image to a registry that is accessible from your Kubernetes cluster.
3939

4040
Then, run:
4141
```
@@ -218,6 +218,7 @@ make -C kind-build-and-load-driver-debug
218218
You may use the following VS Code `launch.json` file to run the API server which overrides the Driver
219219
command to use Delve and the Driver image to use debug image built previously.
220220

221+
VSCode configuration:
221222
```json
222223
{
223224
"version": "0.2.0",
@@ -246,6 +247,26 @@ command to use Delve and the Driver image to use debug image built previously.
246247
}
247248
```
248249

250+
GoLand configuration:
251+
1. Create a new Go Build configuration
252+
2. Set **Run Kind** to Directory and set **Directory** to /backend/src/apiserver absolute path
253+
3. Set the following environment variables
254+
255+
| Argument | Value |
256+
|----------------------------------------------|-----------|
257+
| POD_NAMESPACE | kubeflow |
258+
| DBCONFIG_MYSQLCONFIG_HOST | localhost |
259+
| MINIO_SERVICE_SERVICE_HOST | localhost |
260+
| MINIO_SERVICE_SERVICE_PORT | 9000 |
261+
| METADATA_GRPC_SERVICE_SERVICE_HOST | localhost |
262+
| METADATA_GRPC_SERVICE_SERVICE_PORT | 8080 |
263+
| ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_HOST | localhost |
264+
| ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_PORT | 8888 |
265+
| V2_LAUNCHER_IMAGE | localhost |
266+
| V2_DRIVER_IMAGE | localhost |
267+
| V2_DRIVER_COMMAND | dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec /bin/driver -- |
268+
4. Set the following program arguments: --config ./backend/src/apiserver/config -logtostderr=true --sampleconfig ./backend/src/apiserver/config/test_sample_config.json
269+
249270
#### Starting a Remote Debug Session
250271

251272
Start by launching a pipeline. This will eventually create a Driver pod that is waiting for a remote debug connection.
@@ -266,6 +287,7 @@ kubectl -n kubeflow port-forward <driver pod name> 2345:2345
266287
Set a breakpoint on the Driver code in VS Code. Then remotely connect to the Delve debug session with the following VS
267288
Code `launch.json` file:
268289

290+
VSCode configuration:
269291
```json
270292
{
271293
"version": "0.2.0",
@@ -283,6 +305,11 @@ Code `launch.json` file:
283305
}
284306
```
285307

308+
GoLand configuration:
309+
1. Create a new Go Remote configuration and title it "Delve debug session"
310+
2. Set **Host** to localhost
311+
3. Set **Port** to 2345
312+
286313
Once the Driver pod succeeds, the remote debug session will close. Then repeat the process of forwarding the port
287314
of subsequent Driver pods and starting remote debug sessions in VS Code until the pipeline completes.
288315

@@ -295,7 +322,7 @@ pod.
295322

296323
The Kubeflow Pipelines API server typically runs over HTTPS when deployed in a Kubernetes cluster. However, during local development, it operates over HTTP, which Kubernetes admission webhooks do not support (they require HTTPS). This incompatibility prevents webhooks from functioning correctly in a local Kind cluster.
297324

298-
To resolve this, a webhook proxy acts as a bridge, allowing webhooks to communicate with the API server even when it runs over HTTP.
325+
To resolve this, a webhook proxy acts as a bridge, allowing webhooks to communicate with the API server even when it runs over HTTP.
299326

300327
This is used by default when using the `dev-kind-cluster` Make target.
301328

@@ -307,13 +334,11 @@ Run the following to delete the cluster (once you are finished):
307334
kind delete clusters dev-pipelines-api
308335
```
309336

310-
## Contributing
337+
## Contributing
311338
### Code Style
312-
339+
313340
Backend codebase follows the [Google's Go Style Guide](https://google.github.io/styleguide/go/). Please, take time to get familiar with the [best practices](https://google.github.io/styleguide/go/best-practices). It is not intended to be exhaustive, but it often helps minimizing guesswork among developers and keep codebase uniform and consistent.
314341

315342
We use [golangci-lint](https://golangci-lint.run/) tool that can catch common mistakes locally (see detailed configuration [here](https://github.com/kubeflow/pipelines/blob/master/.golangci.yaml)). It can be [conveniently integrated](https://golangci-lint.run/usage/integrations/) with multiple popular IDEs such as VS Code or Vim.
316343

317344
Finally, it is advised to install [pre-commit](https://pre-commit.com/) in order to automate linter checks (see configuration [here](https://github.com/kubeflow/pipelines/blob/master/.pre-commit-config.yaml))
318-
319-

0 commit comments

Comments
 (0)