Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .changeset/aio-documentdb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@hyperdx/api': minor
---

feat: store all-in-one metadata in DocumentDB instead of MongoDB 4.0.5

DocumentDB is MIT licensed and runs on Postgres 18, which removes the SSPL
licence and the critical OpenSSL 1.1.1k CVEs that came with the bundled MongoDB.
Metadata still lives on the `/data/db` mount, now under `/data/db/pgdata`. The
image cannot read the MongoDB files already there and starts with an empty
database, so users, sources, dashboards and alerts saved by an older image need
to be moved across once:

1. Stop the old container, then start its MongoDB on its own:
`docker run -d --name old-mongod -v <volume>:/data/db --entrypoint mongod <old-image> --dbpath /data/db --bind_ip_all`
2. Dump it with the 4.0 tools, since newer `mongodump` refuses MongoDB 4.0:
`docker run --rm --network container:old-mongod mongo:4.0.5 mongodump --db hyperdx --archive > hyperdx.archive`
3. Remove `old-mongod`, start the new image with the same `/data/db` volume and
wait for the UI to load.
4. Restore into it, then restart the container:
`docker run --rm -i --network container:<new-container> mongo:7.0 mongorestore --uri "mongodb://hyperdx:hyperdx@localhost:10260/?authMechanism=SCRAM-SHA-256" --ssl --tlsInsecure --drop --archive < hyperdx.archive`

The old MongoDB files stay in `/data/db` until you delete them.
2 changes: 1 addition & 1 deletion .github/actions/e2e-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ runs:
shell: bash
run: |
docker buildx create --use --driver=docker-container
docker buildx build docker/documentdb -t hyperdx/documentdb:local --cache-to "type=gha,mode=max,scope=documentdb" --cache-from "type=gha,scope=documentdb" --load
docker buildx build . -f docker/hyperdx/Dockerfile --target documentdb -t hyperdx/documentdb:local --cache-to "type=gha,mode=max,scope=documentdb" --cache-from "type=gha,scope=documentdb" --load

- name: Start E2E Docker Compose
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
docker/hyperdx/**
docker/clickhouse/**
docker/otel-collector/**
.vex/**
docker/documentdb/**
- name: Setup Docker Buildx
if:
github.event_name != 'pull_request' ||
Expand Down
150 changes: 0 additions & 150 deletions .vex/openssl-mongodb.vex.json

This file was deleted.

3 changes: 2 additions & 1 deletion agent_docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ yarn dev # or equivalently: make dev
- Docker Compose manages ClickHouse, DocumentDB, OTel Collector
- The metadata store is [DocumentDB](https://github.com/documentdb/documentdb)
(Postgres plus a Mongo wire-protocol gateway), built from
`docker/documentdb/Dockerfile`. The API still talks to it through Mongoose.
the `documentdb` stage of `docker/hyperdx/Dockerfile`, the same build the
all-in-one image ships. The API still talks to it through Mongoose.
To browse it with MongoDB Compass or `mongosh`, connect to
`mongodb://hyperdx:hyperdx@localhost:<HDX_DEV_MONGO_PORT>/?tls=true&tlsAllowInvalidCertificates=true&authMechanism=SCRAM-SHA-256`.
Everything works except Compass's Performance tab (the gateway doesn't
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ services:
- internal
db:
image: hyperdx/documentdb:local
build: ./docker/documentdb
build:
context: .
dockerfile: docker/hyperdx/Dockerfile
target: documentdb
environment:
DOCDB_USER: hyperdx
DOCDB_PASSWORD: hyperdx
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ services:
hdx.dev.service: documentdb
hdx.dev.port: '${HDX_DEV_MONGO_PORT:-27017}'
image: hyperdx/documentdb:local
build: ./docker/documentdb
build:
context: .
dockerfile: docker/hyperdx/Dockerfile
target: documentdb
environment:
DOCDB_USER: hyperdx
DOCDB_PASSWORD: hyperdx
Expand Down
48 changes: 0 additions & 48 deletions docker/documentdb/Dockerfile

This file was deleted.

Loading
Loading