Skip to content

Commit

Permalink
Merge pull request #4 from nemoengineering/update
Browse files Browse the repository at this point in the history
Update dependencies and improve logging
  • Loading branch information
adrianNEMO committed Aug 28, 2023
2 parents 5ee35dd + 122299a commit a9e7c0f
Show file tree
Hide file tree
Showing 14 changed files with 2,877 additions and 4,815 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 18

- run: npm ci

Expand Down
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .puppeteerrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

const {join} = require('path');

/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
// Changes the cache location for Puppeteer.
cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ COPY buf.gen.yaml .
COPY src src
COPY proto proto

ENV PUPPETEER_SKIP_DOWNLOAD=true

RUN VERSION="1.4.0" && \
curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m)" \
-o "/usr/local/bin/buf" && \
chmod +x "/usr/local/bin/buf"

RUN VERSION="3.15.8" && \
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-linux-x86_64.zip" && \
unzip "protoc-${VERSION}-linux-x86_64.zip" -d /

RUN npm install && npm run build

FROM node:18-slim
Expand All @@ -36,6 +34,8 @@ RUN apt-get update \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable

RUN GRPC_HEALTH_PROBE_VERSION=v0.4.11 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
Expand All @@ -46,6 +46,7 @@ COPY --from=builder /usr/src/rendertron/package.json .
COPY --from=builder /usr/src/rendertron/node_modules node_modules
COPY --from=builder /usr/src/rendertron/build build
COPY --from=builder /usr/src/rendertron/generated generated
COPY .puppeteerrc.cjs .

# Install puppeteer so it's available in the container.
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
Expand All @@ -56,4 +57,4 @@ RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
# Run everything after as non-privileged user.
USER pptruser

ENTRYPOINT ["npm", "run", "start"]
ENTRYPOINT ["node", "build/src/index.js"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ your application is rendered well before the budget expires.

### Web components

[index.ts](src%2Findex.ts)
Headless Chrome supports web components but shadow DOM is difficult to serialize effectively.
As such, [shady DOM](https://github.com/webcomponents/shadydom) (a lightweight shim for Shadow DOM)
is required for web components.
Expand Down
29 changes: 17 additions & 12 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
version: v1
managed:
enabled: true
plugins:
- name: js
out: generated/nodejs
opt: import_style=commonjs,binary

- name: grpc
out: generated/nodejs
opt: grpc_js
path: grpc_tools_node_protoc_plugin

- name: ts
out: generated/nodejs
opt: grpc_js
- name: ts-proto
out: generated/_proto
strategy: all
path: ./node_modules/.bin/protoc-gen-ts_proto
opt:
- esModuleInterop=true
- unrecognizedEnum=false
- outputTypeRegistry=false
- outputServices=generic-definitions,outputServices=nice-grpc
- useExactTypes=true
- outputPartialMethods=false
- useDate=string
- useAbortSignal=true
- useSnakeTypeName=false
- removeEnumPrefix=true
Loading

0 comments on commit a9e7c0f

Please sign in to comment.