-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(image-builder): Add field to allow api server env vars to be pro…
…pagated to kaniko jobs (#621) # Description This PR introduces a new mechanism for environment variables from the Merlin API server to be propagated to **_the build environment of the Kaniko build jobs_** that it spins up, reducing the need for redundant repetition of configuration, especially if these environment variables are common to both the Merlin API server and the build environment of the Kaniko build jobs. Since these variables are passed to the Kaniko build jobs as build arguments (as opposed to environment variables of the container where the image gets built; see GoogleContainerTools/kaniko#2824 for more details), these variables get passed as additional arguments in the Kaniko build job. This PR additionally introduces a cluster connectivity check (done by a simple list pods operation) for the image builder to ensure that the cluster controller has been successfully initialised at start up of the Merlin API server, instead of allowing errors to only be thrown when an image building job has been triggered. # Modifications - `api/cmd/api/setup.go` - Addition of a connectivity check during initialisation of the image builder - `api/pkg/imagebuilder/imagebuilder.go` - Addition of a step to add Merlin API server environment variables as Kaniko build args # Tests <!-- Besides the existing / updated automated tests, what specific scenarios should be tested? Consider the backward compatibility of the changes, whether corner cases are covered, etc. Please describe the tests and check the ones that have been completed. Eg: - [x] Deploying new and existing standard models - [ ] Deploying PyFunc models --> # Checklist - [x] Added PR label - [x] Added unit test, integration, and/or e2e tests - [x] Tested locally - [ ] Updated documentation - [ ] Update Swagger spec if the PR introduce API changes - [ ] Regenerated Golang and Python client if the PR introduces API changes # Release Notes <!-- Does this PR introduce a user-facing change? If no, just write "NONE" in the release-note block below. If yes, a release note is required. Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". For more information about release notes, see kubernetes' guide here: http://git.k8s.io/community/contributors/guide/release-notes.md --> ```release-note NONE ```
- Loading branch information
1 parent
4e1804e
commit 18945d2
Showing
6 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters