Commit Graph

21 Commits

Author SHA1 Message Date
Iain Sproat 55d51bd84f feat(db monitor): adds a new metric speckle_db_tablesize with db table sizes (#2474)
* feat(db queries): adds db query scripts for determining db sizes

* Adds a new metric `speckle_db_tablesize` with db table sizes

* lower case all the file types to provide a combined metric

* group file status count by lower cased file type

* reinstate accidentally deleted metric

* Fix developer script
2024-07-05 15:12:27 +01:00
github-actions[bot] a79680da00 Update image digests (#2203)
Signed-off-by: specklebot <devops@speckle.systems>
Co-authored-by: specklebot <devops@speckle.systems>
2024-06-18 10:18:46 +01:00
github-actions[bot] 11b62f3824 Update image digests (#2189)
Signed-off-by: specklebot <devops@speckle.systems>
Co-authored-by: specklebot <devops@speckle.systems>
2024-04-09 10:05:32 +01:00
github-actions[bot] bbe48effd0 Update image digests (#2139)
Signed-off-by: specklebot <devops@speckle.systems>
Co-authored-by: specklebot <devops@speckle.systems>
2024-03-15 16:42:10 +00:00
github-actions[bot] 4418932832 Update image digests (#2040)
Signed-off-by: specklebot <devops@speckle.systems>
Co-authored-by: specklebot <devops@speckle.systems>
2024-02-23 12:42:29 +00:00
github-actions[bot] 8185683b4a Update image digests (#1966)
Signed-off-by: specklebot <devops@speckle.systems>
Co-authored-by: specklebot <devops@speckle.systems>
2024-02-09 01:13:48 +00:00
github-actions[bot] 36f749b24a chore(deps): bump image digests (#1939)
* fix(github action): use correct format for author & committer git signing

* Update image digests

Signed-off-by: specklebot <devops@speckle.systems>

---------

Signed-off-by: specklebot <devops@speckle.systems>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
Co-authored-by: specklebot <devops@speckle.systems>
2024-01-05 15:57:25 +00:00
Iain Sproat b396029cf6 chore(Dockerfile): bump images to debian bookworm, pin images by digest, and github action to auto-bump (#1937)
* chore(Dockerfile): pin images by digest this ensures consistent builds with images pinned by SHA
* introduces a GitHub Action will create a PR to update the images when there is a new version, and will pin to that newer version SHA.

* Bump debian to 12 'bookworm'
* Bump pypi libraries
  * except frontend-1, as only debian 11 is currently supported by openresty
* Bump debian packages
2024-01-05 11:51:04 +00:00
Iain Sproat dcf8bcc607 fix(monitor): logging should produce a msg field containing the message (#1363)
python logging produces an event field with the message, but all other loggers produce a msg field.
2023-02-08 15:35:43 +00:00
Iain Sproat 2852789df1 Use estimate instead of count when getting number of rows in table (#1266) 2022-12-13 16:25:13 +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 d0828693ff Enable python linting/formatting in pre-commit (#1257)
- fix all the linting/formatting issues
2022-12-09 11:20:45 +00:00
Iain Sproat d09bce7267 feat(docker images): Distroless (#935)
* Moves speckle-server, webhook-service, fileimport-service, monitoring-deployment, and test-deployment images to Distroless.

Partially addresses https://github.com/specklesystems/speckle-server/issues/883

* preview-service uses similar image for building and production stages
* explicitly include chromium-common dependency to prevent error in preview service
* Bump chromium packages due to package versions not being found
* Handle machine-id in distroless
    - distroless has no shell, so node-machine-id will result in an error
    - this commit introduces error handling and defaults to a uuid v4 in the case of an error
* Update binary location for readiness and liveness checks to match the binary location in Distroless
* Allow node binary path to be set as environment variable in fileimport service
2022-12-07 12:07:42 +00:00
Iain Sproat 3d4b3b6979 Pin python requirements and bump to latest versions (#1140)
* Pin python requirements and bump to latest versions
* fix(fileimports): add exception printing to file imports

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-11-01 11:17:03 +00:00
Iain Sproat 44bd5919f8 Revert "perf(Docker images): production images are based on distroless (#899)" (#934)
This reverts commit 7fe41b1fb2.
2022-08-16 16:42:59 +01:00
Iain Sproat 7fe41b1fb2 perf(Docker images): production images are based on distroless (#899)
- perf(server, webhook-service): production images are based on distroless

Reduces image file size by >40% for images which can use distroless base image.  As
well as improving boot-up & restart time (via smaller download & load size), Distroless reduces the
attack surface area by removing almost all binaries & packages (e.g. shell, chown) that are not
necessary to run node.

- ensures distroless node images run tini
- removes fonts-dejavu-core and fontconfig from speckle-server
- Remove man and doc files if they exist
- args hoisted to top of Dockerfile and consolidated
- env vars consolidated to prevent additional layers

address https://github.com/specklesystems/speckle-server/issues/883
2022-08-16 16:17:07 +01:00
Iain Sproat 1c5964fc41 Add Hadolint to pre-commit (#848)
* Adds hadolint as pre-commit step
* Addresses all hadolint comments
  * Use noninteractive apt-get frontend and clean after install
  * dockerfile RUN statements are consolidated to prevent additional layers
  * installed packages have pinned versions
* build(circleci): use speckle pre-commit runner with built-in hadolint
* Integrate pre-commit with husky bash script for git pre-commit hooks
  * catches errors in bash
  * if pre-commit is installed, it is run
  * if optional additional binaries are installed, further pre-commit steps are run
* Update README with revised developer instructions
* Adds a pre-commit yarn script
2022-08-09 13:47:02 +01:00
Iain Sproat 81bed0c760 style: at newlines at end of files (#893) 2022-08-08 11:06:56 +02:00
Gergő Jedlicska c894f40f83 minor updates (#817)
* feat(server): add server authz pipeline rework first sketch

* feat(server authz): add new server authz middleware poc implementation

* test(server authz): add unittests for the new server authz workflow

* feat(wip rework of fileuploads vs blob storage): add basim impl of separate blob storage service

* feat(fileimport service): refactored file import service to utilize the new asssetstorage service

* refactor(server errors): refactor server errors to use the shared module definitions

Now all the errors inherit from BaseError

* refactor(fileimport service): cleanup after refactor

* feat(frontend fileimports): use the new blob storage for downloading the original file

* refactor(server fileimports): clean up the remnants of S3 storage from file imports

* refactor(server authz): centralize generic authz pipeline configs

* refactor(server blob storage): refactor / rename everything to use the `blob-storage` name

* ci(circleci): add s3 objectstorage environment variables

* ci(circleci): fix missing env variables

* ci(circleci): add minio test container

* ci(circleci): fix minio app startup

* ci(circleci): enable circleci remote docker

* ci(circleci): fix minio startup

* ci(cirleci): detach and wait properly for minio to start

* ci(circleci): revert to additional minio img config, it only fails when the container is stopped ?!

* ci(circleci): disable file uploads

* fix(fileimports): update with blob storage refactor leftovers

* feat(server blob storage): add blob storage graphql api

* refactor(server errors): merge new errors to shared module

* fix(server comments rte): fix import for RTE error

* chore(fileimports): remove node-fetch from dependency

* chore(server): remove body parser dependency

* fix(server blob storage): fix gql api

* fix(frontend): fix fileupload item not loading the new upload status, cause of premature event fire

* feat(server blob storage): fix file size limit and allow for public streams

* Update packages/server/modules/blobstorage/graph/schemas/blobstorage.graphql

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>

* chore(blobstorage): fix PR review issues

* fix(server): fix import bugs

* test(server): blob storage first test

* test(server blob services): add tests for blob storage services

* test(server blob storage): add service and rest api tests

* test(server blob storage): add server blob storage graphql api tests

* feat(server blob storage): store and make available blob fileHash attribute

* feat(server authz): add fatal failure option to server authz pipeline

* test(server authz): add optional stream context checks with tests

* feat(monitor deployment): add shutdown signal handling to monitor deployment container

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-07-04 19:29:45 +02:00
Cristian Balas ebe1571488 deployment monitor fix (#744) 2022-05-06 12:59:54 +03:00
cristi8 0a0fe3cb77 monitoring microservices; new container for overall monitoring of a deployment; helm update; helm local testing 2022-05-05 02:01:00 +03:00