utiltest

package
v0.0.0-...-90deddd Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequirements

func NewRequirements(cpu, mem float64, width int) reflow.Requirements

func NewTask

func NewTask(cpu, mem float64, priority int) *sched.Task

func RandomFileset

func RandomFileset(repo reflow.Repository) reflow.Fileset

func RandomRepoFileset

func RandomRepoFileset(repo reflow.Repository) reflow.Fileset

func SetLogger

func SetLogger(task *sched.Task)

Types

type TestAlloc

type TestAlloc struct {
	pool.Alloc
	// contains filtered or unexported fields
}

func NewTestAlloc

func NewTestAlloc(resources reflow.Resources) *TestAlloc

func NewTestAllocWithId

func NewTestAllocWithId(id string, resources reflow.Resources) *TestAlloc

func (*TestAlloc) CompleteAll

func (a *TestAlloc) CompleteAll(ctx context.Context)

CompleteAll completes all execs put in this alloc after a minimum duration has elapsed. The duration for each exec is expected to be set in `exec.Config.Ident`.

func (*TestAlloc) Error

func (a *TestAlloc) Error(err error)

func (*TestAlloc) Exec

func (a *TestAlloc) Exec(id digest.Digest) *testExec

func (*TestAlloc) Free

func (a *TestAlloc) Free(ctx context.Context) error

func (*TestAlloc) ID

func (a *TestAlloc) ID() string

func (*TestAlloc) Inspect

func (a *TestAlloc) Inspect(ctx context.Context) (pool.AllocInspect, error)

func (*TestAlloc) Keepalive

func (a *TestAlloc) Keepalive(ctx context.Context, interval time.Duration) (time.Duration, error)

func (*TestAlloc) Load

func (a *TestAlloc) Load(ctx context.Context, url *url.URL, fs reflow.Fileset) (reflow.Fileset, error)

func (*TestAlloc) NExecs

func (a *TestAlloc) NExecs() int

func (*TestAlloc) Put

func (a *TestAlloc) Put(ctx context.Context, id digest.Digest, config reflow.ExecConfig) (reflow.Exec, error)

func (*TestAlloc) RefCount

func (a *TestAlloc) RefCount() map[digest.Digest]int64

func (*TestAlloc) RefCountInc

func (a *TestAlloc) RefCountInc(id digest.Digest)

func (*TestAlloc) Repository

func (a *TestAlloc) Repository() reflow.Repository

func (*TestAlloc) Resources

func (a *TestAlloc) Resources() reflow.Resources

func (*TestAlloc) Unload

func (a *TestAlloc) Unload(ctx context.Context, fs reflow.Fileset) error

func (*TestAlloc) VerifyIntegrity

func (a *TestAlloc) VerifyIntegrity(ctx context.Context, fs reflow.Fileset) error

VerifyIntegrity verifies the integrity of the given set of files

type TestCluster

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

func NewTestCluster

func NewTestCluster() *TestCluster

func (*TestCluster) Allocate

func (c *TestCluster) Allocate(ctx context.Context, req reflow.Requirements, labels pool.Labels) (pool.Alloc, error)

func (*TestCluster) CanAllocate

func (c *TestCluster) CanAllocate(r reflow.Resources) (bool, error)

func (*TestCluster) Req

func (c *TestCluster) Req() <-chan testClusterAllocReq

type TestClusterAllocReply

type TestClusterAllocReply struct {
	Alloc pool.Alloc
	Err   error
}

type TestPool

type TestPool struct {
	pool.ResourcePool
	// contains filtered or unexported fields
}

func NewTestPool

func NewTestPool(name string, r reflow.Resources) *TestPool

func (*TestPool) Kill

func (p *TestPool) Kill(a pool.Alloc) error

func (*TestPool) Name

func (p *TestPool) Name() string

func (*TestPool) New

func (p *TestPool) New(ctx context.Context, id string, meta pool.AllocMeta, keepalive time.Duration, existing []pool.Alloc) (pool.Alloc, error)

Jump to

Keyboard shortcuts

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