Commit Graph

73 Commits

Author SHA1 Message Date
Daniel Gak Anagrov e6cd2ab441 feat(preview-service): re introduce preview service acceptance test (#5049)
* feat: basic structure for running tests

* feat: added test to ci

* feat: added server test (wip)

* refactor: restuctured entrypoint

* feat: added supertest

* fix: missing deps

* fix: test example ci

* fix: updated default envs

* feat: debug ci

* feat: switch browser

* fix: superadmin ci

* feat: try another image

* fix: try another image with node

* fix: mr comments

* fix: ci job

* chore: workaround to push the image

* chore: try with new base image

* chore: retry

* chore: retry

* chore: retry

* chore: retry

* chore: retry

* fix: test via debug

* fix: envbar

* chore: wrapped up changes, cleaned mr

* chore: fix linter and skiped puppeteer download

* fix: removed paralelism

* fix: paralelism issues
2025-07-15 10:56:09 +02:00
Iain Sproat ab06b712a7 Merge branch 'main' into iain/dockerfile-node18-node22 2025-05-12 14:46:40 +01:00
Iain Sproat 335f6a2a06 Merge branch 'main' into iain/dockerfile-node18-node22 2025-03-20 09:35:59 +00:00
Iain Sproat 5804ee4b50 fix(preview service): handle shutdown via terminus 2025-03-12 09:28:38 +00:00
Iain Sproat cfef333a0c feat(preview service): introduce /metrics endpoint for Prometheus (#4127) 2025-03-10 10:48:29 +00:00
Gergő Jedlicska 61609de97e gergo/previews (#3765)
* feat(preview-generator): add new preview generator webapp

* wip(preview-service): reworking the preview service backend

* feat(previews): logging

* feat(preview-service): streamline payloads

* fix(preview-service): do not log the full payload

* feat(preview-service): build new preview service

* feat(preview-service): add separate response queue

* feat(previews): integrate preview queues with the server

* feat(previews): use module alias

* chore(previews): remove old preview service code

* feat(previews): log stuff on job statuses

* fix(previews): add missing deps and scripts

* fix(previews): package deps fix

* fix(server): moar typing fixes

* Metrics related to jobs: total count, request failures, response errors & durations

* duration should include unit.
- histogram metric should be summary
- error responses include duration in seconds
- attempt to remove metric before adding it (prevent errors with duplicate metrics)

* fix(server, frontend): some ts fixes

* fixes

* fix(frontend): remove unneeded ts-expect-error

* chore(preview-service): eslint

* TS fix

* feat(previews): more smoal fixes

* fix(preview-service): alias loading

* feat(helm): updates for new preview service queue setup

* feat(preview-service): launch new browser for each job

* feat(preview-service): add timeout, fix liveliness

* fix(helm): add access to new secret in service accounts

* tidy metrics into a separate file

* Remove broken preview service acceptance test

* fix broken import

* Add metrics to test

* feat(preview-service): handle preview service shutdown properly

* fix(previews): merge bork

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2025-03-06 14:26:56 +01:00
Iain Sproat aaaf75d151 Merge branch 'main' into iain/dockerfile-node18-node22 2025-02-05 12:16:04 +00:00
Iain Sproat da6dbb94a6 fix(knex): bump knex from 2.4.1 to 2.5.1 to resolve leaking db connections (#3751) 2025-01-06 11:11:49 +00:00
Gergő Jedlicska 9e383f83b1 fix(workers): add zod and znv (#3484) 2024-11-11 17:10:59 +00:00
Iain Sproat a4bff8da2b Merge branch 'main' into iain/dockerfile-node18-node22 2024-10-14 19:36:48 +01:00
Iain Sproat 31476cbdc5 chore(preview service): acceptance test loads geometry from csv file (#3083) 2024-09-24 16:26:31 +01:00
Iain Sproat 016b8b031d fix(github action): preview service acceptance (#2891)
- should run on changes to files in directory
- Remove pnpm
- Allow postgres connection string to be configured for acceptance test
- Different postgres connection string if running inside preview container
- Run the preview-service image as a github action service
- separate the jobs into a build and a test job
- do not run the preview-service via the acceptance test, instead run it via github actions
- Add correct permission to job
- Add logging to the test, to understand progress
- Allow database name to be passed in to acceptance test
- Only delete the database if the test helper owns (created) it
- Upload image to s3 bucket
2024-09-17 12:11:25 +01:00
Gergő Jedlicska 965c9f94f6 feat(preview-service): use axios for proper timeout support (#2939) 2024-09-11 10:55:37 +02:00
Iain Sproat 9a28e467ba refactor(preview-service): conforms to design patterns, adds tests, and is typed (#2429)
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2024-09-04 13:06:23 +01:00
Iain Sproat cd3ef0e951 chore(node): bump from 18 to 22 2024-08-16 08:49:34 +01:00
Kristaps Fabians Geikins c7fdc6acc2 chore: updating ws everywhere to resolve SNYK-JS-WS-7266574 (#2385)
* chore: updating ws in various ways

* puppeteer upgrade

* updating codegen deps

* workspaces cmd update

* various extra fixes

* minor preview-service troubleshooting improvements

* dockerfile fixes

* hopefully fixing docker build fe2

* try again

* try large again
2024-06-18 13:26:01 +03:00
Kristaps Fabians Geikins 83d8035dc2 chore: upgrade to eslint 9 (#2348)
* root + server

* frontend

* frontend-2

* dui3

* dui3

* tailwind theme

* ui-components

* preview service

* viewer

* viewer-sandbox

* fileimport-service

* webhook service

* objectloader

* shared

* ui-components-nuxt

* WIP full config

* WIP full linter

* eslint projectwide util

* minor fix

* removing redundant ci

* clean up test errors

* fixed prettier formatting

* CI improvements

* TSC lint fix

* 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader

* removed unnecessary void

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-06-12 14:38:02 +03:00
Iain Sproat 8842a8f840 chore(deps): bump express to 4.19.2 (#2166)
* chore(deps): bump express to 4.19.2
- address https://security.snyk.io/vuln/SNYK-JS-EXPRESS-6474509

* chore(deps): update express used by speckle-server
2024-03-26 10:23:04 +00:00
Alexandru Popovici ef660de293 Updated viewer version (#2021) 2024-02-06 21:04:43 +02:00
Iain Sproat b6b37921b9 fix(helm-chart/preview-service): revert puppeteer version and add puppeteer cache as empty dir volume to helm chart (#2018) 2024-02-06 18:38:48 +00:00
Iain Sproat b5f77f3921 chore(deps): bump bcrypt and puppeteer to enable building on apple silicon (#1965) 2024-01-29 14:31:27 +00:00
Alexandru Popovici 823996dd0c preview-service <-> viewer API 2.0 (#1956)
* Pinned the viewer version for the preview-service to the last viewer version before the API 2.0 merge as a temporary solution until the preview service is updated to use API 2.0

* updated lock
2024-01-11 15:33:42 +02:00
Iain Sproat 3db83e50be chore(deps): bump node from 18.18.2 to 18.19.0 (#1921)
* chore(deps): bump node from 18.18.2 to 18.19.0

* Additional dependencies
2023-12-15 11:30:07 +01:00
Iain Sproat 438c6bbf0d chore(deps): bump node from 18.17.1 to 18.18.2 (#1844) 2023-10-31 18:08:25 +00:00
Iain Sproat 85f256d323 chore(deps): bump sharp to 0.32.6 (#1823)
- resolves SNYK-JS-SHARP-5922108
2023-10-17 16:57:49 +01:00
Iain Sproat 080e8197f9 chore(deps): bump node from 18.17.0 to 18.17.1 (#1771) 2023-08-24 10:55:43 +01:00
Iain Sproat ea941b3b81 chore(deps): bump node to 18.17.0 (#1722) 2023-07-26 12:38:50 +01:00
Kristaps Fabians Geikins 3999372b68 fix: pino dep missing 2023-07-12 11:55:48 +03:00
Iain Sproat ffc3c5186f chore(node): bump to 18.16.1 (#1675) 2023-07-07 16:54:18 +01:00
Iain Sproat 4eab7d9dcd chore(deps): bump node to 18.16.0 (#1564) 2023-05-05 12:43:39 +01:00
dependabot[bot] 4ebb776feb chore(deps-dev): bump webpack from 5.72.0 to 5.76.0 (#1456)
Bumps [webpack](https://github.com/webpack/webpack) from 5.72.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.72.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-16 12:27:44 +00:00
Iain Sproat 87e8d08e64 chore(deps): bump node to 18.15.0 (#1446) 2023-03-10 11:01:30 +00:00
Iain Sproat d8b7123ed0 chore(deps): bump node from 18.14.0 to 18.14.2 (#1426) 2023-03-01 12:16:55 +00:00
Iain Sproat a6fba9ebd3 chore(node): bump node version to 18.14.0 (#1365) 2023-02-10 11:44:44 +00:00
dependabot[bot] f7e71c76b8 chore(deps): bump knex from 2.0.0 to 2.4.1 (#1306)
* chore(deps): bump knex from 2.0.0 to 2.4.0

Bumps [knex](https://github.com/knex/knex) from 2.0.0 to 2.4.0.
- [Release notes](https://github.com/knex/knex/releases)
- [Changelog](https://github.com/knex/knex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/knex/knex/compare/2.0.0...2.4.0)

---
updated-dependencies:
- dependency-name: knex
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump knex from 2.0.0 to 2.4.1

Addresses dependabot issue 165

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2023-01-18 11:40:17 +00:00
Iain Sproat 0e0eafdb78 chore(deps): bumps sharp in preview-service from ^0.30.5 to ^0.30.7 (#1321) 2023-01-18 09:54:32 +00:00
Iain Sproat 97ded1a9fe Dependabot bumps combined (as of 2023-01-10) (#1298)
* chore(deps): bump vuetify from 2.6.5 to 2.6.10

Bumps [vuetify](https://github.com/vuetifyjs/vuetify/tree/HEAD/packages/vuetify) from 2.6.5 to 2.6.10.
- [Release notes](https://github.com/vuetifyjs/vuetify/releases)
- [Commits](https://github.com/vuetifyjs/vuetify/commits/v2.6.10/packages/vuetify)

---
updated-dependencies:
- dependency-name: vuetify
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump loader-utils from 2.0.2 to 2.0.4

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.2...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump apollo-server-core from 3.10.2 to 3.11.1

Bumps [apollo-server-core](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-core) from 3.10.2 to 3.11.1.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/apollo-server-core@3.11.1/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-core@3.11.1/packages/apollo-server-core)

---
updated-dependencies:
- dependency-name: apollo-server-core
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump express from 4.16.4 to 4.17.3

Bumps [express](https://github.com/expressjs/express) from 4.16.4 to 4.17.3.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.16.4...4.17.3)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump json5 from 2.2.1 to 2.2.3

Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump passport from 0.4.1 to 0.6.0

Bumps [passport](https://github.com/jaredhanson/passport) from 0.4.1 to 0.6.0.
- [Release notes](https://github.com/jaredhanson/passport/releases)
- [Changelog](https://github.com/jaredhanson/passport/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jaredhanson/passport/compare/v0.4.1...v0.6.0)

---
updated-dependencies:
- dependency-name: passport
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump luxon from 3.0.1 to 3.2.1

Bumps [luxon](https://github.com/moment/luxon) from 3.0.1 to 3.2.1.
- [Release notes](https://github.com/moment/luxon/releases)
- [Changelog](https://github.com/moment/luxon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moment/luxon/compare/3.0.1...3.2.1)

---
updated-dependencies:
- dependency-name: luxon
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump @graphql-codegen/cli

* chore(deps): bump nodemon to resolve got dependabot issue

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-10 11:26:57 +00:00
Iain Sproat 96bed71022 fix(logging): Improves error logging and pretty-prints logs during dev & test (#1255)
* Improves error logging
- use pino error logger correctly by passing in error as first argument

* monitor deployment: Filter logging at INFO level and above
* Use structured logging to create parameters for monitoring results
* Add structured logging to obj fileimport service
* Fileimport service, fix and improve logging
    - use child logger with additional context where possible
    - select appropriate logging level
- fix duplicated context in log statement
* REST endpoints, add context to structured logging and remove same context from message
* Webhook service provides context to bound logger to properly use structured logging
    - Pass bound logger containing context to `makeNetworkRequest`
    - do not log url, as it may contain a secret (like Discord's webhook urls), instead log the webhook Id
     - log error message when network call fails
* upload: make better use of structured logging when recording data
* pino-pretty when in dev or test mode
    - pino-pretty configured to send to stderr
* LOG_PRETTY env var
* Silence structured logging during testing
     - can not rely on determining the port number by reading from stdout/stderr
     - instead we determine which port is free, then create our server on that port
     - we then poll that port until the server is ready before commencing tests
* Allow puppeteer to install chromium
* Do not need to install chromium separately
2022-12-13 09:18:28 +00:00
Iain Sproat ee50b32b59 chore(node): upgrades to node 18 (#1189)
* chore(node): upgrades to node 18

Node 16 was out of support (but not security upgrades), so bumping to next stable version.

https://github.com/specklesystems/speckle-server/issues/1187

* Update server liveness and readiness probes for node 18
* Bump web-ifc to 0.0.36
* Apply `--no-experimental-fetch` flag to fileimport-service to prevent issues in web-ifc (via emscripten) with node 18
2022-12-06 12:57:48 +00:00
Iain Sproat 4d01e13a84 feat(structured logging) (#1242)
* Revert "Revert structured logging 2 (#1240)"
This reverts commit 78ecaeffcb.
* Logging should not be bundled into core shared directory
* making sure observability stuff isnt bundled into frontend


Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-12-06 11:51:18 +00:00
Iain Sproat 78ecaeffcb Revert structured logging 2 (#1240)
* Revert "'@' shortcut must come after it is configured in bootstrap (#1239)"

This reverts commit 967329473f.

* Revert "Structured logging (attempt 2) (#1234)"

This reverts commit 444d2ca7dd.
2022-12-05 15:46:09 +00:00
Iain Sproat 444d2ca7dd Structured logging (attempt 2) (#1234)
* Revert "Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)"

This reverts commit 63e6581162.

* Use pino-http instead of express pino logger
* Use correct reference to knex and do not instantiate HttpLogger prematurely
* Adds missing dependency for pino to webhook-service
* Do not instantiate middleware when passed to express
* Refactor to move logging into shared
* Copy shared packages into dockerfiles
* Build shared workspace in docker build-stage for fileimport & webhook
2022-12-05 14:49:52 +00:00
Iain Sproat 63e6581162 Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)
This reverts commit 84cb74e8b3.
2022-11-25 16:57:28 +00:00
Iain Sproat 84cb74e8b3 feat(structured logging): implements structured logging for backend (#1217)
* each log line is a json object
* structured logging allows logs to be ingested by machines and the logs to be indexed and queried addresses #1105
* structured logging allows arbitrary properties to be appended to each log line, and ingestion of logs to remain robust
* Structured logging provided by `pino` library
* Add `express-pino-logger` dependency
* Remove `debug`, `morgan`, and `morgan-debug` and replace with structured logging
* `console.log` & `console.error` replaced with structured logging in backend
* Remove `DEBUG` environment variable and replace with `LOG_LEVEL`
- Note that there is a test which reads from a logged line on `stdout`. This is not robust, it would be better to use the childProcess.pid to look up the port number.
* Log errors at points we explicitly send error to Sentry
* Amend indentation of a couple of log messages to align indentation with others
2022-11-25 16:05:05 +00:00
dependabot[bot] e26b67d1b2 chore(deps): bump file-type from 16.5.3 to 16.5.4 (#1082)
* chore(deps): bump file-type from 16.5.3 to 16.5.4

Bumps [file-type](https://github.com/sindresorhus/file-type) from 16.5.3 to 16.5.4.
- [Release notes](https://github.com/sindresorhus/file-type/releases)
- [Commits](https://github.com/sindresorhus/file-type/compare/v16.5.3...v16.5.4)

---
updated-dependencies:
- dependency-name: file-type
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updates yarn.lock

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2022-10-25 11:25:16 +01:00
Kristaps Fabians Geikins 827500c32b fix(frontend): embed viewer bugfixes & speed improvements (#804)
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
2022-06-16 12:37:04 +03:00
Gergő Jedlicska 1d8ffac57a update knex dependency chain (#776)
* chore(root): update packages

* chore(server + preview service): add pg-query-stream peer dependency

* build(dockerfiles): unify and update docker base layer to latest node lts
2022-06-01 10:25:09 +02:00
Dimitrie Stefanescu 0ff34c383c Merge pull request #778 from specklesystems/dim/angle-previews
3D previews fixes
2022-05-26 20:17:16 +01:00
Dimitrie Stefanescu d98a3c5d15 feat(previews): creates stiched frames previews 2022-05-26 15:53:01 +01:00
Gergő Jedlicska 1b3f653eca build(preview-service): remove ghost dependencies from preview service (#770) 2022-05-25 14:24:03 +02:00