4 title: Upgrading to Containers API
8 Copyright (C) The Arvados Authors. All rights reserved.
10 SPDX-License-Identifier: CC-BY-SA-3.0
13 The "containers" API is the recommended way to submit compute work to Arvados. It supersedes the "jobs" API, which is end-of-life as of Arvados 1.5.
15 h2. Benefits over the "jobs" API
17 * Simpler and more robust execution with fewer points of failure
18 * Automatic retry for containers that fail to run to completion due to infrastructure errors
19 * Scales to thousands of simultaneous containers
20 * Able to support alternate schedulers/dispatchers in addition to slurm
21 * Improved logging, different streams logs/metrics stored in different files in the log collection
22 * Records more upfront detail about the compute node, and additional metrics (such as available disk space over the course of the container run)
23 * Better behavior when deciding whether to reuse past work -- pick the oldest container that matches the criteria
24 * Can reuse running containers between workflows, cancelling a workflow will not cancel containers that are shared with other workflows
25 * Supports setting time-to-live on intermediate output collections for automatic cleanup
26 * Supports "secret" inputs, suitable for passwords or access tokens, which are hidden from the API responses and logs, and forgotten after use
27 * Does not require "git" for dispatching work
29 h2. Differences from the "jobs" API
31 Containers cannot reuse jobs (but can reuse other containers)
33 Uses the service "crunch-dispatch-slurm":{{site.baseurl}}/install/crunch2-slurm/install-dispatch.html instead of @crunch-dispatch.rb@
35 Non-CWL Arvados "pipeline templates" are not supported with containers. Pipeline templates should be rewritten in CWL and registered as "Workflows".
37 The containers APIs is incompatible with the jobs API, code which integrates with the "jobs" API must be updated to work with containers
39 Containers have network access disabled by default
41 The keep mount only exposes collections which are explicitly listed as inputs
43 h2. Migrating to "containers" API
45 Run your workflows using @arvados-cwl-runner --api=containers@ (only necessary if both the jobs and containers APIs are enabled, if the jobs API is disabled, it will use the containers API automatically)
47 Register your workflows so they can be run from workbench using @arvados-cwl-runner --api=containers --create-workflow@
49 Read "Migrating running CWL on jobs API to containers API":{{site.baseurl}}/user/cwl/cwl-style.html#migrate
51 Use @arv:APIRequirement: {}@ in the @requirements@ section of your CWL file to enable network access for the container (see "Arvados CWL Extensions":{{site.baseurl}}/user/cwl/cwl-extensions.html)
53 For examples on how to manage container requests with the Python SDK, see "Python cookbook":{{site.baseurl}}/sdk/python/cookbook.html