Commit graph

1114 commits

Author SHA1 Message Date
yu-i-i
3461c105f4 Fix: always include repository prefix in sandboxed compiles image name 2025-07-22 19:22:12 +02:00
yu-i-i
2253ec577e Refactor Sandboxed Compiles 2025-07-22 19:22:10 +02:00
yu-i-i
9e0792f665 Add 'poll' to clsi seccomp profile, fixes minted. Thanks, David. 2025-07-22 19:22:09 +02:00
yu-i-i
3b3fc01308 Allow selecting a TeX Live image for a project 2025-07-22 19:22:06 +02:00
Jakob Ackermann
8c39add865 [clsi-cache] meter ingress and egress bandwidth (#27143)
* [mics] fix "app" label in clsi-cache metrics in dev-env

* [clsi-cache] validate filePath when processing file

* [clsi-cache] meter ingress and egress bandwidth

Files are downloaded directly from nginx, hence we cannot meter egress
in clsi-cache easily.

GitOrigin-RevId: 24de8c41728f0e9c984113c1470dec6153e75f20
2025-07-16 08:05:59 +00:00
Brian Gough
2f2862ecd7 Merge pull request #26637 from overleaf/bg-clsi-fix-process-group-for-local-compiles
fix "stop compile" option for local command runner in CE/SP

GitOrigin-RevId: 7986b505362aaf33ac6e161b3b54458baba1e2e6
2025-07-11 08:07:11 +00:00
Andrew Rumble
1a1f283245 Update node to 22.17.0
GitOrigin-RevId: 7a15f7a0e95e3331c589955aca1fbc5dfb13a568
2025-07-09 08:06:01 +00:00
Andrew Rumble
381a106b46 Remove @types/workerpool
This is a stub

GitOrigin-RevId: de776c11044c42bb191424f1d614442da22c3197
2025-07-04 08:04:51 +00:00
Jakob Ackermann
22016ffef9 [clsi] adopt Server Pro env vars for sandboxed compiles (#26430)
GitOrigin-RevId: b7c0d9f4ff37d6cef77694a6a9ea4d50dcb148b2
2025-06-16 08:06:50 +00:00
Jakob Ackermann
ab0199f238 [misc] migrate remaining references to our GCR repositories to AR (#26370)
* [misc] migrate remaining references to our GCR repositories to AR

* [server-ce] fix retagging of texlive images

GitOrigin-RevId: 81f955ad4c4486ad42b29cbd6bcc9d5ef4b1a432
2025-06-13 08:06:18 +00:00
Miguel Serrano
5b08adc4ff Merge pull request #26218 from overleaf/msm-bump-tar-fs-multer
[clsi/web/history-v1] Bump `tar-fs` and `multer`

GitOrigin-RevId: c76b964224c8367d68dc1190ff29627cc6919ade
2025-06-10 08:06:05 +00:00
Jakob Ackermann
25577379fc [clsi] add env var override for seccomp profile (#25894)
GitOrigin-RevId: 6ef9a5c1f9149147641abb9fe1798b1b41a14c05
2025-05-23 13:25:58 +00:00
Antoine Clausse
436dcc977f Update Node to 22.15.1 (#25785)
GitOrigin-RevId: 52428d2d7e67c3135a1604fa487dd142aa08bf15
2025-05-22 08:07:42 +00:00
Antoine Clausse
b667cef262 Revert "Update defaultHighWaterMark to 64KiB (Node 22's default) (#25522)" (#25789)
This reverts commit 19d731abf683066654027de3a4f9ac0b8916f22c.

GitOrigin-RevId: eb7c45ab45e02054601b607a4bfeb432424a1837
2025-05-22 08:07:38 +00:00
Jakob Ackermann
26a7a7d7b8 [clsi] mark VM as unhealthy when detecting of-of-disk condition (#25721)
* [clsi] shed load when detecting out-of-disk condition

* [clsi] mark VM as unhealthy when detecting of-of-disk condition

GitOrigin-RevId: 25cda6785c0d973f50ec6206bee389804f35917e
2025-05-21 08:05:34 +00:00
Jakob Ackermann
efc42481da [clsi] avoid creating legacy db folder (#25760)
GitOrigin-RevId: eaa97813f0e20d14d7d6dafefe7b8b4d002fa41c
2025-05-20 08:06:36 +00:00
Antoine Clausse
67ab5a749a Update Node to 22.15.0 (#24699)
* Run `bin/update_node 20.18.2 22.15.0`

* Remove expects on `fetchMock.callHistory.done()` to fix tests: are they necessary?

* Set node version to `22.x` in linked-url-proxy

* Increase test timeout to 30s in `github-sync`, Add waiting steps

* Define `navigator.onLine` in tests setup

GitOrigin-RevId: 75eb556e9f51b665e57497a0879b6915d14069ce
2025-05-16 08:06:26 +00:00
Jakob Ackermann
ec1bd69605 [clsi-cache] remove non sharded instances (#25645)
* Revert "[clsi-cache] only use sharding from updated project editor tabs (#25326)"

This reverts commit 1754276bed3186c0536055c983e32476cc90d416.

* [clsi-cache] remove non sharded instances

GitOrigin-RevId: aa3ac46140dfc1722a3350cf7071e5b11af61199
2025-05-16 08:05:02 +00:00
Antoine Clausse
aa002369cb Update defaultHighWaterMark to 64KiB (Node 22's default) (#25522)
* Set defaultHighWaterMark to 16KiB

This is already the default in Node 20

* Set defaultHighWaterMark to 64KiB

Per https://github.com/overleaf/internal/pull/25522#issuecomment-2872035192

GitOrigin-RevId: 19d731abf683066654027de3a4f9ac0b8916f22c
2025-05-14 08:05:16 +00:00
Christopher Hoskin
7356c3b863 Merge pull request #25543 from overleaf/csh-issue-23942-more-migrate
Remove more CR refs

GitOrigin-RevId: 7ba91712943c309d40613b0f7247f20d45d7fbb1
2025-05-13 08:08:22 +00:00
Jakob Ackermann
fba8f776a1 [web] avoid trying to fetch synctex.gz from clsi-cache in free projects (#25445)
* [web] avoid trying to fetch synctex.gz from clsi-cache in free projects

* [clsi] parse boolean query parameter

GitOrigin-RevId: 99c98aac8147a626b704e9a888b7fc660cc5ab17
2025-05-12 08:05:24 +00:00
Jakob Ackermann
d489e35782 [web] emit event when synctex mapping was downloaded from clsi-cache (#25424)
* [clsi] tell frontend when synctex mapping was downloaded from clsi-cache

* [web] emit event when synctex mapping was downloaded from clsi-cache

GitOrigin-RevId: 1f6b7e0faaa7dd76449aad566802da971a4cf9ed
2025-05-09 08:06:00 +00:00
Jakob Ackermann
5cc0895c56 [clsi] enable keepAlive on global HTTP agents (#25350)
GitOrigin-RevId: c9478b405ac32ca55aeb3bcf9f24052477464667
2025-05-07 08:08:10 +00:00
Jakob Ackermann
6881ba956a [clsi-cache] only use sharding from updated project editor tabs (#25326)
GitOrigin-RevId: 1754276bed3186c0536055c983e32476cc90d416
2025-05-07 08:06:39 +00:00
Jakob Ackermann
5ce1685b5b [clsi-cache] shard each zone into three instances (#25301)
* [clsi-cache] shard per zone into three instances

Keep the old instance as read fallback. We can remove it in 4 days.

Disk size: 2Ti gives us the maximum write throughput of 240MiB/s on a
N2D instance with fewer than 8 vCPUs.

* [clsi] fix format

* [k8s] clsi-cache: bring back storage-classes

* [k8s] clsi-cache: fix reference to zonal storage-classes

* [k8s] clsi-cache: add logging configs

* [clsi] improve sharding

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [clsi] fix sharding

Index needs to be positive.

* [clsi] fix sharding

The random part is static per machine/process.

* [clsi] restrict clsi-cache to user projects

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [k8s] clsi-cache: align CLSI_CACHE_NGINX_HOST with service LB

---------

Co-authored-by: Brian Gough <brian.gough@overleaf.com>
GitOrigin-RevId: 1efb1b3245c8194c305420b25e774ea735251fb3
2025-05-07 08:06:16 +00:00
Jakob Ackermann
07b2255426 [misc] cleanup .dockerignore and .gitignore files (#25312)
- Remove settings ignore, they are inconsistent and break local prettier
- Remove .dockerignore files, only root ignore file is used
- Move .idea/.run/*.swp/coverage to root
- Remove .npmrc entries, we are no longer writing the rc file
- Remove node_modules/.DS_Store, is contained in root
- Remove cruft

GitOrigin-RevId: 3025fd5acaef343312f55149466c638e759a6e1f
2025-05-07 08:05:24 +00:00
Jakob Ackermann
a9780ccf96 [clsi] merge sandboxed compiles config from Server Pro and SaaS (#25062)
* [clsi] merge sandboxed compiles config from Server Pro and SaaS

* [clsi] reorder fallback env vars

Co-authored-by: Mathew Evans <matt.evans@overleaf.com>

* [server-pro] bump version of expected release with these changes

---------

Co-authored-by: Mathew Evans <matt.evans@overleaf.com>
GitOrigin-RevId: bada93fec89bcc3f2bab85b6e60b2e27de88b9c2
2025-04-28 08:05:21 +00:00
Antoine Clausse
fa62529d82 [clsi] Replace diskusage by fs (#24789)
* Replace `diskusage` by `fs` in clsi

* Replace `diskusage` by `fs` in clsi-cache

* Update disk space calculations to include block size in bytes

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>

* Add warning comments about Docker-for-Mac fs stats being off by a factor

---------

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 02ea07e531b89bb3d10ddfe780348b19cbddad1f
2025-04-17 08:06:16 +00:00
Jakob Ackermann
39110d9da9 [clsi-cache] check compiler settings before using compile from cache (#24845)
* [web] provide an actual rootFolder from EditorProviders in tests

- Fixup SocketIOMock and ShareJS mocks to provide the complete interface
- Extend SocketIOMock interface to count event listeners
- Fixup test that did not expect to find a working rootDoc

* [web] expose imageName from ProjectContext

* [clsi-cache] check compiler settings before using compile from cache

* [web] avoid fetching initial compile from clsi-cache in PDF detach tab

GitOrigin-RevId: e3c754a7ceca55f03a317e1bc8ae45ed12cc2f02
2025-04-16 08:05:35 +00:00
Jakob Ackermann
4a17a1e713 [web] gracefully access compile stats for event (#24818)
* [web] gracefully access compile stats for event

* [clsi] always emit stats and timings

GitOrigin-RevId: 959e5fe1508245ffecfab1219fd86e53b210fca1
2025-04-14 08:04:51 +00:00
Brian Gough
fe8d6392d5 Merge pull request #24793 from overleaf/bg-update-build-scripts-to-include-history-redis
update build scripts to include HISTORY_REDIS_HOST

GitOrigin-RevId: da0f317c80401067c0f4aa772196cb2f24849b8e
2025-04-11 08:06:03 +00:00
Jakob Ackermann
d99ba08d01 [clsi] run SyncTeX in specific output dir rather than compile dir (#24690)
* [clsi] drop support for docker-in-docker

* [clsi] run SyncTeX in specific output dir rather than compile dir

* [clsi] store output.synctex.gz outside of tar-ball in clsi-cache

* [clsi] add documentation for rewriting of docker bind-mounts

* [server-pro] update env vars for sandboxed compiles in sample config

GitOrigin-RevId: 8debd7102ac612544961f237aa4ff1c530aa3da3
2025-04-10 08:05:26 +00:00
Jakob Ackermann
b538d56591 [clsi-cache] backend (#24388)
* [clsi-cache] initial revision of the clsi-cache service

* [clsi] send output files to clsi-cache and import from clsi-cache

* [web] pass editorId to clsi

* [web] clear clsi-cache when clearing clsi cache

* [web] add split-tests for controlling clsi-cache rollout

* [web] populate clsi-cache when cloning/creating project from template

* [clsi-cache] produce less noise when populating cache hits 404

* [clsi-cache] push docker image to AR

* [clsi-cache] push docker image to AR

* [clsi-cache] allow compileGroup in job payload

* [clsi-cache] set X-Zone header from latest endpoint

* [clsi-cache] use method POST for /enqueue endpoint

* [web] populate clsi-cache in zone b with template data

* [clsi-cache] limit number of editors per project/user folder to 10

* [web] clone: populate the clsi-cache unless the TeXLive release changed

* [clsi-cache] keep user folder when clearing cache as anonymous user

* [clsi] download old output.tar.gz when synctex finds empty compile dir

* [web] fix lint

* [clsi-cache] multi-zonal lookup of single build output

* [clsi-cache] add more validation and limits

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [clsi] do not include clsi-cache tar-ball in output.zip

* [clsi-cache] fix reference after remaining constant

Co-authored-by: Alf Eaton <alf.eaton@overleaf.com>

* [web] consolidate validation of filename into ClsiCacheHandler

* [clsi-cache] extend metrics and event tracking

- break down most of the clsi metrics by label
  - compile=initial - new compile dir without previous output files
  - compile=recompile - recompile in existing compile dir
  - compile=from-cache - compile using previous clsi-cache
- extend segmentation on compile-result-backend event
  - isInitialCompile=true - found new compile dir at start of request
  - restoredClsiCache=true - restored compile dir from clsi-cache

* [clsi] rename metrics labels for download of clsi-cache

This is in preparation for synctex changes.

* [clsi] use constant for limit of entries in output.tar.gz

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>

* [clsi-cache] fix cloning of project cache

---------

Co-authored-by: Brian Gough <brian.gough@overleaf.com>
Co-authored-by: Alf Eaton <alf.eaton@overleaf.com>
Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
GitOrigin-RevId: 4901a65497af13be1549af7f38ceee3188fcf881
2025-04-10 08:05:17 +00:00
Jakob Ackermann
cdf04d695c [clsi] upgrade dockerode to bump tar-fs (#24693)
Diff: https://github.com/apocas/dockerode/compare/v3.3.1...v4.0.5
GitOrigin-RevId: 73ba2610d0c2e766a52e638754af410aaad94ec1
2025-04-08 08:06:23 +00:00
Jakob Ackermann
54f5c3115c [web] convert file-list to typescript (#24354)
* [web] convert file-list to typescript

* [web] add type annotation for clsiServerId without providing default

Co-authored-by: David Powell <david.powell@overleaf.com>

---------

Co-authored-by: David Powell <david.powell@overleaf.com>
GitOrigin-RevId: 5ecb79c2540a3e46e296c6bf7f8573fb65febc3f
2025-03-24 10:46:48 +00:00
Jakob Ackermann
1117ea1b3e [clsi] add helper function for detecting extraneous files (#24376)
* [clsi] add helper function for detecting extraneous files

* [clsi] output.pdfxref and output.synctex.gz are extraneous as well

* [clsi] minor code cleanup

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>

---------

Co-authored-by: Mathias Jakobsen <mathias.jakobsen@overleaf.com>
GitOrigin-RevId: 0d6c96c99b6be3adaee1558b1f958da885e6307a
2025-03-24 10:46:43 +00:00
Jakob Ackermann
8ada51158f [clsi] add support for downloading output files with dot in extension (#24342)
E.g. output.tar.gz

GitOrigin-RevId: d119a41172bb21fb2de429a64b82d05a1efc2375
2025-03-24 10:46:29 +00:00
Jakob Ackermann
13bf214a3c [web] generate clsi buildId ahead of fetching project content (#24337)
* [web] generate clsi buildId ahead of fetching project content

The buildIds timestamp component will be used for cache invalidation.

* [clsi] strict validation for buildId

* [clsi] validate buildId parameter

GitOrigin-RevId: 88e8b2d48e78fa137b6dca7f2e6b93bbcf88a777
2025-03-24 10:46:02 +00:00
Jakob Ackermann
5cdaa424ee [clsi] increase CACHE_AGE for output files to 90 minutes (#24322)
GitOrigin-RevId: d6208281be8d9a97278f7c60e203de68eb3f7501
2025-03-17 09:04:53 +00:00
Jakob Ackermann
0c3a62297a [clsi] collect disk usage more frequently (#24314)
GitOrigin-RevId: 0c5b3ebeadec6d2ac70b7adc77935aa0cea92ffc
2025-03-17 09:04:49 +00:00
Jakob Ackermann
f7e716c826 [clsi] add metric for disk usage (#24303)
GitOrigin-RevId: e21b867a2fdaf54e9ec5b29b0f80b29349eb901c
2025-03-14 09:05:23 +00:00
Andrew Rumble
92499f6260 Revert "Revert "Add a metric so that we can know maint is prevented""
This reverts commit b3c4e7181b5f6f52178e165f6220c485e8e97caf.

GitOrigin-RevId: d5525bbe5cb1546cdff8e201de04762a8d86e332
2025-03-13 09:05:59 +00:00
Andrew Rumble
0002e008bb Revert "Add a metric so that we can know maint is prevented"
This reverts commit a4df6ce7f22df01e1116ae9dbf5c7c7afc73c388.

GitOrigin-RevId: b3c4e7181b5f6f52178e165f6220c485e8e97caf
2025-03-12 09:04:57 +00:00
Andrew Rumble
00aa26cd1a Add a metric so that we can know maint is prevented
GitOrigin-RevId: a4df6ce7f22df01e1116ae9dbf5c7c7afc73c388
2025-03-12 09:04:48 +00:00
Andrew Rumble
13b4e6333c Merge pull request #23874 from overleaf/ar-use-gcp-pre-emptible-signal
[clsi] Use GCP pre-emptible metadata instead of hostname

GitOrigin-RevId: 2df305e68f2999c9d3bde051dbb533025478800f
2025-03-07 09:04:45 +00:00
Jakob Ackermann
d8b0ab9436 [clsi] avoid downloads from compile directory (#23975)
* [clsi] make error copying output files a fatal compile error

Co-authored-by: Rebeka <rebeka.dekany@overleaf.com>

* [clsi] remove unused endpoints for downloading files from compileDir

Co-authored-by: Rebeka <rebeka.dekany@overleaf.com>

* [clsi] avoid useless clone of output files

* [clsi] add test for output files when compile did not produce a PDF

---------

Co-authored-by: Rebeka <rebeka.dekany@overleaf.com>
GitOrigin-RevId: cb998b99b4d96cb48ddd70987958f614ad3b40fc
2025-03-03 09:05:04 +00:00
Andrew Rumble
767591973c Merge pull request #23905 from overleaf/ar-mocha-11
[all] Bump mocha everywhere

GitOrigin-RevId: bf5587047f9ceb88872cbd356c2029717bb8ca9d
2025-02-28 09:05:40 +00:00
Antoine Clausse
fe03d8d7fd Add shellcheck to web, server-pro, server-ce (#23823)
* Update shellcheck files to include non ".sh" files having the sh shebang

* Add shellcheck to root Makefile

* `make shellcheck_fix`

* Add shellcheck to server-ce and server-pro

* Exclude SC1091 (Not following) in SP/CE

* Fix errors in SP

* Fix errors in CE

* Update root shellcheck to ignore all failing rules. We can later remove rules one by one.

* Add shellcheck to web

* Add shellcheck step for server-ce and server-pro in cloudbuild.yaml

* Revert "Add shellcheck to root Makefile"

This reverts commit e0fa56f2

* Revert "`make shellcheck_fix`"

This reverts commit eb179245c109a9e742a7fdeeb75a4bdd03963587.

* `make shellcheck_fix` in server-ce

* Fix: Use $(...) notation instead of legacy backticked

```
In init_scripts/100_set_docker_host_ipaddress.sh line 5:
echo "`route -n | awk '/UG[ \t]/{print $2}'` dockerhost" >> /etc/hosts
      ^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.

Did you mean:
echo "$(route -n | awk '/UG[ \t]/{print $2}') dockerhost" >> /etc/hosts

For more information:
  https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le...
```

* `make shellcheck_fix` in web

* Manual corrections on autofix

* Update SHELLCHECK_FILES to Perl regex so it matches at start of file

GitOrigin-RevId: 815d53f319a3792efa22703beb75570de5977450
2025-02-26 09:05:02 +00:00
Andrew Rumble
59b708e3f7 Allow draining to be prevented in CLSI agent
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
Co-authored-by: Christopher Hoskin <mans0954@users.noreply.github.com>
GitOrigin-RevId: f55de7783cb1c14108eb347eebb74ec329180000
2025-02-26 09:04:26 +00:00
Tim Down
4e353956db Merge pull request #17378 from overleaf/td-stream-buffer-consolidation
Stream and buffer consolidation

GitOrigin-RevId: 284f411e6403e190d2dda3d9ebf806b1935b3949
2025-02-25 09:05:26 +00:00