add
Add a Spicepod to the project.
Usage​
spice add [spicepod path] [flags]
spicepod path: Either a spicerack.org slug (optionally pinned to a version with@), or a path to a Spicepod directory on the local filesystem.
| Form | Example | Resolves to |
|---|---|---|
| Spicerack slug | spiceai/quickstart | The latest published version of the Spicepod on spicerack.org. |
| Spicerack slug with version | spiceai/[email protected] | The v1.0 version of that Spicepod. |
| Local directory | ../shared/pods/analytics | A Spicepod directory copied from the local filesystem. |
Local file:// URL | file:///srv/pods/analytics | The same, written as a URL. |
A path is treated as local when it starts with /, ../, or file://, or when it already exists on disk; anything else is fetched from spicerack.org.
Flags​
-h,--helpPrint this help message
Examples​
Adding a Spicepod from Spicerack (like spiceai/quickstart):
> spice add spiceai/quickstart
Pinning a published Spicepod to a version:
> spice add spiceai/[email protected]
Adding a Spicepod from a local directory:
> spice add ../shared/pods/analytics
A local Spicepod is copied into spicepods/[pod-name], where pod-name is the source directory's name lowercased, and the root spicepod.yaml records the dependency as a path relative to the app directory rather than as a slug.
Directory Structure: The command makes two main modifications to the directory structure:
- It creates the
spicepodsdirectory in the project root if it does not exist. - It adds the Spicepod defined by the Spicerack Slug in the relative path in the
spicepodsdirectory. For this example, the command would create the directoriesspicepods/spiceaiandspicepods/spiceai/quickstart, instantiating a Spicepod under the latter. More generally, the Spicepod is placed underspicepods/[slug], whereslugis the Spicerack slug associated with that Spicepod.
After running the command, the directory structure looks like this:
├── spicepods/
│ ├── spiceai/
│ ├── quickstart/
│ ├── spicepod.yaml
├── spicepod.yaml
└── ...
Any other Spicepods added using spice add are placed in the spicepods directory.
spice add also creates the appropriate Spicepod for the given Spicerack slug. For this example with spiceai/quickstart, the command creates the following the Spicepod under spicepods/spiceai/quickstart:
# File: ./spicepods/spiceai/quickstart/spicepod.yaml
version: v1
kind: Spicepod
name: quickstart
datasets:
- from: s3://spiceai-demo-datasets/taxi_trips/2024/
name: taxi_trips
description: taxi trips in s3
params:
file_format: parquet
acceleration:
enabled: true
The add command also includes the above Spicepod as a dependency in the root spicepod.yaml, creating this file if it does not exist:
# File: ./spicepod.yaml
version: v1
kind: Spicepod
name: Spice AI quickstart
dependencies:
- spiceai/quickstart
