Overview

This article covers trying out a3m.

https://github.com/artefactual-labs/a3m

a3m is described as follows:

a3m is a lightweight version of Archivematica focused on AIP creation. It has neither external dependencies, integration with access sytems, search capabilities nor a graphical interface.

Differences from Archivematica

The main differentiator is the lack of service dependencies. a3m does not depend on Gearman or external workers, MySQL, Elasticsearch or Nginx. a3m provides its own API server based on the gRPC stack and all processing is performed via system threads and spawned child processes. An embedded database based on SQLite is used to store temporary processing state.

Installation

We follow the instructions at:

https://a3m.readthedocs.io/en/latest/installation.html

We use Docker. The following docker-compose.yml was created:

docker-compose.yml

services:
  a3md:
    image: ghcr.io/artefactual-labs/a3m:latest
    ports:
      - 7000:7000
    networks:
      - a3m-network
networks:
  a3m-network:
    external: true

Then, in the same folder containing docker-compose.yml, run the following to start it up:

docker network create a3m-network
docker compose up -d

Creating an AIP

We proceed by following:

https://a3m.readthedocs.io/en/latest/usage.html

While our understanding may not be complete, it appears that a3m can be run both on the server and from a client.

For details, please see:

https://a3m.readthedocs.io/en/latest/overview.html#architecture

Running on the Server

First, install the library:

pip install a3m

Then run as follows:

a3m /a3m/examples --name="server"

The following output was produced:

AIP 226f0c78-e779-44c6-bc8e-17414f008241 is being generated...
Processing completed successfully!

Checking the processing directory, a 7z file had been created:

ls ~/.local/share/a3m/share/completed/
server-226f0c78-e779-44c6-bc8e-17414f008241.7z

Using from a Client

First, install the library:

python -m venv .venv
source .venv/bin/activate
pip install a3m

Then specify the address argument and the file to process via URL.

In this example, we use example.org as the server domain and use an image from Irasutoya.

a3m --address=example.org:7000 --name="client" https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5x8DUwBVjGR2IkVozOhVoe1zMnzIrcemz4s8xMsHR1gP8mV809urM_03Et8VWHxlGHXy1Vo2UD6x1z7SUVtVik0d0wCW37bbAIb1q7WOlKdyRiwpDkJiONBKEvgPdJFJFRTwGNMMeGUbW/s691/baby_role_towel_utsubuse.png

Similarly, the following output was produced and saved on the server:

AIP 8f2c08c7-1ae0-42f5-9ae2-2908bc7fac54 is being generated...
Processing completed successfully!

Using from Python

By using the following approach, an AIP could be created in the same way as the CLI:

import grpc
from a3m.server.rpc.client import Client

server_address = 'example.org:7000'

# Create an unencrypted channel
channel = grpc.insecure_channel(server_address)
c = Client(channel)

res = c.submit(
    url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5x8DUwBVjGR2IkVozOhVoe1zMnzIrcemz4s8xMsHR1gP8mV809urM_03Et8VWHxlGHXy1Vo2UD6x1z7SUVtVik0d0wCW37bbAIb1q7WOlKdyRiwpDkJiONBKEvgPdJFJFRTwGNMMeGUbW/s691/baby_role_towel_utsubse.png",
    name="client-py",
    )

Furthermore, the processing results could be retrieved as follows:

res_read = c.read(res.id)
res_read
status: PACKAGE_STATUS_COMPLETE
job: "Store AIP"
jobs {
  id: "a247df6a-edd3-446b-868f-be4c0b5bc367"
  name: "a3m - Download package"
  group: "a3m"
  link_id: "00000e0a-2cb2-4292-a412-58ea57aa6f7e"
  status: STATUS_COMPLETE
  start_time {
    seconds: 1718237770
    nanos: 720538000
  }
}
jobs {
  id: "8b5042e4-56c8-4d21-9263-73de14fd1cca"
  name: "Remove hidden files and directories"
  group: "Verify transfer compliance"
  link_id: "50b67418-cb8d-434d-acc9-4a8324e7fdd2"
  status: STATUS_COMPLETE
  start_time {
    seconds: 1718237771
    nanos: 497992000
  }
}
jobs {
  id: "f921f6fb-a843-4d8d-92ba-209210da4178"
  name: "Remove unneeded files"
  group: "Verify transfer compliance"
  link_id: "5d780c7d-39d0-4f4a-922b-9d1b0d217bca"
  status: STATUS_COMPLETE
  start_time {
    seconds: 1718237771
    nanos: 515314000
  }
}
jobs {
  id: "eb6435aa-2d63-41d6-bed0-6ae6c41528ac"
  name: "Attempt restructure for compliance"
  group: "Verify transfer compliance"
  link_id: "ea0e8838-ad3a-4bdd-be14-e5dba5a4ae0c"
  status: STATUS_COMPLETE
  start_time {
    seconds: 1718237771
    nanos: 533858000
  }
}
jobs {
  id: "6fc1c185-2c99-4b3c-ad5c-e77ee8a56b50"
  name: "Verify transfer compliance"
  group: "Verify transfer compliance"
  link_id: "438dc1cf-9813-44b5-a0a3-58e09ae73b8a"
  status: STATUS_COMPLETE
  start_time {
    seconds: 1718237771
    nanos: 554084000
  }
}
jobs {
  id: "2c3462d0-a711-458d-89fe-04bbea22f203"
  name: "Verify mets_structmap.xml compliance"
  group: "Verify transfer compliance"
  link_id: "d0c463c2-da4c-4a70-accb-c4ce96ac5194"
  status: STATUS_COMPLETE
  start_time {
    seconds: 1718237771
    nanos: 573639000
  }
}
jobs {
  id: "90c0b640-dd58-49a8-a27f-66ca2a00568f"
  name: "Assign UUIDs to directories?"
  group: "Assign file UUIDs and checksums"
  link_id: "bd899573-694e-4d33-8c9b-df0af802437d"
  status: STATUS_COMPLETE
  start_time {
    seconds: 1718237771
    nanos: 600004000
  }
}
jobs {
  id: "4f3173e5-1324-4a99-b341-7325155c0246"
  name: "Assign UUIDs to directories"
  group: "Assign file UUIDs and checksums"
  link_id: "6441980c-b64b-447e-abc7-9351a2547f6a"
  status: STATUS_COMPLETE
  start_time {
    seconds: 1718237771
    nanos: 606370000
  }
}
jobs {
  id: "12a4ede6-4d35-46db-91ad-eb9fa2900fae"
  name: "Assign file UUIDs to objects"
  group: "Assign file UUIDs and checksums"
  link_id: "dc144ff4-ad74-4a6e-ac15-b0beedcaf662"
...
  start_time {
    seconds: 1718237773
    nanos: 159203000
  }
}

Discussion

ProcessingConfig

As described in the documentation, Archivematica required preparing an XML-based configuration file in advance. On the other hand, a3m appears to allow submitting configuration as part of transfer requests. This should improve flexibility in AIP creation.

https://a3m.readthedocs.io/en/latest/usage.html#processing-configuration

https://buf.build/artefactual/a3m/docs/main:a3m.api.transferservice.v1beta1#a3m.api.transferservice.v1beta1.ProcessingConfig

Regarding Practical Use

Since this tool is still under development, it may be difficult to start using it in production just yet. However, as a tool that enables simpler AIP creation, we look forward to its future progress.

Summary

We hope this has been a useful reference.