diff --git a/libs/langchain/langchain/cli/create_repo/templates/pip/Makefile b/libs/langchain/langchain/cli/create_repo/templates/pip/Makefile index 00cac9fdb9..92243442c6 100644 --- a/libs/langchain/langchain/cli/create_repo/templates/pip/Makefile +++ b/libs/langchain/langchain/cli/create_repo/templates/pip/Makefile @@ -26,6 +26,9 @@ format format_diff: black $(PYTHON_FILES) ruff --select I --fix $(PYTHON_FILES) +deploy_gcp: + gcloud run deploy ____project_name_identifier --source . --port 8001 --env-vars-file .env.gcp.yaml --allow-unauthenticated --region us-central1 --min-instances 1 + ###################### # HELP ###################### @@ -36,3 +39,4 @@ help: @echo 'make format - run code formatters' @echo 'make lint - run linters' @echo 'make test - run unit tests' + @echo 'make deploy_gcp - deploy to GCP' diff --git a/libs/langchain/langchain/cli/create_repo/templates/poetry/Makefile b/libs/langchain/langchain/cli/create_repo/templates/poetry/Makefile index cfc865ce64..f19cf7b4e9 100644 --- a/libs/langchain/langchain/cli/create_repo/templates/poetry/Makefile +++ b/libs/langchain/langchain/cli/create_repo/templates/poetry/Makefile @@ -26,6 +26,9 @@ format format_diff: poetry run black $(PYTHON_FILES) poetry run ruff --select I --fix $(PYTHON_FILES) +deploy_gcp: + gcloud run deploy ____project_name_identifier --source . --port 8001 --env-vars-file .env.gcp.yaml --allow-unauthenticated --region us-central1 --min-instances 1 + ###################### # HELP ###################### @@ -36,3 +39,4 @@ help: @echo 'make format - run code formatters' @echo 'make lint - run linters' @echo 'make test - run unit tests' + @echo 'make deploy_gcp - deploy to GCP' diff --git a/libs/langchain/langchain/cli/create_repo/templates/repo/.env.gcp.yaml b/libs/langchain/langchain/cli/create_repo/templates/repo/.env.gcp.yaml new file mode 100644 index 0000000000..54c854b6cd --- /dev/null +++ b/libs/langchain/langchain/cli/create_repo/templates/repo/.env.gcp.yaml @@ -0,0 +1 @@ +OPENAI_API_KEY: your_secret_key_here diff --git a/libs/langchain/langchain/cli/create_repo/templates/repo/.gitignore b/libs/langchain/langchain/cli/create_repo/templates/repo/.gitignore index 796dbb448b..794a85127a 100644 --- a/libs/langchain/langchain/cli/create_repo/templates/repo/.gitignore +++ b/libs/langchain/langchain/cli/create_repo/templates/repo/.gitignore @@ -116,6 +116,7 @@ venv/ ENV/ env.bak/ venv.bak/ +.env.gcp.yaml # Spyder project settings .spyderproject diff --git a/libs/langchain/langchain/cli/create_repo/templates/repo/README.md b/libs/langchain/langchain/cli/create_repo/templates/repo/README.md index 3b3454692b..2cb2ae73a5 100644 --- a/libs/langchain/langchain/cli/create_repo/templates/repo/README.md +++ b/libs/langchain/langchain/cli/create_repo/templates/repo/README.md @@ -57,6 +57,15 @@ docker run -p 8001:8001 -e PORT=8001 ____project_name_identifier:latest Don't forget to add any needed environment variables! +## Deploy to GCP + +You can deploy to GCP Cloud Run using the following command: + +First edit `.env.gcp.yaml` file with any environment variables you need. Then run: + +``` +make deploy_gcp +``` ## Contributing