Archiver simply takes repository archive urls and returns an s3 location for the same archive, while submitting the archive to s3 if it doesn't already exist.

If the archive exists, the response will redirect with a 302 and location for the s3 url equivalent.

If the archive does not already exist in s3, the response will accept the request (202) and return the task location url that is monitoring the current state of creating and uploading the archive to s3.

Currently, only support is configured:

ARCHIVER_HGMO_URL_TEMPLATE = "{repo}/archive/{rev}.{suffix}/{subdir}"


# To get an in-tree Mozharness archive based on:
> curl -i
Content-Type: application/json
Content-Length: 18
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Fri, 19 Jun 2015 22:41:29 GMT

  "result": {}

# In the above example, the s3 archive does not exist so Archiver will create it. poll the Location header url in the above response to monitor state
> curl -i
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 683
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Fri, 19 Jun 2015 22:41:41 GMT

  "result": {
    "s3_urls": {
      "us-east-1": "",
      "us-west-2": ""
    "src_url": "",
    "state": "SUCCESS",
    "status": "Task completed! Check 's3_urls' for upload locations."

# We can see above that Archiver has created two s3 archives across two regions. We can use those urls to grab the archive.
# Subsequent requests of the original endpoint also just redirects the s3 location
> curl -i
HTTP/1.0 302 FOUND
Content-Type: text/html; charset=utf-8
Content-Length: 625
Server: Werkzeug/0.10.4 Python/2.7.6
Date: Fri, 19 Jun 2015 22:42:12 GMT

<p>You should be redirected automatically to target URL: <a href=";Expires=1434754032&amp;AWSAccessKeyId=AKIAIYHUTJ7BG2GMUTXA">;Expires=1434754032&amp;AWSAccessKeyId=AKIAIYHUTJ7BG2GMUTXA</a>.  If not click the link.%


REST type MozharnessArchiveTask

Represents a running task and its current state

  • state (unicode) -- this is the current state of the task e.g. "PENDING", "PROGRESS", "SUCCESS", "FAILURE"

  • status (unicode) -- current msg status of task e.g. "Downloading archive from hg.m.o"

  • src_url (unicode) -- archive url origin that s3 item is based off of

  • s3_urls ({str: str}) -- s3 links for the archives by region


endpoint GET /archiver/hgmo/<path:repo>/<rev>
  • repo -- unicode

  • rev -- unicode

  • subdir -- unicode - optional

  • suffix -- unicode - optional - default: 'tar.gz'

  • preferred_region -- unicode - optional

An archiver for related requests. Uses relengapi.blueprints.archiver.get_archive

  • repo -- the repo location off of

  • rev -- the rev associated with the repo

  • subdir -- optional subdir path to only archive a portion of the repo

  • suffix -- the archive extension type. defaulted to tar.gz

  • preferred_region -- the preferred s3 region to use

endpoint GET /archiver/status/<task_id>
  • task_id -- unicode

Response Body:


Check and return the current state of the create_and_upload_archive celery task with task id of <task_id>.

If the task is unknown, state will be PENDING. Once the task starts it will be updated to STARTED and finally, if it completes, it will be either SUCCESS (no exceptions), or FAILURE.

See update_state() within create_and_upload_archive and for more details.

If state is SUCCESS, it is safe to check response['s3_urls'] for the archives submitted to s3