pachd

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 103 Imported by: 0

Documentation

Overview

Package pachd implements the Pachyderm dæmon and its various modes.

Callers need only provide a context and a configuration.

Adding a new mode

The idea is that there is a builder for each mode; each builder is responsible for building and running an instance of the single type daemon representing a pachd instance.

To add a new mode one will at least add a new builder; one may also need to add new members to daemon. Daemon should contain only those members needed at run time for any mode; other, transient, values should be members of the pertinent builder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminEnv added in v2.8.0

func AdminEnv(senv serviceenv.ServiceEnv, paused bool) admin_server.Env

func AuthEnv added in v2.8.0

func DebugEnv added in v2.8.0

func DebugEnv(env serviceenv.ServiceEnv) debug_server.Env

func EnterpriseEnv added in v2.8.0

func EnterpriseEnv(senv serviceenv.ServiceEnv, etcdPrefix string, txEnv *txnenv.TransactionEnv) *enterprise_server.Env

func EnterpriseMode

func EnterpriseMode(ctx context.Context, config *pachconfig.EnterpriseServerConfiguration) error

EnterpriseMode runs an enterprise-mode pachd.

Enterprise mode is the enterprise server which is used to manage multiple Pachyderm installations.

func FullMode

func FullMode(ctx context.Context, config *pachconfig.PachdFullConfiguration) error

FullMode runs a full-mode pachd.

Full mode is that standard pachd which users interact with using pachctl and which manages pipelines, files and so forth.

func LicenseEnv added in v2.8.0

func LicenseEnv(senv serviceenv.ServiceEnv) *license_server.Env

func NewTestPachd added in v2.8.0

func NewTestPachd(t testing.TB, opts ...TestPachdOption) *client.APIClient

NewTestPachd creates an environment suitable for non-k8s tests and then calls pachd.NewFull with that environment.

func PFSEnv added in v2.8.0

func PFSWorkerEnv added in v2.8.0

func PFSWorkerEnv(env serviceenv.ServiceEnv) (*pfs_server.WorkerEnv, error)

func PPSEnv added in v2.8.0

func PPSEnv(senv serviceenv.ServiceEnv, txnEnv *txnenv.TransactionEnv, reporter *metrics.Reporter) pps_server.Env

func PachwEnv added in v2.8.0

func PachwEnv(env serviceenv.ServiceEnv) (*pachw_server.Env, error)

func PachwMode

func PachwMode(ctx context.Context, config *pachconfig.PachdFullConfiguration) error

PachwMode runs a pachw-mode pachd. When in pachw mode, the pachd instance processes storage and url tasks.

func PausedMode

func PausedMode(ctx context.Context, config *pachconfig.PachdFullConfiguration) error

PausedMode runs a paused-mode pachd.

Paused mode is a restricted mode which runs Pachyderm read-only in order to take offline backups.

func SidecarMode

func SidecarMode(ctx context.Context, config *pachconfig.PachdFullConfiguration) error

SidecarMode runs a sidecar-mode pachd.

Sidecar mode is run as a sidecar in a pipeline pod; it provides services to the pipeline worker code running in that pod.

func StorageEnv added in v2.10.0

func StorageEnv(env serviceenv.ServiceEnv) (*storage.Env, error)

Types

type Env added in v2.8.0

type Env struct {
	DB               *pachsql.DB
	DirectDB         *pachsql.DB
	DBListenerConfig string
	ObjClient        obj.Client
	Bucket           *obj.Bucket
	EtcdClient       *clientv3.Client
	Listener         net.Listener
	K8sObjects       []runtime.Object
	GetLokiClient    func() (*lokiclient.Client, error)
}

type Full added in v2.8.0

type Full struct {
	// contains filtered or unexported fields
}

func BuildTestPachd added in v2.10.0

func BuildTestPachd(ctx context.Context, opts ...TestPachdOption) (*Full, *cleanup.Cleaner, error)

BuildTestPachd returns a test pachd that can be run outside of tests. The returned cleanup handler frees all ephemeral resources associated with the instance.

func NewFull added in v2.8.0

func NewFull(env Env, config pachconfig.PachdFullConfiguration, opt *FullOption) *Full

NewFull sets up a new Full pachd and returns it.

func (*Full) AwaitAuth added in v2.10.0

func (pd *Full) AwaitAuth(ctx context.Context)

AwaitAuth returns when auth is ready. It must be called after Run() starts.

func (*Full) PachClient added in v2.10.0

func (pd *Full) PachClient(ctx context.Context) (*client.APIClient, error)

PachClient returns a pach client that can talk to the server with root privileges.

func (*Full) Run added in v2.8.0

func (b *Full) Run(ctx context.Context) error

Run runs all the setup steps serially, returning the first error encountered. Then all the background tasks are run concurrently, if any of them error then the others are cancelled, and Run returns the error.

type FullOption added in v2.10.0

type FullOption struct {
	DesiredState *migrations.State
}

type PreFlight added in v2.8.0

type PreFlight struct {
	// contains filtered or unexported fields
}

PreFlight is a minimal pachd for running preflight checks.

func NewPreflight added in v2.8.0

func (*PreFlight) Run added in v2.8.0

func (b *PreFlight) Run(ctx context.Context) error

Run runs all the setup steps serially, returning the first error encountered. Then all the background tasks are run concurrently, if any of them error then the others are cancelled, and Run returns the error.

type PreFlightEnv added in v2.8.0

type PreFlightEnv struct {
	// DB should be a direct database connection.
	DB *sqlx.DB
}

type TestPachdOption added in v2.10.0

type TestPachdOption struct {
	MutateContext    func(ctx context.Context) context.Context
	MutateEnv        func(env *Env)
	MutateConfig     func(config *pachconfig.PachdFullConfiguration)
	MutatePachd      func(full *Full)
	MutateFullOption func(fullOption *FullOption)
	// contains filtered or unexported fields
}

TestPachdOptions allow a testpachd to be customized.

func ActivateAuthOption added in v2.10.0

func ActivateAuthOption(rootToken string) TestPachdOption

ActivateAuthOption is an option that activates auth inside the created pachd. Outside of tests, you must manually call pachd.AwaitAuth(ctx).

func NoLogToFileOption added in v2.10.0

func NoLogToFileOption() TestPachdOption

NoLogToFileOption is an option that disable's NewTestPachd's default behavior of logging pachd logs to a file.

Jump to

Keyboard shortcuts

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