Hugging Face Hub CLI for Swale workflows. Backs the hf-download and hf-upload tasks.
428
Swale-built image backing the hf-download and hf-upload task definitions. It
wraps the Hugging Face CLI (hf)
so a workflow can pull models/datasets into the shared workspace or push
artifacts back to the Hub.
python:3.13-slimhuggingface_hub[cli,hf_xet] (the hf CLI plus the Xet
accelerated transfer backend)swale (uid 1000)INPUT_CACHE_DIR relocates it: a workspace path keeps the staged blobs for
later downloads in the same run and keeps the staging copy off task scratch.WORKDIR /mnt/workspace, ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]The task definition's exec.args are appended to the entrypoint as the hf
command line, e.g. ["download", "${{inputs.repo}}", "--local-dir", "${{inputs.dest}}"]. The entrypoint then augments that command line from these
inputs before running hf "$@":
| Input env | Applies to | Effect |
|---|---|---|
INPUT_INCLUDE | download | Comma-separated glob patterns; each becomes a repeated --include <glob>. Patterns are passed literally (no shell globbing). |
INPUT_REVISION | all | Appended as --revision <ref> to pin a branch, tag, or commit. |
INPUT_CACHE_DIR | all | Exported as HF_HOME when non-empty, moving the Hub cache off the per-task home directory. |
INPUT_DEST | download | The full local path the caller chose for the download; emitted verbatim as the path output. |
INPUT_PATH_IN_REPO | upload | Appended as the trailing positional destination path inside the target repository. |
After a successful download, the entrypoint appends
path=<dest>
to $WORKFLOW_TASK_OUTPUT, where <dest> is the full path from INPUT_DEST
(the caller-supplied, required dest input). The consuming task must declare a
path output. upload emits nothing.
From the repository root:
docker build -t docker.io/swaleio/hf-cli:1.0.0 images/hf-cli
CI pins the real base digest and publishes the image; task definitions reference
it as docker.io/swaleio/hf-cli@sha256:<digest>.
Built from images/hf-cli in the
swaleio/task-definitions repository. For how a task definition
references an image, see the
task definition reference
in the Swale documentation.
The Dockerfile and entrypoint are covered by the MIT License. The software this image packages keeps its own licenses, which ship inside the image.
Content type
Image
Digest
sha256:62c02b3e1…
Size
54 MB
Last updated
about 2 months ago
docker pull swaleio/hf-cli