mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-29 11:09:07 +00:00
Add deploy command to repos generated by cli template (#11711)
<!-- Thank you for contributing to LangChain! Replace this entire comment with: - **Description:** a description of the change, - **Issue:** the issue # it fixes (if applicable), - **Dependencies:** any dependencies required for this change, - **Tag maintainer:** for a quicker response, tag the relevant maintainer (see below), - **Twitter handle:** we announce bigger features on Twitter. If your PR gets announced, and you'd like a mention, we'll gladly shout you out! Please make sure your PR is passing linting and testing before submitting. Run `make format`, `make lint` and `make test` to check this locally. See contribution guidelines for more information on how to write/run tests, lint, etc: https://github.com/langchain-ai/langchain/blob/master/.github/CONTRIBUTING.md If you're adding a new integration, please include: 1. a test for the integration, preferably unit tests that do not rely on network access, 2. an example notebook showing its use. It lives in `docs/extras` directory. If no one reviews your PR within a few days, please @-mention one of @baskaryan, @eyurtsev, @hwchase17. -->
This commit is contained in:
parent
1c0857b53e
commit
7f4734c0dd
@ -26,6 +26,9 @@ format format_diff:
|
|||||||
black $(PYTHON_FILES)
|
black $(PYTHON_FILES)
|
||||||
ruff --select I --fix $(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
|
# HELP
|
||||||
######################
|
######################
|
||||||
@ -36,3 +39,4 @@ help:
|
|||||||
@echo 'make format - run code formatters'
|
@echo 'make format - run code formatters'
|
||||||
@echo 'make lint - run linters'
|
@echo 'make lint - run linters'
|
||||||
@echo 'make test - run unit tests'
|
@echo 'make test - run unit tests'
|
||||||
|
@echo 'make deploy_gcp - deploy to GCP'
|
||||||
|
@ -26,6 +26,9 @@ format format_diff:
|
|||||||
poetry run black $(PYTHON_FILES)
|
poetry run black $(PYTHON_FILES)
|
||||||
poetry run ruff --select I --fix $(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
|
# HELP
|
||||||
######################
|
######################
|
||||||
@ -36,3 +39,4 @@ help:
|
|||||||
@echo 'make format - run code formatters'
|
@echo 'make format - run code formatters'
|
||||||
@echo 'make lint - run linters'
|
@echo 'make lint - run linters'
|
||||||
@echo 'make test - run unit tests'
|
@echo 'make test - run unit tests'
|
||||||
|
@echo 'make deploy_gcp - deploy to GCP'
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
OPENAI_API_KEY: your_secret_key_here
|
@ -116,6 +116,7 @@ venv/
|
|||||||
ENV/
|
ENV/
|
||||||
env.bak/
|
env.bak/
|
||||||
venv.bak/
|
venv.bak/
|
||||||
|
.env.gcp.yaml
|
||||||
|
|
||||||
# Spyder project settings
|
# Spyder project settings
|
||||||
.spyderproject
|
.spyderproject
|
||||||
|
@ -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!
|
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
|
## Contributing
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user