You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing issues when upgrading the google-cloud-run library from version 0.10.3 to 0.10.9 while developing an API using FastAPI. The API is responsible for creating Cloud Run jobs and requires mounting a volume based on a Google Cloud Storage (GCS) bucket. To achieve this, I needed to update the google-cloud-run version since version 0.10.3 does not support mounting a GCS bucket as a volume.
After upgrading to version 0.10.9, I encountered errors related to configuring resource limits for the Cloud Run jobs. Notably, the documentation does not clarify the need to specify CPU in millicpus (m) format. All the documentation references suggest passing CPU as simple string values like "1", "2", "4", "8", but after running tests, I discovered that the newer version requires the use of millicpu (e.g., "1000m", "2000m", "4000m", "8000m"). This difference was not mentioned, causing confusion during the upgrade process.
Invalid value specified for cpu. Total millicpu may not exceed 8000.
For more troubleshooting guidance, see https://cloud.google.com/run/docs/configuring/cpu
Attempt to Reduce CPU Allocation:
Adjust CPU to "6000m" while keeping memory the same:
Invalid value specified for cpu. Total millicpu may not exceed 8000.
For more troubleshooting guidance, see https://cloud.google.com/run/docs/configuring/cpu
Invalid value specified for container memory. For 1.0 CPU, memory must be between 128Mi and 4Gi inclusive.
For more troubleshooting guidance, see https://cloud.google.com/run/docs/configuring/memory-limits
Attempt Configuration via Cloud Console:
Created a job with 8 CPUs and 16Gi RAM using the following YAML:
Invalid value specified for cpu. Total millicpu may not exceed 8000.
For more troubleshooting guidance, see https://cloud.google.com/run/docs/configuring/cpu
Expected Behavior
After upgrading to google-cloud-run==0.10.9, it should be possible to configure higher CPU and memory limits to support mounting a GCS bucket as a volume without encountering validation errors.
Actual Behavior
CPU Configuration Errors:
"Invalid value specified for cpu. Total millicpu may not exceed 8000."
Memory Configuration Errors:
"Invalid value specified for container memory. For 1.0 CPU, memory must be between 128Mi and 4Gi inclusive."
These errors prevent the successful deployment of Cloud Run jobs with the desired resource allocations.
I'm experiencing issues when upgrading the
google-cloud-run
library from version 0.10.3 to 0.10.9 while developing an API using FastAPI. The API is responsible for creating Cloud Run jobs and requires mounting a volume based on a Google Cloud Storage (GCS) bucket. To achieve this, I needed to update thegoogle-cloud-run
version since version 0.10.3 does not support mounting a GCS bucket as a volume.After upgrading to version 0.10.9, I encountered errors related to configuring resource limits for the Cloud Run jobs. Notably, the documentation does not clarify the need to specify CPU in millicpus (
m
) format. All the documentation references suggest passing CPU as simple string values like"1"
,"2"
,"4"
,"8"
, but after running tests, I discovered that the newer version requires the use of millicpu (e.g.,"1000m"
,"2000m"
,"4000m"
,"8000m"
). This difference was not mentioned, causing confusion during the upgrade process.Steps to Reproduce
Initial Setup with
google-cloud-run==0.10.3
:Upgrade to
google-cloud-run==0.10.9
:Update Resource Limits to New Format:
Modify the resource limits to adhere to the new version's requirements:
Error Encountered:
Attempt to Reduce CPU Allocation:
Adjust CPU to
"6000m"
while keeping memory the same:Same Error Occurs:
Test Minimum CPU and Increased Memory:
Set CPU to
"1000m"
and memory to"4Gi"
:Error Encountered:
Attempt Configuration via Cloud Console:
Created a job with 8 CPUs and 16Gi RAM using the following YAML:
Replicated the configuration in the API:
Same CPU Error Returned:
Expected Behavior
After upgrading to
google-cloud-run==0.10.9
, it should be possible to configure higher CPU and memory limits to support mounting a GCS bucket as a volume without encountering validation errors.Actual Behavior
CPU Configuration Errors:
"Invalid value specified for cpu. Total millicpu may not exceed 8000."
Memory Configuration Errors:
"Invalid value specified for container memory. For 1.0 CPU, memory must be between 128Mi and 4Gi inclusive."
These errors prevent the successful deployment of Cloud Run jobs with the desired resource allocations.
Environment
Library Version:
google-cloud-run==0.10.3
google-cloud-run==0.10.9
Python Version:
3.11.6
Framework: FastAPI
Deployment Method: Via API and Cloud Console
Additional Information
The text was updated successfully, but these errors were encountered: