|
| 1 | +# CLI Reference |
| 2 | + |
| 3 | +The `claimed` command is the single entry-point for the CLAIMED framework. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Synopsis |
| 8 | + |
| 9 | +``` |
| 10 | +claimed <subcommand> [options] |
| 11 | +``` |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Subcommands |
| 16 | + |
| 17 | +### `claimed run` |
| 18 | + |
| 19 | +Directly invoke the `run()` function of any CLAIMED Python module. |
| 20 | + |
| 21 | +``` |
| 22 | +claimed run <module.path> [--param-name value ...] [--help] |
| 23 | +``` |
| 24 | + |
| 25 | +**Arguments** |
| 26 | + |
| 27 | +| Argument | Description | |
| 28 | +|---|---| |
| 29 | +| `module.path` | Fully-qualified Python module containing a `run()` function (e.g. `claimed.components.util.cosutils`) | |
| 30 | +| `--<param-name>` | Any parameter accepted by `run()`. Hyphens are converted to underscores. | |
| 31 | +| `--help` | Print the function signature, docstring, and parameter list, then exit. | |
| 32 | + |
| 33 | +**Type coercion** |
| 34 | + |
| 35 | +String values from the command line are automatically cast to the type declared in the function signature |
| 36 | +(annotation or default-value type). |
| 37 | +For example, `--recursive true` is cast to `bool` if the parameter is annotated as `bool`. |
| 38 | + |
| 39 | +**Examples** |
| 40 | + |
| 41 | +```bash |
| 42 | +# List objects in a COS bucket |
| 43 | +claimed run claimed.components.util.cosutils \ |
| 44 | + --cos-connection s3://KEY:SECRET@endpoint/bucket \ |
| 45 | + --operation ls \ |
| 46 | + --local-path . |
| 47 | + |
| 48 | +# Download a file |
| 49 | +claimed run claimed.components.util.cosutils \ |
| 50 | + --cos-connection s3://KEY:SECRET@endpoint/bucket/file.zip \ |
| 51 | + --operation get \ |
| 52 | + --local-path . |
| 53 | + |
| 54 | +# Show help for any module |
| 55 | +claimed run claimed.components.util.cosutils --help |
| 56 | + |
| 57 | +# CPU benchmark |
| 58 | +claimed run claimed.components.util.gpu_performance_test \ |
| 59 | + --mode cpu \ |
| 60 | + --matrix-size 4096 \ |
| 61 | + --iterations 100 |
| 62 | +``` |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +### `claimed create operator` |
| 67 | + |
| 68 | +Generate a container image + KFP/CWL/Kubernetes descriptors from a script or notebook. |
| 69 | + |
| 70 | +``` |
| 71 | +claimed create operator <script_or_notebook> [options] |
| 72 | +``` |
| 73 | + |
| 74 | +| Option | Description | |
| 75 | +|---|---| |
| 76 | +| `--repository` | Container registry namespace, e.g. `docker.io/myuser` | |
| 77 | +| `--version` | Image tag (default: auto-detected from script) | |
| 78 | +| `--additional-files` | Space-separated list of extra files to bundle | |
| 79 | + |
| 80 | +Example: |
| 81 | + |
| 82 | +```bash |
| 83 | +claimed create operator my_script.py --repository docker.io/myuser |
| 84 | +``` |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +### `claimed create gridwrapper` |
| 89 | + |
| 90 | +Wrap a component so it executes in parallel over a collection of inputs. |
| 91 | + |
| 92 | +``` |
| 93 | +claimed create gridwrapper <script_or_notebook> [options] |
| 94 | +``` |
| 95 | + |
| 96 | +| Option | Description | |
| 97 | +|---|---| |
| 98 | +| `--backend` | Storage backend: `local` \| `cos` \| `s3kv` \| `simple_grid_wrapper` \| `folder_grid_wrapper` | |
| 99 | +| `--component-inputs` | Comma-separated parameter names that vary across grid cells | |
| 100 | +| `--repository` | Container registry namespace | |
| 101 | + |
| 102 | +Example: |
| 103 | + |
| 104 | +```bash |
| 105 | +claimed create gridwrapper my_script.py \ |
| 106 | + --backend cos \ |
| 107 | + --component-inputs input_file \ |
| 108 | + --repository docker.io/myuser |
| 109 | +``` |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +### `claimed --component` *(legacy)* |
| 114 | + |
| 115 | +Run a component image via Docker. |
| 116 | + |
| 117 | +``` |
| 118 | +claimed --component <image> [--param-name value ...] |
| 119 | +``` |
| 120 | + |
| 121 | +| Option | Description | |
| 122 | +|---|---| |
| 123 | +| `--component` | Docker image reference, e.g. `docker.io/claimed/my-op:latest` | |
| 124 | +| `--<param-name>` | Environment variable to pass into the container | |
| 125 | + |
| 126 | +Set `CLAIMED_DATA_PATH` to mount a local directory as `/opt/app-root/src/data` inside the container. |
| 127 | + |
| 128 | +--- |
| 129 | + |
| 130 | +## Environment Variables |
| 131 | + |
| 132 | +| Variable | Effect | |
| 133 | +|---|---| |
| 134 | +| `CLAIMED_DATA_PATH` | Local path mounted as `/opt/app-root/src/data` when using `--component` | |
| 135 | +| `CLAIMED_CONTAINERLESS_OPERATOR_PATH` | Root path for containerless operator resolution | |
0 commit comments