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

build: install dependencies directly from the repo #1862

Merged
merged 51 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a7ffbdf
build: install dependencies directly from the repo
sofisl Sep 20, 2023
e1c6941
Update Dockerfile
sofisl Sep 20, 2023
ada57ee
Update Dockerfile
sofisl Sep 20, 2023
2145412
Update Dockerfile
sofisl Sep 20, 2023
5ec2484
Update Dockerfile
sofisl Sep 20, 2023
154b0d7
Update cloudbuild_test.yaml
sofisl Sep 20, 2023
d6476e3
Update cloudbuild_test.yaml
sofisl Sep 20, 2023
cd25e83
Update cloudbuild_test.yaml
sofisl Sep 20, 2023
69b26e5
Update Dockerfile
sofisl Sep 20, 2023
e2e24bc
Update Dockerfile
sofisl Sep 21, 2023
f636339
Update Dockerfile
sofisl Sep 21, 2023
758f206
Update Dockerfile
sofisl Sep 21, 2023
41a3835
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
82b8392
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
97ba7e1
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
7c634f1
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
c123430
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
f15838e
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
68d0fd0
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
be35149
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
a44a331
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
2672cb6
Update Dockerfile
sofisl Sep 21, 2023
8f1ee51
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
626a12a
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
baf6db1
Update Dockerfile
sofisl Sep 21, 2023
ccca55e
Update Dockerfile
sofisl Sep 21, 2023
52f1016
Update Dockerfile
sofisl Sep 21, 2023
a9070f6
Update Dockerfile
sofisl Sep 21, 2023
94f999a
Update Dockerfile
sofisl Sep 21, 2023
4a6bc0f
Update Dockerfile
sofisl Sep 21, 2023
3472231
Update Dockerfile
sofisl Sep 21, 2023
9ced785
Update Dockerfile
sofisl Sep 21, 2023
b36ad0f
Update Dockerfile
sofisl Sep 21, 2023
36c2315
Update Dockerfile
sofisl Sep 21, 2023
635b3d3
Update Dockerfile
sofisl Sep 21, 2023
771f756
Update Dockerfile
sofisl Sep 21, 2023
b8ec3d2
Update node.py
sofisl Sep 21, 2023
56890d4
Update Dockerfile
sofisl Sep 21, 2023
711e9c2
Update node.py
sofisl Sep 21, 2023
b08e351
Update Dockerfile
sofisl Sep 21, 2023
b691553
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
f130715
Merge branch 'master' into sofisl-patch-4
sofisl Sep 21, 2023
d4347c8
Update Dockerfile
sofisl Sep 21, 2023
4a8d86d
Update cloudbuild_test.yaml
sofisl Sep 21, 2023
93b8967
Update entrypoint.sh
sofisl Sep 21, 2023
1bad266
Update entrypoint.sh
sofisl Sep 21, 2023
72577c0
Update Dockerfile
sofisl Sep 21, 2023
95f405d
Update Dockerfile
sofisl Sep 21, 2023
30764ca
Update Dockerfile
sofisl Sep 21, 2023
237eb9e
Update node.py
sofisl Sep 21, 2023
8f3fe52
Update node.py
sofisl Sep 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions docker/owlbot/nodejs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# build from the root of this repo:
# docker build -t gcr.io/repo-automation-bots/owlbot-nodejs -f docker/owlbot/nodejs/Dockerfile .
FROM python:3.10.12-bookworm

WORKDIR /

###################### Install nodejs.
Expand Down Expand Up @@ -46,11 +45,6 @@ COPY post-processor-changes.txt /post-processor-changes.txt
RUN find /synthtool -exec chmod a+r {} \;
RUN find /synthtool -type d -exec chmod a+x {} \;

# Install dependencies used for post processing:
# * gts/typescript are used for linting.
# * google-gax and gapic-tools are used for compiling protos.
RUN cd /synthtool && mkdir node_modules && npm i gts@5.0.0 google-gax@4.0.3 \
typescript@5.1.6 @google-cloud/typeless-sample-bot@1.3.3 gapic-tools@0.1.8

ENTRYPOINT [ "/bin/bash" ]
CMD [ "/synthtool/docker/owlbot/nodejs/entrypoint.sh" ]
2 changes: 2 additions & 0 deletions docker/owlbot/nodejs/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

set -ex

npm i --ignore-scripts

if [ -f owlbot.py ]; then
python owlbot.py
else
Expand Down
9 changes: 4 additions & 5 deletions synthtool/languages/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from synthtool.languages import common

_REQUIRED_FIELDS = ["name", "repository", "engines"]
_TOOLS_DIRECTORY = "/synthtool"
_GENERATED_SAMPLES_DIRECTORY = "./samples/generated"


Expand Down Expand Up @@ -189,7 +188,7 @@ def typeless_samples_hermetic(hide_output=False):
logger.debug("Run typeless sample bot")
shell.run(
[
f"{_TOOLS_DIRECTORY}/node_modules/.bin/typeless-sample-bot",
"/node_modules/.bin/typeless-sample-bot",
"--outputpath",
"samples",
"--targets",
Expand Down Expand Up @@ -220,13 +219,13 @@ def fix_hermetic(hide_output=False):
"""
logger.debug("Copy eslint config")
shell.run(
["cp", "-r", f"{_TOOLS_DIRECTORY}/node_modules", "."],
["cp", "-r", "/node_modules", "."],
check=True,
hide_output=hide_output,
)
logger.debug("Running fix...")
shell.run(
[f"{_TOOLS_DIRECTORY}/node_modules/.bin/gts", "fix"],
["/node_modules/.bin/gts", "fix"],
check=False,
hide_output=hide_output,
)
Expand All @@ -249,7 +248,7 @@ def compile_protos_hermetic(hide_output=False):
"""
logger.debug("Compiling protos...")
shell.run(
[f"{_TOOLS_DIRECTORY}/node_modules/.bin/compileProtos", "src"],
["/node_modules/.bin/compileProtos", "src"],
check=True,
hide_output=hide_output,
)
Expand Down
Loading