{
  "name": "dataset-download",
  "title": "Download and unpack a dataset",
  "category": "AI",
  "tags": [
    "ai",
    "alpine"
  ],
  "version": "1.0.0",
  "date": "2026-07-17",
  "notes": "Initial release.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/dataset-download/1.0.0.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/dataset-download/1.0.0/template.yaml",
  "entrypoint": "fetch",
  "parameters": [
    {
      "name": "url",
      "title": "URL",
      "description": "Absolute URL of the dataset archive to download.",
      "type": "string",
      "required": true,
      "example": "https://example.com/datasets/mnist.tar.gz"
    },
    {
      "name": "dest-path",
      "title": "Destination directory",
      "description": "Directory to download into and unpack the archive under.",
      "type": "string",
      "required": false,
      "default": "/tmp/dataset"
    },
    {
      "name": "token-secret-key",
      "title": "Token secret key",
      "description": "Key within the Secret that holds the bearer token.",
      "type": "string",
      "required": false,
      "default": "token"
    },
    {
      "name": "token-secret-name",
      "title": "Token secret name",
      "description": "Name of the Kubernetes Secret holding an optional bearer token. If the Secret is absent no Authorization header is sent.",
      "type": "string",
      "required": false,
      "default": "dataset-token"
    }
  ],
  "images": [
    {
      "ref": "alpine@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a",
      "repository": "alpine",
      "digest": "sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/dataset-download/1.0.0/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/dataset-download/1.0.0/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: dataset-download\n  labels:\n    dagweave.io/catalog-item: dataset-download\n  annotations:\n    # The catalog semver this manifest was authored at. The dagweave app records\n    # (catalog-item-id, semver) -\u003e content-hash -\u003e base-vN when it mints the tenant\n    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.0\"\n    dagweave.io/catalog-category: \"AI\"\nspec:\n  entrypoint: fetch\n  templates:\n    - name: fetch\n      inputs:\n        parameters:\n          # Absolute URL of the dataset archive to download.\n          - name: url\n          # Directory to download into and unpack the archive under.\n          - name: dest-path\n            default: /tmp/dataset\n          # Name/key of a Kubernetes Secret holding an optional bearer token. If the\n          # Secret or key is absent no Authorization header is sent.\n          - name: token-secret-name\n            default: dataset-token\n          - name: token-secret-key\n            default: token\n      container:\n        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # alpine:3.24 — provides sh, wget, tar and unzip (busybox).\n        image: alpine@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a\n        command: [sh, -c]\n        # Values are passed as env vars (below), never interpolated into the shell.\n        # Downloads the archive with wget (optionally authenticated) then unpacks it\n        # by extension. Unlike download-file this item also extracts the archive so a\n        # downstream step sees the unpacked dataset tree.\n        args:\n          - |\n            set -eu\n            mkdir -p \"${DEST_PATH}\"\n            if [ -n \"${TOKEN:-}\" ]; then\n              wget --header=\"Authorization: Bearer ${TOKEN}\" \\\n                -O \"${DEST_PATH}/archive\" \"${URL}\"\n            else\n              wget -O \"${DEST_PATH}/archive\" \"${URL}\"\n            fi\n            case \"${URL}\" in\n              *.tar.gz|*.tgz) tar -xzf \"${DEST_PATH}/archive\" -C \"${DEST_PATH}\" ;;\n              *.tar)          tar -xf  \"${DEST_PATH}/archive\" -C \"${DEST_PATH}\" ;;\n              *.zip)          unzip -o \"${DEST_PATH}/archive\" -d \"${DEST_PATH}\" ;;\n              *) echo \"no known archive extension; left as ${DEST_PATH}/archive\" ;;\n            esac\n            echo \"dataset ready under ${DEST_PATH}\"\n            ls -la \"${DEST_PATH}\"\n        env:\n          - name: URL\n            value: \"{{inputs.parameters.url}}\"\n          - name: DEST_PATH\n            value: \"{{inputs.parameters.dest-path}}\"\n          - name: TOKEN\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.token-secret-name}}\"\n                key: \"{{inputs.parameters.token-secret-key}}\"\n                optional: true\n",
  "templateSha256": "d3c58252f10c36236448abbdfb2dcff1a7c13a4cede9481ae994eecc5e4c572d",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/dataset-download",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
