-
Notifications
You must be signed in to change notification settings - Fork 64
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
[GCP] Update artifact registry/db code #685
base: main
Are you sure you want to change the base?
[GCP] Update artifact registry/db code #685
Conversation
Why upgrade protobuf? Dependency issue 1. `google-api-core[grpc]` requires `grpcio-status>=1.49.1` 2. `grpcio-status>=1.49.1` requires `protobuf >= 4.21` 3. we specify that `protobuf~=3.20` Soln: upgrade protobuf. Why is is it safe to do this? Look at this dependency graph from pipdeptree ``` protobuf==3.20.3 ├── ddsketch==2.0.4 [requires: protobuf>=3.0.0] │ └── ddtrace==1.8.3 [requires: ddsketch>=2.0.1] ├── ddtrace==1.8.3 [requires: protobuf>=3] ├── google-api-core==2.24.1 [requires: protobuf>=3.19.5,<6.0.0.dev0,!=4.21.5,!=4.21.4,!=4.21.3,!=4.21.2,!=4.21.1,!=4.21.0,!=3.20.1,!=3.20.0] │ ├── google-cloud-artifact-registry==1.14.0 [requires: google-api-core>=1.34.1,<3.0.0dev,!=2.9.*,!=2.8.*,!=2.7.*,!=2.6.*,!=2.5.*,!=2.4.*,!=2.3.*,!=2.2.*,!=2.10.*,!=2.1.*,!=2.0.*] │ └── google-cloud-secret-manager==2.22.1 [requires: google-api-core>=1.34.1,<3.0.0dev,!=2.9.*,!=2.8.*,!=2.7.*,!=2.6.*,!=2.5.*,!=2.4.*,!=2.3.*,!=2.2.*,!=2.10.*,!=2.1.*,!=2.0.*] ├── google-cloud-artifact-registry==1.14.0 [requires: protobuf>=3.20.2,<6.0.0dev,!=4.21.5,!=4.21.4,!=4.21.3,!=4.21.2,!=4.21.1,!=4.21.0] ├── google-cloud-secret-manager==2.22.1 [requires: protobuf>=3.20.2,<6.0.0dev,!=4.21.5,!=4.21.4,!=4.21.3,!=4.21.2,!=4.21.1,!=4.21.0] ├── googleapis-common-protos==1.66.0 [requires: protobuf>=3.20.2,<6.0.0.dev0,!=4.21.5,!=4.21.4,!=4.21.3,!=4.21.2,!=4.21.1,!=3.20.1,!=3.20.0] │ ├── google-api-core==2.24.1 [requires: googleapis-common-protos>=1.56.2,<2.0.dev0] │ ├── grpc-google-iam-v1==0.14.0 [requires: googleapis-common-protos>=1.56.0,<2.0.0dev] │ └── grpcio-status==1.48.2 [requires: googleapis-common-protos>=1.5.5] ├── grpc-google-iam-v1==0.14.0 [requires: protobuf>=3.20.2,<6.0.0dev,!=4.21.5,!=4.21.4,!=4.21.3,!=4.21.2,!=4.21.1] │ ├── google-cloud-artifact-registry==1.14.0 [requires: grpc-google-iam-v1>=0.12.4,<1.0.0dev] │ └── google-cloud-secret-manager==2.22.1 [requires: grpc-google-iam-v1>=0.12.4,<1.0.0dev] ├── grpcio-status==1.48.2 [requires: protobuf>=3.12.0] └── proto-plus==1.26.0 [requires: protobuf>=3.19.0,<6.0.0dev] ├── google-api-core==2.24.1 [requires: proto-plus>=1.22.3,<2.0.0dev] ├── google-cloud-artifact-registry==1.14.0 [requires: proto-plus>=1.22.3,<2.0.0dev] └── google-cloud-secret-manager==2.22.1 [requires: proto-plus>=1.22.3,<2.0.0dev] ``` - ddtrace 1.8.3 has support for protobuf 4.21 ((pr)[DataDog/dd-trace-py#3791] that added it was in 2022, ddtrace 1.8.3 is from 2023) - ddsketch has support ((release notes)[https://github.com/DataDog/sketches-py/blob/0d16e695d1f991276863b8ffaaf6c8e9bd9ad9de/releasenotes/notes/proto4-e8646610178bef59.yaml#L3] indicate support was added in May 2022, we use 2.0.4 from July 2022). This is also a transitive dep of dd-trace - the rest are google deps I added for GCP support. Assume google works with these (they made protobuf!)
The model bundle is not written to the DB yet, but that's next!
New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: pypi/[email protected], pypi/[email protected], pypi/[email protected] |
@@ -226,6 +227,10 @@ def _get_external_interfaces( | |||
elif infra_config().cloud_provider == "azure": | |||
inference_task_queue_gateway = servicebus_task_queue_gateway | |||
infra_task_queue_gateway = servicebus_task_queue_gateway | |||
elif infra_config().cloud_provider == "gcp": |
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.
@kovben95scale had a good question about this -- is there a reason we don't use redis on azure etc? I think we're just using this as a celery task queue here, which seems like it would fit with redis.
model-engine/model_engine_server/infra/repositories/gcp_artifact_registry_docker_repository.py
Outdated
Show resolved
Hide resolved
@@ -55,16 +61,17 @@ def get_engine_url( | |||
key_file = os.environ.get("DB_SECRET_NAME") | |||
if env is None: | |||
env = infra_config().env |
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.
What are the values of env / where is it used?
GCPArtifactRegistryDockerRepository.get_latest_image_tag
@@ -598,10 +600,18 @@ async def main(): | |||
) | |||
|
|||
if broker_type == "redis": | |||
# TODO gcp: change this to use cloud storage |
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.
This should be covered in the cloud storage PR @anishxyz was working on. I think we can merge this first, then merge that.
Pull Request Summary
This PR
backend_protocol
used to store the messages persistently. In Google Cloud Storage Integration #683 we should change this to use cloud storage.Note on upgrading
protobuf
There's a dependency resolution issue raised because we installed google api sdks in this PR.
google-api-core[grpc]
requiresgrpcio-status>=1.49.1
grpcio-status>=1.49.1
requiresprotobuf >= 4.21
protobuf~=3.20
Soln: upgrade protobuf. Why is is it safe to do this? Look at this pipdeptree output (things that depend on protobuf)
Test Plan and Usage Guide
How did you validate that your PR works correctly? How do you run or demo the code? Provide enough detail so a reviewer can reasonably reproduce the testing procedure. Paste example command line invocations if applicable.