batflow

package module
v0.0.0-...-2cdfd9c Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

batflow

A batch workflow.

Development

Follow the guide to installing development environment dependencies.

Once the dependency preparation is complete, the repeat run can also execute make server. This will run a temporal dev server.

Then start the worker on the other terminal make server.

Finally, execute make starter to run the workflow.

Documentation

Index

Constants

View Source
const (
	DeviceNvidiaGPUKey = "nvidia.com/gpu"
)

Variables

This section is empty.

Functions

func StartContainerWorkflow

func StartContainerWorkflow(ctx workflow.Context, container *Container) error

Types

type Container

type Container struct {
	// ID of the container specified as a DNS_LABEL. Each Container must
	// have a unique name.
	ID string `json:"id"`
	// Image container image name.
	Image Image `json:"image"`
	// Command to execute.
	Command []string `json:"command"`
	// Ports list of port to expose from the container.
	Ports []uint16 `json:"ports"`
	// Resources compute resources required by container.
	Resource Resource `json:"resource"`

	Status string `json:"status"`
}

type Image

type Image struct {
	URI string `json:"uri"`
}

Image container image name.

type Resource

type Resource struct {
	CPU struct {
		Cores uint `json:"cores"`
	}
	Memory struct {
		Size string `json:"size"`
	}
	Devices map[string]uint `json:"devices"`
}

Resource compute resources required by container.

type SlurmApptainerActivities

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

func NewSlurmApptainerActivites

func NewSlurmApptainerActivites(client *ssh.Client) *SlurmApptainerActivities

func (*SlurmApptainerActivities) List

func (a *SlurmApptainerActivities) List(ctx context.Context, names []string) (err error)

List all running and named container instances

func (*SlurmApptainerActivities) Start

func (a *SlurmApptainerActivities) Start(ctx context.Context, container *Container) (err error)

Start a named instance of the given container image

Directories

Path Synopsis
cmd
internal
cmd

Jump to

Keyboard shortcuts

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