Connecting to Lotte¶
Lotte is the digital archive service beside Anton. A tenant connected to Lotte hands every new media file to Lotte; Lotte keeps the master as an OCFL object, checks it, identifies its format and makes derivatives and text where needed. Anton keeps the description, the medium as a row with the number of its object in Lotte, and still decides who may see what (anton#857).
Pilot
The connection is built and tried against a local Lotte, but not yet switched on for any tenant. A pilot comes before the first production use; until then every tenant works as described in Digital archive: overview.
What changes for a tenant¶
| without Lotte | with Lotte | |
|---|---|---|
| new master | on the Anton server | in Lotte, no longer on the Anton server |
| checks on ingest | Anton | Lotte, with the same checks |
| checksums, format, PRONOM ID | determined by Anton | taken from Lotte (SHA-512) |
| integrity check of the masters | media:check, media:snapshot |
Lotte (lotte:verify); Anton's commands leave these media out |
access copies web, thumb, poster |
Anton | Anton (default) or Lotte, see Derivatives |
| full text from the files | Anton | Lotte; the text reaches Anton's search through the change feed |
| deleting a medium | deletes the file | withdraws the object in Lotte, with a reason |
Media added before the switch stay on the Anton server until they are moved. Anton keeps both kinds side by side: each medium goes to the archive that holds its master.
Ingest in two steps¶
Uploading, importing or ingesting a SIP looks the same as before. In the background the file goes to Lotte in two steps:
- Anton describes the file, uploads it in parts and has it checked. The medium is on the record at once, in the state «Being checked by the digital archive». The delivered file is then removed from the Anton server.
- Once Lotte has accepted the file, a background job completes the ingest: the medium gets the SHA-512, the format and the number of its object in Lotte, and is then «In the digital archive». Only now are the access copies made. If Lotte refuses the file, for a virus for instance, the medium shows «Refused by the digital archive» with Lotte's reason.
The media card on the record shows the state; superusers also see the object's number there. In Preservation planning media can be filtered by this state, for instance to find all refused ones.
If Lotte cannot be reached, Anton creates no medium and says that the digital archive is unavailable; the upload can be repeated later. If an import fails and is rolled back, Anton discards its package in Lotte too.
Derivatives¶
The setting derivatives_location decides who makes the access copies of media in Lotte:
anton(default): Anton fetches the master from Lotte once, checks it against the SHA-512, makesweb,thumbandposteras before and removes the copy again. Watermarks and subtitles stay as they are.lotte: Lotte makes the access copies. On every request Anton checks, as before, whether the person may see the medium, and then redirects to a short-lived signed Lotte URL. While Lotte is still making a derivative, Anton shows a placeholder.
A tenant with a watermark stays with anton: Lotte knows nothing of watermarks, and Anton never serves an unmarked image in that case. anton:doctor --archive reports the combination as an error.
Reading and exporting¶
Wherever Anton needs the master — download, copy to the transfer folder, DIP, OCFL, E-ARK DIP and the native export — it fetches a copy from Lotte, checks it against the SHA-512 and removes it afterwards. A copy that does not match is not served, and an export then stops rather than writing a backup without the file. Exporting a large holding kept in Lotte takes correspondingly longer than one from the local disk.
What Lotte reports: the change feed¶
Lotte never calls Anton. Anton collects what happens in Lotte itself, through the tenant's change feed:
php artisan archive:pull-changes --env=<slug>
The command reads the entries after the stored position (lotte_feed_cursor) in batches and applies them:
- An object was withdrawn or purged: the medium shows the state, the holdings log records it.
- A new version of the master, after a format migration in Lotte for instance: SHA-512, format and MIME type are updated, and the holdings log records it. Lotte keeps no MD5; Anton computes it from the master when needed.
- The text of a file is ready: it goes into Anton's full-text search.
- A derivative is ready or failed (only with
derivatives_location = lotte). - A package was discarded: a medium still waiting then counts as refused.
Operations run the command every minute, for each tenant on Lotte. Two runs for the same tenant never overlap; the second says so and ends. For a tenant without Lotte and without media in Lotte the command does nothing.
Metadata copy¶
Every object in Lotte carries a copy of its record's description, as the native export writes it, with the path of the records above. An object can thus be placed even without Anton. When someone changes a record with media in Lotte, Anton sends a new copy a quarter of an hour later; all changes of that quarter-hour go with the one copy. Lotte adds a new version of the object for it.
Moving existing masters¶
archive:move-to-lotte takes the masters still on the Anton server to Lotte:
php artisan archive:move-to-lotte --env=<slug> --dry-run
php artisan archive:move-to-lotte --env=<slug> --limit=100
php artisan archive:move-to-lotte --env=<slug> --ids=12,13 --delete-local
For each medium:
- Anton reads the master and compares it with its stored SHA-512 (for old media without one, with the MD5). If it does not match, nothing is sent; the medium counts as a deviation.
- Anton hands it over on the route
move. Lotte checks it like any ingest, but applies no format rule and never refuses it for its format: the master stays bit for bit as Anton had it. - After the commit Anton compares the checksum Lotte reports with its own. If they differ, Anton withdraws the object in Lotte, the medium stays local and counts as a deviation.
- Only then is the medium «in the digital archive», and the holdings log records the move. With
--delete-localAnton then deletes the local master; without the option it stays, but is no longer read.
Every run writes a protocol, one JSON line per medium, preceded by tenant, Lotte URL, person and selection, followed by the counts: moved, already in Lotte, skipped, failed and the deviations. It goes to the tenant's log folder (lotte-move-<slug>-<time>.jsonl), or elsewhere with --report=<file>. If a medium fails, the command ends with exit code 1; a second run leaves out the media already moved.
| Option | Meaning |
|---|---|
--dry-run |
only count, send nothing |
--ids= |
only these media |
--limit= |
at most this many media in this run |
--delete-local |
delete the local master once Lotte holds it with an equal checksum |
--wait= |
seconds Anton waits per medium for Lotte's check (default 3600) |
--report= |
path of the protocol |
Not yet for every tenant
The command skips media with kept versions (original/) and names them in the protocol: how those versions are kept in Lotte is not decided yet. A tenant connected to DIMAG or S3 cannot move yet; the command refuses.
First without --delete-local
A first move runs without --delete-local. The local masters can be deleted later, once Lotte has run for a while without findings.
Setup¶
Operations set up the connection, per tenant:
- In Lotte, create a client for the tenant (
lotte:client:create) with the abilitiesread,ingest,withdrawandmetadata. -
In the tenant's
.env:Variable Meaning LOTTE_URLLotte's address, without /t/<tenant>LOTTE_KEYthe client's key LOTTE_TENANTthe tenant in Lotte; default: the slug in Anton -
Set the settings (not in the interface, only with
anton:setting):Setting Values Default digital_archivelocal,lottelocalderivatives_locationanton,lotteantonphp artisan anton:setting --set --key=digital_archive --value=lotte --env=<slug> -
Set up
archive:pull-changesas a cron job every minute. - Check with
anton:doctor --archive.
Lotte and a cloud connection (cloud = inge or s3) exclude each other: with both set, Anton refuses every new file rather than putting it in the wrong place. When digital_archive goes back to local, new files go to the Anton server again; the media in Lotte stay there, and archive:pull-changes keeps following them.
Checking¶
php artisan anton:doctor --archive --env=<slug>
The doctor reports as errors: settings that do not fit together (Lotte with a cloud, Lotte's derivatives with a watermark), missing configuration, a Lotte that does not answer, and a key that belongs to another tenant or lacks an ability. As warnings: an entry of the change feed that has waited more than an hour to be collected (is the cron job running?) and media waiting more than a day for the check (is the queue running?). It also says how many media are in Lotte and how many Lotte refused. anton:doctor --all includes this check.