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

GCP one click deployment #153

Merged

Conversation

EugeneLightsOn
Copy link
Collaborator

@EugeneLightsOn EugeneLightsOn commented May 23, 2024

"deployment: add GCP Cloud Run Button deployment"

This PR makes changes to the Dockerfile and adds a new Google Cloud Platform (GCP) deployment guide.

Dockerfile

  • The base image has been changed from buildpack-deps:buster to python:3.11.
  • The FROM instruction now specifies ghcr.io/cohere-ai/terrarium:latest as terrarium.
  • The ENV instructions have been updated to set the PG_APP_HOME and PYTHONPATH variables.
  • The WORKDIR instruction has been updated to set the working directory to /workspace/src/.
  • The RUN instruction has been modified to install nginx and nodejs using apt-get.
  • The COPY instruction has been added to copy the gcp-entrypoint.sh script to /sbin/.
  • The RUN instruction has been modified to install poetry with the option --without setup.
  • The EXPOSE instruction has been updated to expose ports 4000/tcp, 8000/tcp, and 8090/tcp.
  • The CMD instruction has been updated to specify the entrypoint script as gcp-entrypoint.sh.

New Files

  • gcp-entrypoint.sh: This script sets up the runtime environment and launches the necessary applications.
  • nginx.conf: This file contains the configuration for the Nginx web server.

app.json

  • The name field has been changed from "one-click-demo" to "toolkit-deploy".
  • The DATABASE_URI field has been replaced with DATABASE_URL, which now includes the description "URL for your Postgres database".
  • A new COHERE_API_KEY field has been added to the env object, which includes the description "Your Cohere API key".
  • A new hooks object has been added with a prebuild command to configure Docker authentication using gcloud.
  • The options object has been updated to include the memory, cpu, port, and max-instances fields.

docker_scripts/env-defaults

  • The PYTHON_INTERPRETER_URL export has been updated to use localhost:8080 as the default value.

docker_scripts/functions

  • A new run_nginx function has been added to start the Nginx proxy.
  • The run_backend function has been updated to include the DATABASE_URL variable.
  • A new run_backend_poetry function has been added to handle the backend installation and migration.
  • A new run_frontend_proxy function has been added to start the frontend proxy.

docs/deployment_guides/gcp_one_click_deployment.md

  • A new guide has been added to outline the steps for deploying the Toolkit to GCP using the "One Click" deployment option.
  • It includes instructions on setting up a PostgreSQL database, configuring the DATABASE_URL, providing the Cohere API key, and allowing access to git registries.
  • The guide also covers post-deployment steps, such as accessing the Toolkit URL and handling possible deployment errors.

docs/service_deployments.md

  • A new link has been added to the "One Click Deploy to GCP" guide in the deployment_guides directory.

Copy link
Collaborator

@tianjing-li tianjing-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great - some very small asks

Copy link
Collaborator

@tianjing-li tianjing-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved- minor comments

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@b6e0417). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #153   +/-   ##
=======================================
  Coverage        ?   78.42%           
=======================================
  Files           ?      114           
  Lines           ?     3662           
  Branches        ?        0           
=======================================
  Hits            ?     2872           
  Misses          ?      790           
  Partials        ?        0           

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

@EugeneLightsOn EugeneLightsOn merged commit d089057 into cohere-ai:main May 31, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants