- Notifications
You must be signed in to change notification settings - Fork 402
feat: Support custom predictor Docker image builds on non-x86 architectures #2115
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: Support custom predictor Docker image builds on non-x86 architectures #2115
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
37abc45
to 9c37f8e
Compare 9c37f8e
to 4d5d703
Compare Not sure how to tag to trigger unit tests or who to ping. @sararob, I hope this isn't a bother, and please no rush. I'm Teo and I'm a first-time contributor to this project. Maybe I missed something in the different contributing docs on how to move a PR forward to the unit test/review stage. Since you've had some recent activity on |
pip_command: str = "pip", | ||
python_command: str = "python", | ||
no_cache: bool = True, | ||
platform: str = "linux/amd64", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would prefer this flag to be set by users, rather providing a universal default.
Could we update the default to be None?
4d5d703
to 811c0e1
Compare Hi, can someone help taking a look at this? I would imagine you would like to support all the users using new Apple machines... @abcdefgs0324 or is there a better/correct way to do this? |
@rragundez if it helps I can also push the change suggested by @abcdefgs0324 (assuming it still applies?) |
To enforce the flag is set by users as opposed to providing a universal default. - See: googleapis#2115 (comment)
To enforce the flag is set by users as opposed to providing a universal default. - See: googleapis#2115 (comment)
f7217ff
to 6482c3c
Compare 26b6049
to 1e6bdea
Compare Hi @TeoZosa @abcdefgs0324, would you be kindly able to help to move this PR forward? Our local deployment is blocked by this issue for Mac users and we have some urgent use cases that want to fulfill. Really appreciate your help! |
@frankcaoyun Would love to have this merged. I wonder if @abcdefgs0324 is still assigned to this. I'll look for another active maintainer to ping so we can move this forward. |
Thanks for the prompt reply @TeoZosa ! |
@frankcaoyun we reached out to GCP solutions engineers who are reaching out to the Vertex AI team. Hopefully we can get movement on this in the next week. |
Thanks for the update! Frank …On Thu, 6 Feb 2025, 19:16 Teofilo Zosa, ***@***.***> wrote: @frankcaoyun <https://github.com/frankcaoyun> we reached out to GCP solutions engineers who are reaching out to the Vertex AI team. Hopefully we can get movement on this in the next week. — Reply to this email directly, view it on GitHub <#2115 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AVG3DDJIX7GO5D7VZ2KGAZ32ONAAFAVCNFSM6AAAAABLDV2CUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZZGUZTINRQGE> . You are receiving this because you were mentioned.Message ID: ***@***.***> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, missed this for a long time. Do you mind adding unit tests?
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache | ||
for more details. | ||
platform (str): | ||
Required. The target platform for the Docker image build. See |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional.
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache | ||
for more details. | ||
platform (str): | ||
Required. The target platform for the Docker image build. See |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional.
To enforce the flag is set by users as opposed to providing a universal default. - See: googleapis#2115 (comment)
f65b061
to b4f6095
Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Could you fix the unit tests and maybe add a test case to https://github.com/googleapis/python-aiplatform/blob/main/tests/unit/aiplatform/test_prediction.py? |
Resolves (partially): - googleapis#2115 (comment)
Resolves (partially): - googleapis#2115 (comment)
aeb0bde
to d8a3d2f
Compare
@abcdefgs0324 Done. Thanks for the patience. It's been a while, and I forgot that we can run tests outside of CI 🙇 . Let me know if the changes in b4f6095...d8a3d2f make sense. |
-- Enforce Linux `x86_64` Docker image builds. Under the assumption that only machine types with x86 processors are supported for prediction and custom training. Extract Docker build platform arg to method parameter. COPYBARA_INTEGRATE_REVIEW=#2115 PiperOrigin-RevId: 735416705
…ctures (googleapis#2115) * Enforce Linux `x86_64` Docker image builds Under the assumption that only machine types with x86 processors are supported for prediction and custom training. * Extract Docker build platform arg to method parameter While currently only x86 processors are supported for prediction and custom training, this will allow users to control this behavior should that ever change in the future. Additionally, it allows users to, e.g., override the `TARGETOS` component of the `TARGETPLATFORM`. * Change platform default arg to `None` To enforce the flag is set by users as opposed to providing a universal default. - See: googleapis#2115 (comment) * Make platform configurable from `LocalModel.build_cpr_model()` To enable the flag to be set by users (e.g., to build images on non-x86 architectures). * Fix docstring for `platform` param Resolves: - googleapis#2115 (comment) - googleapis#2115 (comment) * Test platform parameter in `test_build_cpr_model_upload_and_deploy()` Resolves: - googleapis#2115 (review) * Fix tests Resolves (partially): - googleapis#2115 (comment) * Test specifying platform in local model builds Resolves (partially): - googleapis#2115 (comment) * Test other platform strings in local model builds --------- Co-authored-by: Chun-Hsiang Wang <chunhsiang@google.com>
-- Enforce Linux `x86_64` Docker image builds. Under the assumption that only machine types with x86 processors are supported for prediction and custom training. Extract Docker build platform arg to method parameter. COPYBARA_INTEGRATE_REVIEW=googleapis#2115 PiperOrigin-RevId: 735416705
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Note: do not merge your PR from GitHub. Adding the "ready to pull" label is the final step in the review process.
After approvals, the changes in your PR will be committed to the
main
branch and this PR will be closed.Fixes 🦕:
What
Allows users the ability to specify for which platform their custom predictor's Docker image should be built.
linux/amd64
Warning
I would imagine that, in an ideal world, we should be testing this on compatible non-x86 systems (e.g.,
arm64
andaarch64
)?Copilot-generated summary
This pull request introduces support for specifying a target platform when building Docker images and models. The changes involve updates to the `build_image` and `build_cpr_model` functions, as well as modifications to the corresponding test cases to accommodate the new `platform` parameter.Key changes include:
Docker Image Building Enhancements:
platform
parameter to thebuild_image
function ingoogle/cloud/aiplatform/docker_utils/build.py
. This allows users to specify the target platform for the Docker image build. [1] [2] [3]Model Building Enhancements:
platform
parameter to thebuild_cpr_model
function ingoogle/cloud/aiplatform/prediction/local_model.py
. This parameter allows users to specify the target platform for building the local model Docker image. [1] [2] [3] [4]Testing Enhancements:
test_build_cpr_model_upload_and_deploy
test case intests/system/aiplatform/test_prediction_cpr.py
to include aplatform
parameter, allowing the test to run for different platforms. [1] [2]Why
For library compatibility on compatible non-x86 systems (for instance, Apple Silicon).