Rclone copy
Copies files between a remote storage backend and the run's workspace using
rclone. It handles S3, Azure Blob, Google Cloud Storage,
Dropbox, SFTP, and HTTP. Point source and dest at either the configured
remote (remote:…) or a workspace path (${{env.WORKFLOW_STORAGE}}/…), in either
direction: remote: → workspace downloads, workspace → remote: uploads.
Connection model
The image builds a single rclone remote named remote entirely from
environment variables — there is no config file to author. remote_type selects
the backend, and the credential inputs are mapped into RCLONE_CONFIG_REMOTE_*
environment variables by the image wrapper. Because credentials arrive as inputs
and are exported as environment, they never appear in the container's argv or in
a process listing.
Reference the remote in source/dest by its fixed name, remote: — for
example remote:my-bucket/path or remote:container/blob.
Which credential inputs you set depends on remote_type:
remote_type |
Credential inputs | Maps to rclone option |
|---|---|---|
s3 |
access_key_id, secret_access_key |
access_key_id, secret_access_key |
azureblob |
account, key |
account, key |
gcs |
token |
token (OAuth JSON) |
dropbox |
token |
token (OAuth JSON) |
sftp |
(via flags) |
--sftp-host, --sftp-user, --sftp-key-file, … |
http |
(via flags) |
--http-url |
For SFTP and HTTP, supply the non-secret connection details as backend flags
through flags (e.g. --sftp-host files.example.com --sftp-user alice).
Backend-specific tuning for any remote — region, endpoint, chunk size,
concurrency — also goes through flags.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
source |
yes | — | Source path — remote:bucket/path or a workspace path. |
dest |
yes | — | Destination path — remote:bucket/path or a workspace path. |
remote_type |
no | s3 |
rclone backend: s3, azureblob, gcs, dropbox, sftp, http. |
access_key_id |
no | — | S3 access key id (pass a secret). |
secret_access_key |
no | — | S3 secret access key (pass a secret). |
account |
no | — | Azure Blob storage account name. |
key |
no | — | Azure Blob shared key (pass a secret). |
token |
no | — | OAuth token JSON for GCS/Dropbox (pass a secret). |
flags |
no | — | Extra rclone flags (whitespace-split), incl. SFTP/HTTP connection details. |
Outputs
None. The task writes the copied files to the destination (typically a
${{env.WORKFLOW_STORAGE}}/… subpath) for downstream tasks to read; it emits no output
keys.
Compute
CPU. Data movement only — no GPU is needed, and scheduling it on a GPU compute type wastes money.
Example
Download an S3 prefix into the workspace so later tasks can process it:
name: Rclone copy example
compute_type: cpu-4
entry_point: main
blocks:
main:
tasks:
fetch_dataset:
name: Fetch dataset
uses: swaleio/rclone-copy
args:
remote_type: s3
source: remote:my-bucket/datasets/train
dest: ${{env.WORKFLOW_STORAGE}}/data
access_key_id: ${{secrets.aws_access_key_id}}
secret_access_key: ${{secrets.aws_secret_access_key}}
flags: "--s3-region eu-west-1 --transfers 8"
To upload instead, swap source and dest — e.g. source: ${{env.WORKFLOW_STORAGE}}/out
and dest: remote:my-bucket/results.
For the workflow syntax these examples use, see the workflow definition reference in the Swale documentation.
Licensed under the MIT License.