-
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(api): Refactor API server to introduce support for Docker image …
…registries and s3 bucket support (#605) ## Note 🚨 ~~This PR should not be merged without the changes in caraml-dev/mlp#116 being merged, published and imported as dependencies first. This PR is currently only using a branch of a fork (the source of the quoted PR) of the MLP repository.~~ The dependent PR has been merged. # Description In order to provide support for using image registries that use [Docker registry credentials](https://docs.docker.com/reference/cli/docker/login/#configure-the-credential-store) as well as [AWS S3-based blob storage services](https://docs.aws.amazon.com/code-library/latest/ug/go_2_s3_code_examples.html), this PR refactors the API server to support these additional image registry and bob storage options. More concretely, these are the following changes made: - Set up the workflow needed to allow platform maintainers to configure the image registry that the API server will push images to (Docker or Google Cloud/Artifact Registry) as well as the blob storage service that it should read model artifacts from/write files to (S3-based store/Google Cloud Storage) - Allow the API server to access a configured Docker registry to check if an image is available - Allow the API server to check and hash model dependencies in a configured S3-based store - Allow Kaniko jobs spun up by the API server to use load model artifacts from a configured S3-based store when building model images - Allow Kaniko jobs spun up by the API server to push images to the configured Docker registry # Modifications - `api/cmd/api/setup.go` - Make the initialisation of the image builder set up the artifact service type and docker registry correctly depending on the one set up - `api/config/config.go` - Introduce new configs for platform maintainers to specify the `KanikoPushRegistryType` and the `KanikoDockerCredentialSecretName` - `api/pkg/imagebuilder/imagebuilder.go` - Make changes to the image builder to configure the Kaniko job spec correctly depending on the selected registry type and blob storage type - `python/batch-predictor/docker/app.Dockerfile` - Add steps to the batch predictor docker image to authenticate and pull model artifacts correctly depending on the configured blob storage type - `python/batch-predictor/docker/base.Dockerfile` - Add steps to the base batch predictor image to install the AWS CLI - `python/pyfunc-server/docker/Dockerfile` - Add steps to the pyfunc server docker image to authenticate and pull model artifacts correctly depending on the configured blob storage type - `python/pyfunc-server/docker/base.Dockerfile` - Add steps to the base pyfunc server image to install the AWS CLI # 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
7f7d42c
commit 875b77f
Showing
18 changed files
with
786 additions
and
376 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.