artifacts

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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.

func (*LocalStore) Get

func (s *LocalStore) Get(_ context.Context, path string) ([]byte, error)

Get reads artifact data from the given local path.

func (*LocalStore) Put

func (s *LocalStore) Put(_ context.Context, runName, stepName, artifactName string, data []byte) (string, error)

Put writes data to <basePath>/<runName>/<stepName>/<artifactName> and returns the path.

type NoopStore

type NoopStore struct{}

NoopStore is used when no artifact store is configured. All operations succeed silently.

func (*NoopStore) Get

func (n *NoopStore) Get(_ context.Context, _ string) ([]byte, error)

func (*NoopStore) Put

func (n *NoopStore) Put(_ context.Context, _, _, _ string, _ []byte) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL