Raise exceptions instead of returning error messages from the worker in
create_arvive_task. This ensures consistency in how the errors are
presented on the task result: the Exception will be the result instead
of *maybe* being wrapped in an object like {error: Exception}.
This lets us simplify error handling in get_status so we have only one
try/except block where the error can be returned to the client.
This will save the task result in redis as a json object instead of a
json-encoded string. This makes for a nicer response from get_status and
prevents the client having to parse a json string to work with the
result.
There are no logic changes in this commit, just renamed variables so
that fewer things are called "result" which seemed confusing.
Instead of result.result = task_result.result,
we can say response.result = task.result
Install docker in the container
Add a named volume called `browsertrix`
Mount the named volume in the worker at /crawls
Expose the host docker socket
Override the environment variable from auto-archiver's Dockerfile so
that it will call docker.
This will require setting new configs in orchestration.yaml:
wacz_archiver_enricher:
browsertrix_home: auto-archiver-api_browsertrix
wacz_collections: /crawls
Set an environment variable in the docker compose file, then reference
that variable in main.py to mount the local archive so that the links
generated by auto-archiver will work correctly. Fixes#8
If the email is defined in user-groups.yaml but has no groups, groups is
assigned None and len(groups) throws an exception.
Intuitively, one would expect groups to default to [] rather than None
because [] is passed as the second argument to Dictionary.get, but this
default only applies if the key is not found in the dictionary. In this
case the key is defined but has a value of None.