Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): Refactor API server to introduce support for Docker image registries and s3 bucket support #605

Merged
merged 32 commits into from
Nov 8, 2024

Conversation

deadlycoconuts
Copy link
Contributor

@deadlycoconuts deadlycoconuts commented Sep 12, 2024

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 as well as AWS S3-based blob storage services, 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

Checklist

  • Added PR label
  • Added unit test, integration, and/or e2e tests
  • 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

NONE

@deadlycoconuts deadlycoconuts self-assigned this Sep 12, 2024
@deadlycoconuts deadlycoconuts added the enhancement New feature or request label Sep 12, 2024
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.71%. Comparing base (0877a4f) to head (7d30742).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #605      +/-   ##
==========================================
- Coverage   60.68%   59.71%   -0.98%     
==========================================
  Files         277      277              
  Lines       22245    26043    +3798     
==========================================
+ Hits        13500    15551    +2051     
- Misses       7877     9625    +1748     
+ Partials      868      867       -1     
Flag Coverage Δ
api-test 57.90% <ø> (-0.76%) ⬇️
sdk-test-3.10 75.51% <ø> (ø)
sdk-test-3.8 75.49% <ø> (ø)
sdk-test-3.9 75.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@deadlycoconuts deadlycoconuts force-pushed the refactor_away_google_deps branch 4 times, most recently from c383ac1 to 3710fc2 Compare September 13, 2024 06:58
api/cmd/api/setup.go Outdated Show resolved Hide resolved
api/go.mod Outdated Show resolved Hide resolved
@deadlycoconuts deadlycoconuts marked this pull request as ready for review September 20, 2024 03:55
api/cmd/api/setup.go Outdated Show resolved Hide resolved
api/pkg/imagebuilder/imagebuilder.go Outdated Show resolved Hide resolved
api/pkg/imagebuilder/imagebuilder.go Outdated Show resolved Hide resolved
api/pkg/imagebuilder/imagebuilder.go Outdated Show resolved Hide resolved
api/pkg/imagebuilder/imagebuilder.go Outdated Show resolved Hide resolved
python/batch-predictor/docker/app.Dockerfile Show resolved Hide resolved
@deadlycoconuts
Copy link
Contributor Author

Thanks a lot for the comments @tiopramayudi and @bthari ! I should've covered and addressed all of the outstanding comments. If all looks good feel free to approve it again otherwise let me know what additional changes we should include and I'll get back to it. Thanks once again!

@deadlycoconuts
Copy link
Contributor Author

Thanks for the re-review @bthari! I'll keep this PR open a little while longer if Tio wants to look at the part I added to the Merlin SDK to allow users to download the Merlin model files from an s3-configured Mlflow blob store. Otherwise I'll merge this by tomorrow! :D

@deadlycoconuts deadlycoconuts merged commit 875b77f into main Nov 8, 2024
33 checks passed
@deadlycoconuts deadlycoconuts deleted the refactor_away_google_deps branch November 8, 2024 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants