Skip to content

Commit 26c5342

Browse files
authored
fix: update docs pipeline (#109)
* fix: update docs pipeline * move install * fix dockerfile * debug * fix install * Update Dockerfile * Update publish-docs.sh * fix buckets * update bucket * debug * Update publish-docs.sh * Update common.cfg
1 parent 3ffb40e commit 26c5342

File tree

7 files changed

+62
-15
lines changed

7 files changed

+62
-15
lines changed

.kokoro/docker/docs/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ RUN apt-get update \
6060
&& rm -rf /var/lib/apt/lists/* \
6161
&& rm -f /var/cache/apt/archives/*.deb
6262

63-
ENV VERSION v4.2.0
64-
ENV BINARY yq_linux_amd64
65-
RUN wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq && \
66-
chmod +x /usr/bin/yq
67-
6863
###################### Install python 3.9.13
6964

7065
# Download python 3.9.13
@@ -85,4 +80,8 @@ RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
8580
# Test pip
8681
RUN python3 -m pip
8782

83+
# Install build requirements
84+
COPY requirements.txt /requirements.txt
85+
RUN python3 -m pip install --require-hashes -r requirements.txt
86+
8887
CMD ["python3.8"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nox
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --generate-hashes requirements.in
6+
#
7+
argcomplete==3.2.3 \
8+
--hash=sha256:bf7900329262e481be5a15f56f19736b376df6f82ed27576fa893652c5de6c23 \
9+
--hash=sha256:c12355e0494c76a2a7b73e3a59b09024ca0ba1e279fb9ed6c1b82d5b74b6a70c
10+
# via nox
11+
colorlog==6.8.2 \
12+
--hash=sha256:3e3e079a41feb5a1b64f978b5ea4f46040a94f11f0e8bbb8261e3dbbeca64d44 \
13+
--hash=sha256:4dcbb62368e2800cb3c5abd348da7e53f6c362dda502ec27c560b2e58a66bd33
14+
# via nox
15+
distlib==0.3.8 \
16+
--hash=sha256:034db59a0b96f8ca18035f36290806a9a6e6bd9d1ff91e45a7f172eb17e51784 \
17+
--hash=sha256:1530ea13e350031b6312d8580ddb6b27a104275a31106523b8f123787f494f64
18+
# via virtualenv
19+
filelock==3.13.1 \
20+
--hash=sha256:521f5f56c50f8426f5e03ad3b281b490a87ef15bc6c526f168290f0c7148d44e \
21+
--hash=sha256:57dbda9b35157b05fb3e58ee91448612eb674172fab98ee235ccb0b5bee19a1c
22+
# via virtualenv
23+
nox==2024.3.2 \
24+
--hash=sha256:e53514173ac0b98dd47585096a55572fe504fecede58ced708979184d05440be \
25+
--hash=sha256:f521ae08a15adbf5e11f16cb34e8d0e6ea521e0b92868f684e91677deb974553
26+
# via -r requirements.in
27+
packaging==24.0 \
28+
--hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5 \
29+
--hash=sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9
30+
# via nox
31+
platformdirs==4.2.0 \
32+
--hash=sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068 \
33+
--hash=sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768
34+
# via virtualenv
35+
virtualenv==20.25.1 \
36+
--hash=sha256:961c026ac520bac5f69acb8ea063e8a4f071bcc9457b9c1f28f6b085c511583a \
37+
--hash=sha256:e08e13ecdca7a0bd53798f356d5831434afa5b07b93f0abdf0797b7a06ffe197
38+
# via nox

.kokoro/docs/common.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ env_vars: {
2525

2626
env_vars: {
2727
key: "STAGING_BUCKET"
28-
value: "docs-staging"
28+
value: "docs-staging" # Used for googleapis.dev
2929
}
3030

3131
env_vars: {
3232
key: "V2_STAGING_BUCKET"
3333
# Push non-cloud library docs to `docs-staging-v2-staging` instead of the
3434
# Cloud RAD bucket `docs-staging-v2`
35-
value: "docs-staging-v2-staging"
35+
value: "docs-staging-v2"
3636
}
3737

3838
# It will upload the docker image after successful builds.
@@ -64,4 +64,4 @@ before_action {
6464
keyname: "docuploader_service_account"
6565
}
6666
}
67-
}
67+
}

.kokoro/publish-docs.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,27 @@ python3 -m docuploader create-metadata \
3535
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
3636
--version=$VERSION \
3737
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
38-
--distribution-name=$(yq -oy '.project.name' pyproject.toml) \
38+
--distribution-name=$(jq --raw-output '.distribution_name // empty' .repo-metadata.json) \
3939
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
4040
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
4141
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)
4242

4343
cat docs.metadata
4444

4545
# upload docs
46+
echo "Uploading docs to ${STAGING_BUCKET}"
4647
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"
4748

4849

49-
# docfx yaml files
50+
# docfx yaml files for CGC
5051
nox -s docfx
5152

5253
# create metadata.
5354
python3 -m docuploader create-metadata \
5455
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
5556
--version=$VERSION \
5657
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
57-
--distribution-name=$(yq -oy '.project.name' pyproject.toml) \
58+
--distribution-name=$(jq --raw-output '.distribution_name // empty' .repo-metadata.json) \
5859
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
5960
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
6061
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)

DEVELOPER.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,17 @@ Currently, manual PRs are made to the [Langchain GitHub repo](https://github.com
8989
9090
### API Reference
9191
92-
API docs are templated in the `docs/` directory. See `.kokoro/` for the release pipeline.
92+
#### Build the documentation
93+
API docs are templated in the `docs/` directory.
9394
94-
To test locally, run: `nox -s`
95+
To test locally, run: `nox -s docs`
96+
97+
The nox session, `docs`, is used to create HTML to publish to googleapis.dev
98+
The nox session, `docfx`, is used to create YAML to publish to CGC.
99+
100+
#### Publish the documentation
101+
102+
The kokoro docs pipeline runs when a new release is created. See `.kokoro/` for the release pipeline.
95103
96104
97105
[provider]: https://python.langchain.com/docs/integrations/platforms/google

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Mac/Linux
5858
pip install virtualenv
5959
virtualenv <your-env>
6060
source <your-env>/bin/activate
61-
<your-env>/bin/pip install google-cloud-bigquery
61+
<your-env>/bin/pip install langchain-google-cloud-sql-pg
6262
6363
6464
Windows
@@ -69,7 +69,7 @@ Windows
6969
pip install virtualenv
7070
virtualenv <your-env>
7171
<your-env>\Scripts\activate
72-
<your-env>\Scripts\pip.exe install google-cloud-bigquery
72+
<your-env>\Scripts\pip.exe install langchain-google-cloud-sql-pg
7373
7474
7575
Example Usage

0 commit comments

Comments
 (0)