-
Notifications
You must be signed in to change notification settings - Fork 2
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
Only one instance on GCP deployment and small tweaks #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -15,6 +15,8 @@ def gcloud_deploy_cmd( | |||||||||||||||||||||||||||||||||||
env_vars: dict[str, str] | None, | ||||||||||||||||||||||||||||||||||||
secrets: dict[str, str] | None, | ||||||||||||||||||||||||||||||||||||
memory: int, # in MB | ||||||||||||||||||||||||||||||||||||
timeout: int = 180, | ||||||||||||||||||||||||||||||||||||
retry_on_failure: bool = False, | ||||||||||||||||||||||||||||||||||||
) -> str: | ||||||||||||||||||||||||||||||||||||
cmd = ( | ||||||||||||||||||||||||||||||||||||
f"gcloud functions deploy {gcp_function_name} " | ||||||||||||||||||||||||||||||||||||
|
@@ -26,7 +28,14 @@ def gcloud_deploy_cmd( | |||||||||||||||||||||||||||||||||||
f"--entry-point {entry_point} " | ||||||||||||||||||||||||||||||||||||
f"--memory {memory}MB " | ||||||||||||||||||||||||||||||||||||
f"--no-allow-unauthenticated " | ||||||||||||||||||||||||||||||||||||
f"--timeout {timeout}s " | ||||||||||||||||||||||||||||||||||||
# Explicitly set no concurrency, min instances to 0 (agent is executed only once in a while) and max instances to 1 (parallel agents aren't allowed). | ||||||||||||||||||||||||||||||||||||
"--concurrency 1 " | ||||||||||||||||||||||||||||||||||||
"--min-instances 0 " | ||||||||||||||||||||||||||||||||||||
"--max-instances 1 " | ||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||
if retry_on_failure: | ||||||||||||||||||||||||||||||||||||
cmd += "--retry " | ||||||||||||||||||||||||||||||||||||
Comment on lines
+31
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation of the + if retry_on_failure:
+ cmd += "--retry "
+ print("Note: Deployment will retry on failure.") Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what happened before with OpenAI-powered agents, this I think this PR introduces changes that are worth merging, but it doesn't solve the retries problem. I'll deploy the openai-powered agents tomorrow and monitor it... |
||||||||||||||||||||||||||||||||||||
if labels: | ||||||||||||||||||||||||||||||||||||
for k, v in labels.items(): | ||||||||||||||||||||||||||||||||||||
cmd += f"--update-labels {k}={v} " | ||||||||||||||||||||||||||||||||||||
|
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.
The
deploy_gcp
method demonstrates a comprehensive approach to deploying agents to GCP, including dynamic entrypoint generation, deployment parameter handling, and error checking. However, it's important to ensure that thedeploy_to_gcp
and related functions are robustly implemented to handle the dynamic nature of the entrypoint generation and deployment parameters. Additionally, consider adding more detailed error messages to help diagnose deployment failures more effectively.Consider enhancing error messages in the deployment process to provide more context on failures, which could aid in troubleshooting.