pipelines/backend
Ajay Gopinathan a882999c42 Use Remote Build Execution for Bazel builds. (#1031)
* [WIP] Use Remote Build Execution for Bazel builds.

* Add build_api_server.sh build script for API server.

* update build_image.yaml

* update build_image.yaml

* update build_image.yaml

* update build_image.yaml

* update build_image.yaml

* update build_image.yaml

* escape newlines

* Try using bazelbuilder's service account credentials.

* Clean up

* Add README

* Update backend README

* Update OWNERS
2019-09-30 10:41:38 -07:00
..
api Add necessary data types to api and database to support pipeline version. (#1873) 2019-09-25 23:59:07 -07:00
src Add necessary data types to api and database to support pipeline version. (#1873) 2019-09-25 23:59:07 -07:00
test Add e2e visualization tests (#1981) 2019-08-30 13:54:10 -07:00
Dockerfile Use Remote Build Execution for Bazel builds. (#1031) 2019-09-30 10:41:38 -07:00
Dockerfile.persistenceagent Garbage collect the completed workflow after persisted to database (#1802) 2019-08-12 23:53:18 -07:00
Dockerfile.scheduledworkflow skip storing log to files (#1788) 2019-08-10 11:20:26 -07:00
Dockerfile.viewercontroller skip storing log to files (#1788) 2019-08-10 11:20:26 -07:00
Dockerfile.visualization Improve visualization server docker image (#2003) 2019-08-30 12:48:23 -07:00
OWNERS Update backend owner file (#2164) 2019-09-19 13:24:35 +08:00
README.md Use Remote Build Execution for Bazel builds. (#1031) 2019-09-30 10:41:38 -07:00
build_api_server.sh Use Remote Build Execution for Bazel builds. (#1031) 2019-09-30 10:41:38 -07:00

README.md

This directory contains code for the components that comprise the Kubeflow Pipelines backend.

Building & Testing

All components can be built using Bazel. To build everything under backend, run: bazel build --action_env=PATH --define=grpc_no_ares=true //backend/...

To run all tests: bazel test --action_env=PATH --define=grpc_no_ares=true //backend/...

The API server itself can only be built/tested using Bazel. The following commands target building and testing just the API server. bazel build --action_env=PATH --define=grpc_no_ares=true backend/src/apiserver/... bazel test --action_env=PATH --define=grpc_no_ares=true backend/src/apiserver/...

Building APIServer Image using Remote Build Execution

If you are a dev in the Kubeflow Pipelines team, you can use Remote Build Execution Service to build the API Server image using Bazel with use of a shared cache for speeding up the build. To do so, execute the following command:

./build_api_server.sh -i gcr.io/cloud-ml-pipelines-test/api-server:dev

Building Go client library and swagger files

After making changes to proto files, the Go client libraries and swagger files need to be regenerated and checked-in. The backend/api/generate_api.sh script takes care of this.

Updating BUILD files

As the backend is written in Go, the BUILD files can be updated automatically using Gazelle. Whenever a Go file is added or updated, run the following to ensure the BUILD files are updated as well: bazel run //:gazelle

If a new external Go dependency is added, or an existing one has its version bumped in the go.mod file, ensure the BUILD files pick this up by updating the WORKSPACE go_repository rules using the following command: bazel run //:gazelle -- update-repos --from_file=go.mod