Skip to content
Merged
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
3 changes: 3 additions & 0 deletions changelog/unreleased/Skyfay-lab-native-mongodb.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion docs/developer-guide/reference/dev-lab.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 5 additions & 1 deletion lab/src/seed/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ async function ensureVaultKey(): Promise<string> {
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 },
]);
}

Expand Down
Loading