Documentation
¶
Overview ¶
Package artifacts provides a pluggable interface for storing and retrieving file artifacts produced by pipeline steps.
Artifacts are named files that a pipeline step produces (e.g. a PDF report, a CSV dataset, an image). The agent writes them to $AGENT_ARTIFACT_DIR/<name> after its task completes. The store uploads them to the configured backend and returns a URL/path that downstream steps can reference via template variables:
{{ .steps.<stepName>.artifacts.<name> }}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalStore ¶
type LocalStore struct {
// BasePath is the root directory where artifacts are stored.
BasePath string
}
LocalStore stores artifacts on the local filesystem.
func NewLocalStore ¶
func NewLocalStore(basePath string) *LocalStore
NewLocalStore creates a LocalStore. If basePath is empty, /tmp/ark-artifacts is used.
type NoopStore ¶
type NoopStore struct{}
NoopStore is used when no artifact store is configured. All operations succeed silently.
type Store ¶
type Store interface {
// Put uploads or copies data with the given artifact name under the step's namespace.
// Returns the URL or path that can be used to retrieve the artifact.
Put(ctx context.Context, runName, stepName, artifactName string, data []byte) (string, error)
// Get retrieves artifact data by the URL/path returned from Put.
Get(ctx context.Context, url string) ([]byte, error)
}
Store is the interface for reading and writing file artifacts.
func FromSpec ¶
func FromSpec(spec *arkonisv1alpha1.ArtifactStoreSpec) (Store, error)
FromSpec builds a Store from an ArtifactStoreSpec. Returns NoopStore when spec is nil.