diff --git a/changelog/unreleased/Skyfay-lab-native-mongodb.md b/changelog/unreleased/Skyfay-lab-native-mongodb.md new file mode 100644 index 00000000..502b7a1b --- /dev/null +++ b/changelog/unreleased/Skyfay-lab-native-mongodb.md @@ -0,0 +1,3 @@ +### 🧪 Tests + +- **lab**: The seed adds a job for the MongoDB of each native server, so `pnpm lab:check --run` also backs up MongoDB over SSH. diff --git a/docs/developer-guide/reference/dev-lab.md b/docs/developer-guide/reference/dev-lab.md index 99546204..9f1917b4 100644 --- a/docs/developer-guide/reference/dev-lab.md +++ b/docs/developer-guide/reference/dev-lab.md @@ -130,7 +130,7 @@ Most servers DBackup backs up run their databases from the packages of their dis - One login for OpenSSH and every database, with the user and password of `login`. MySQL keeps `auth_socket` for root, as Ubuntu installs it. - OpenSSH on an extra port, 2222 by default, where a wrong password fails like on any server. Use that port in `login` when port 22 of the server is not OpenSSH. -The seed then adds every database of the server as a source in SSH mode. The end-to-end tests do not need such a server: the container `customer` of `lab/compose/e2e.yml` installs the same packages and stands in for it. Ubuntu has no `mariadb-dump`, so the MySQL source also covers the fallback to `mysqldump`. +The seed then adds every database of the server as a source in SSH mode, and a paused job each for its PostgreSQL, MySQL and MongoDB. MongoDB is reached over SSH only here, so its job is the one run of the lab that calls `mongodump` through SSH. The end-to-end tests do not need such a server: the container `customer` of `lab/compose/e2e.yml` installs the same packages and stands in for it. Ubuntu has no `mariadb-dump`, so the MySQL source also covers the fallback to `mysqldump`. MongoDB 5 and later need a CPU with AVX. A virtual machine with a generic CPU model has none, so give it the CPU type of its host, or MongoDB 8.0 does not start there, in a container or from the packages. diff --git a/lab/src/seed/jobs.ts b/lab/src/seed/jobs.ts index c0c1c5dc..bfaf60f3 100644 --- a/lab/src/seed/jobs.ts +++ b/lab/src/seed/jobs.ts @@ -42,11 +42,15 @@ async function ensureVaultKey(): Promise { return (await createEncryptionProfile("Lab key", "Created by the dev lab seed")).id; } -/** Two jobs for each native host: PostgreSQL to SFTP, and MySQL through the mysqldump of Ubuntu. */ +/** + * Three jobs for each native host: PostgreSQL to SFTP, MySQL through the mysqldump of Ubuntu, and + * MongoDB, the only source of the lab that runs mongodump over SSH. + */ function nativeJobs(hosts: string[]): JobSpec[] { return hosts.flatMap((host) => [ { name: `Lab ${host} PostgreSQL to SFTP`, source: `${host}-postgres`, destinations: ["sftp"], encrypted: true }, { name: `Lab ${host} MySQL to Local`, source: `${host}-mysql`, destinations: ["local"] }, + { name: `Lab ${host} MongoDB to S3`, source: `${host}-mongodb`, destinations: ["s3"], encrypted: true }, ]); }