ConductScience Sequences
Contents

Installation guide · Records and upkeep

Backups

Back up the data volume and settings, and restore one case.

The data volume holds:

Path in the volumeWhat it isBack up?
jobs/Every search and alignment, with its results, marks and record, each portfolio export's CSV and FASTA files, and each result file imported into a case, as it came, with its joined rowsYes
databases/FASTA collections imported on the page with sign-in off. An import that fails, is cancelled or is cut off by a stop leaves no folderYes
listings/, fragments.jsonl, query-groups.jsonlUploaded sequence listings, saved sequence fragments and saved query groupsYes
cases/Cases: their claims, search plans, searches added by hand or imported, notes and the log of every step. Reports are not kept, and the log has each one's SHA-256Yes
watches/Watches: each one's search or applicant, the matches or publications it has seen and its runs, and the key behind the stop links in watch emailsYes
tokens.json, batches/API tokens (a hash of each, never the token itself, with its name, account and state) and each batch's list of searchesYes
applicants/Each account's applicant joins and the log of every join and undoYes
preferences/Each account's own choices and saved hits, in a folder named by the SHA-256 of its ID (local/ on the local workbench): its column choices, saved column maps, model switches and hit lists, in its collections/ folderYes
audit/The service's audit log: sign-ins, API tokens, starts and their settings, invite file changes, cases handed to another account, changes to organizations, deletions and audit exports. See Audit export for a SIEMYes
papers/, ror/, taxa/Paper folders, ROR name indexes and taxa folders, read-onlyYes. The service does not start without the folders its settings name, and a paper folder made again gets a new ID, and a taxa folder a new build time
taxa-scans/The source scans a taxa folder was made fromYes: once the source files are gone, a scan cannot be made again, and a new taxa folder needs it
clinical/Clinical context folders, read-only, with clinical context onOptional if you keep the copies you received: load makes the folders again from them
funding/Funding trail folders, read-only, with the funding trail onOptional if you keep the copies you received: load makes the folders again from them
drugs/Drug names folders, read-only, with drug names onOptional if you keep the copies you received: load makes the folders again from them
accounts.jsonThe name each account last signed in with, for the usage page and for handing a case to a colleague, and the group its last sign-in found when sign-in requires oneYes
organizations.jsonEach organization: its name, its members and their roles, and who added each and when. A case shared with one names it in the case's own case.jsonYes. Without it, every case stays its owner's alone and no member opens a shared case
sign-in-provider.jsonThe sign-in provider the volume belongs to. See Move to another providerYes
session-secret, calibration.jsonThe cookie key and the run-time estimates. A search whose estimate cannot be written, on a full disk say, still completes, and the log says soYes
export-formats.jsonThe SHA-256 of each export format the service has read, by name and version. See Export formatsYes
corpora/, deltas/Snapshots and deltas, read-onlyNo, if you keep the copies you loaded: load them again from those. A snapshot you built yourself cannot be built again from the same files, since GenBank keeps only its current release, so back it up as below
checked/The SHA-256 list of each snapshot and delta, which a coordinator and its workers compareOptional: load writes it, and without it a coordinator or worker reads each folder whole at its next start
inputs/, work/, sessions/, .lockSource files for a build, scratch space, the record of each signed-in session, and the running service's claimNo

Each file on the data volume is readable only by the service's account. On a server you run, protection at rest comes from your environment, such as an encrypted volume, for the data volume and its backups alike.

With several servers, back up the coordinator's volume: it holds every search, result, case and log. A worker's volume holds its copies of the snapshots, deltas, paper folder and taxa folder, which you load or copy again, and the searches it runs, which start over on another server when it stops.

Back up /etc/sequences too: the license, the settings and the client secret. On the server:

sudo install -d -m 0700 /srv/backup
sudo tar -czf /srv/backup/sequences-config-$(date +%F).tar.gz -C /etc sequences

The command below copies the data volume, all but the snapshots, deltas, scratch files and session records. To keep snapshots and deltas you built yourself, leave out --exclude=./corpora --exclude=./deltas. Stop the service first with docker stop sequences, which cancels any search still running, and start it again afterwards with docker start sequences. The one-off container runs tar as root so it can write to your backup folder. The archive holds the cookie key, so keep it as safe as the server:

docker run --rm --user 0 \
  -v sequences-data:/data:ro \
  -v /srv/backup:/backup \
  --entrypoint tar conductscience/sequences:<version> \
  --exclude=./corpora --exclude=./deltas --exclude=./inputs --exclude=./work --exclude=./sessions --exclude=./.lock \
  -czf /backup/sequences-data-$(date +%F).tar.gz -C /data .

To restore on a new server, or after you remove the old volume (docker volume rm sequences-data), put the settings back, create the volume and unpack the archive. Then load the same snapshots and deltas again, unless the archive holds them, so older results can open their records:

sudo tar -xzpf /srv/backup/sequences-config-<date>.tar.gz -C /etc
docker volume create sequences-data
docker run --rm --user 0 \
  -v sequences-data:/data \
  -v /srv/backup:/backup:ro \
  --entrypoint tar conductscience/sequences:<version> \
  -xzpf /backup/sequences-data-<date>.tar.gz -C /data

Measured on release 0.92.0, with 2 CPUs for each command, on a coordinator's volume of 3.4 GB without its snapshots that held 580 searches: the backup took 61 seconds and made a 339 MB archive, and the restore took 17 seconds. Every file of the restored volume matched the original by SHA-256, size, permissions and time, its audit log checked whole, and audit-export gave the same events from both.

Restore one case

To bring back one deleted case without taking every account back to the day of the backup, unpack the backup's cases, jobs and listings into a folder under restore/ in the data volume, named with letters, digits, dots, dashes and underscores:

docker run --rm --user 0 \
  -v sequences-data:/data \
  -v /srv/backup:/backup:ro \
  --entrypoint sh conductscience/sequences:<version> -c \
  'mkdir -p /data/restore/backup-<date> && tar -xzpf /backup/sequences-data-<date>.tar.gz -C /data/restore/backup-<date> ./cases ./jobs ./listings && chown -R 10001:10001 /data/restore'

Then on the admin page, Restore a case lists each case in the folder that the server does not have, with its name, owner, searches and whether its log checks whole. Restore copies the case back with its log, and the searches and listings it held that the server no longer has, while the service runs. A case whose log does not check whole, or whose ID is in use, is refused before anything is copied. The case's log ends with a case.restored event, and the service's audit log gets one with the case, its owner, its log's last event, the folder and what was copied. Delete the folder when you are done:

docker run --rm --user 0 -v sequences-data:/data --entrypoint rm conductscience/sequences:<version> -rf /data/restore/backup-<date>

Guide version 1.63.0 · For Sequences 0.155.0