Forráskód Böngészése

Merge pull request #7766 from overleaf/jpa-em-clsi-node-16

[clsi] upgrade node docker image to upstream version 16

GitOrigin-RevId: 1f7a7ef67c94fd83a2df1061350ba52b8d01e640
Jakob Ackermann 4 éve
szülő
commit
e1b07cd40a

+ 1 - 1
services/clsi/.nvmrc

@@ -1 +1 @@
-14.18.3
+16.14.2

+ 1 - 1
services/clsi/Dockerfile

@@ -2,7 +2,7 @@
 # Instead run bin/update_build_scripts from
 # https://github.com/sharelatex/sharelatex-dev-environment
 
-FROM gcr.io/overleaf-ops/node:14.18.3 as base
+FROM node:16.14.2 as base
 
 WORKDIR /overleaf/services/clsi
 COPY services/clsi/install_deps.sh /overleaf/services/clsi/

+ 1 - 1
services/clsi/Makefile

@@ -30,7 +30,7 @@ HERE=$(shell pwd)
 MONOREPO=$(shell cd ../../ && pwd)
 # Run the linting commands in the scope of the monorepo.
 # Eslint and prettier (plus some configs) are on the root.
-RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) gcr.io/overleaf-ops/node:14.18.3 npm run --silent
+RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:16.14.2 npm run --silent
 
 format:
 	$(RUN_LINTING) format

+ 1 - 2
services/clsi/buildscript.txt

@@ -5,7 +5,6 @@ clsi
 --env-add=ENABLE_PDF_CACHING="true",PDF_CACHING_ENABLE_WORKER_POOL="true"
 --env-pass-through=TEXLIVE_IMAGE
 --has-custom-cloudbuild=True
---node-image=gcr.io/overleaf-ops/node
---node-version=14.18.3
+--node-version=16.14.2
 --public-repo=True
 --script-version=4.1.0

+ 14 - 0
services/clsi/install_deps.sh

@@ -8,3 +8,17 @@ apt-get install -y \
   ghostscript \
 
 rm -rf /var/lib/apt/lists/*
+
+# Allow ImageMagick to process PDF files. This is for tests only, but since we
+# use the production images for tests, this will apply to production as well.
+patch /etc/ImageMagick-6/policy.xml <<EOF
+--- old.xml	2022-03-23 09:16:03.985433900 -0400
++++ new.xml	2022-03-23 09:16:18.625471992 -0400
+@@ -91,6 +91,5 @@
+   <policy domain="coder" rights="none" pattern="PS2" />
+   <policy domain="coder" rights="none" pattern="PS3" />
+   <policy domain="coder" rights="none" pattern="EPS" />
+-  <policy domain="coder" rights="none" pattern="PDF" />
+   <policy domain="coder" rights="none" pattern="XPS" />
+ </policymap>
+EOF

+ 1 - 1
services/clsi/test/bench/hashbench.js

@@ -28,7 +28,7 @@ function test(hashType, filePath, callback) {
       ContentCacheManager.update(dir, filePath, x => {
         const t2 = process.hrtime.bigint()
         const warm = Number(t2 - t1) / 1e6
-        fs.rmdir(dir, { recursive: true }, err => {
+        fs.rm(dir, { recursive: true, force: true }, err => {
           if (err) {
             return callback(err)
           }

+ 1 - 1
services/clsi/test/unit/js/ContentCacheManagerTests.js

@@ -40,7 +40,7 @@ describe('ContentCacheManager', function () {
   })
 
   before(async function () {
-    await fs.promises.rmdir(contentDir, { recursive: true })
+    await fs.promises.rm(contentDir, { recursive: true, force: true })
     await fs.promises.mkdir(contentDir, { recursive: true })
     await fs.promises.mkdir(Path.dirname(pdfPath), { recursive: true })
   })