ioserver

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

(C) Copyright 2019 Intel Corporation.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.

Index

Constants

View Source
const (
	// NvmeMinBytesPerTarget is min NVMe pool allocation per target
	NvmeMinBytesPerTarget = 1 * humanize.GiByte
	// ScmMinBytesPerTarget is min SCM pool allocation per target
	ScmMinBytesPerTarget = 16 * humanize.MiByte
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Rank              *Rank         `yaml:"rank,omitempty"`
	Modules           string        `yaml:"modules,omitempty" cmdLongFlag:"--modules" cmdShortFlag:"-m"`
	TargetCount       int           `yaml:"targets,omitempty" cmdLongFlag:"--targets,nonzero" cmdShortFlag:"-t,nonzero"`
	HelperStreamCount int           `yaml:"nr_xs_helpers" cmdLongFlag:"--xshelpernr" cmdShortFlag:"-x"`
	ServiceThreadCore int           `yaml:"first_core" cmdLongFlag:"--firstcore,nonzero" cmdShortFlag:"-f,nonzero"`
	SystemName        string        `yaml:"name,omitempty" cmdLongFlag:"--group" cmdShortFlag:"-g"`
	SocketDir         string        `yaml:"socket_dir,omitempty" cmdLongFlag:"--socket_dir" cmdShortFlag:"-d"`
	LogMask           string        `yaml:"log_mask,omitempty" cmdEnv:"D_LOG_MASK"`
	LogFile           string        `yaml:"log_file,omitempty" cmdEnv:"D_LOG_FILE"`
	Storage           StorageConfig `yaml:",inline"`
	Fabric            FabricConfig  `yaml:",inline"`
	EnvVars           []string      `yaml:"env_vars,omitempty"`
	Index             uint32        `yaml:"-" cmdLongFlag:"--instance_idx" cmdShortFlag:"-I"`
}

Config encapsulates an I/O server's configuration.

func NewConfig

func NewConfig() *Config

NewConfig returns an I/O server config.

func (*Config) CmdLineArgs

func (c *Config) CmdLineArgs() ([]string, error)

CmdLineArgs returns a slice of command line arguments to be supplied when starting an I/O server instance.

func (*Config) CmdLineEnv

func (c *Config) CmdLineEnv() ([]string, error)

CmdLineEnv returns a slice of environment variables to be supplied when starting an I/O server instance.

func (*Config) HasEnvVar added in v0.9.0

func (c *Config) HasEnvVar(name string) bool

HasEnvVar returns true if the configuration contains an environment variable with the given name.

func (*Config) Validate

func (c *Config) Validate() error

Validate ensures that the configuration meets minimum standards.

func (*Config) WithBdevClass

func (c *Config) WithBdevClass(bdevClass string) *Config

WithBdevClass defines the type of block device storage to be used.

func (*Config) WithBdevConfigPath

func (c *Config) WithBdevConfigPath(cfgPath string) *Config

WithBdevConfigPath sets the path to the generated NVMe config file used by SPDK.

func (*Config) WithBdevDeviceCount

func (c *Config) WithBdevDeviceCount(count int) *Config

WithBdevDeviceCount sets the number of devices to be created when BdevClass is malloc.

func (*Config) WithBdevDeviceList

func (c *Config) WithBdevDeviceList(devices ...string) *Config

WithBdevDeviceList sets the list of block devices to be used.

func (*Config) WithBdevFileSize

func (c *Config) WithBdevFileSize(size int) *Config

WithBdevFileSize sets the backing file size (used when BdevClass is malloc or file).

func (*Config) WithEnvVars

func (c *Config) WithEnvVars(newVars ...string) *Config

WithEnvVars applies the supplied list of environment variables to any existing variables, with new values overwriting existing values.

func (*Config) WithFabricInterface

func (c *Config) WithFabricInterface(iface string) *Config

WithFabricInterface sets the interface name to be used by this instance.

func (*Config) WithFabricInterfacePort

func (c *Config) WithFabricInterfacePort(ifacePort int) *Config

WithFabricInterfacePort sets the numeric interface port to be used by this instance.

func (*Config) WithFabricProvider

func (c *Config) WithFabricProvider(provider string) *Config

WithFabricProvider sets the name of the CArT fabric provider.

func (*Config) WithHelperStreamCount

func (c *Config) WithHelperStreamCount(count int) *Config

WithHelperStreamCount sets the number of XS Helper streams to run on this instance.

func (*Config) WithHostname

func (c *Config) WithHostname(name string) *Config

WithHostname sets the hostname to be used when generating NVMe configurations.

func (*Config) WithLogFile

func (c *Config) WithLogFile(logPath string) *Config

WithLogFile sets the path to the log file to be used by this instance.

func (*Config) WithLogMask

func (c *Config) WithLogMask(logMask string) *Config

WithLogMask sets the DAOS logging mask to be used by this instance.

func (*Config) WithModules

func (c *Config) WithModules(mList string) *Config

WithModules sets the list of I/O server modules to be loaded.

func (*Config) WithPinnedNumaNode

func (c *Config) WithPinnedNumaNode(numa *uint) *Config

WithPinnedNumaNode sets the NUMA node affinity for the I/O server instance

func (*Config) WithRank

func (c *Config) WithRank(r uint32) *Config

WithRank sets the instance rank.

func (*Config) WithScmClass

func (c *Config) WithScmClass(scmClass string) *Config

WithScmClass defines the type of SCM storage to be configured.

func (*Config) WithScmDeviceList

func (c *Config) WithScmDeviceList(devices ...string) *Config

WithScmDeviceList sets the list of devices to be used for SCM storage.

func (*Config) WithScmMountPoint

func (c *Config) WithScmMountPoint(scmPath string) *Config

WithScmMountPath sets the path to the device used for SCM storage.

func (*Config) WithScmRamdiskSize

func (c *Config) WithScmRamdiskSize(size int) *Config

WithScmRamdiskSize sets the size (in GB) of the ramdisk used to emulate SCM (no effect if ScmClass is not RAM).

func (*Config) WithServiceThreadCore

func (c *Config) WithServiceThreadCore(idx int) *Config

WithServiceThreadCore sets the core index to be used for running DAOS service threads.

func (*Config) WithShmID

func (c *Config) WithShmID(shmID int) *Config

WithShmID sets the shared memory segment ID to be used with SPDK.

func (*Config) WithSocketDir

func (c *Config) WithSocketDir(dir string) *Config

WithSocketDir sets the path to the instance's dRPC socket directory.

func (*Config) WithSystemName

func (c *Config) WithSystemName(name string) *Config

WithSystemName sets the system name to which the instance belongs.

func (*Config) WithTargetCount

func (c *Config) WithTargetCount(count int) *Config

WithTargetCount sets the number of VOS targets to run on this instance.

type ExitStatus

type ExitStatus string

ExitStatus implements the error interface and is used to indicate special IOserver exit conditions.

const (

	// NormalExit indicates that the process exited without error
	NormalExit ExitStatus = "process exited with 0"
)

func (ExitStatus) Error

func (es ExitStatus) Error() string

type FabricConfig

type FabricConfig struct {
	Provider       string `yaml:"provider,omitempty" cmdEnv:"CRT_PHY_ADDR_STR"`
	Interface      string `yaml:"fabric_iface,omitempty" cmdEnv:"OFI_INTERFACE"`
	InterfacePort  int    `yaml:"fabric_iface_port,omitempty" cmdEnv:"OFI_PORT,nonzero"`
	PinnedNumaNode *uint  `yaml:"pinned_numa_node,omitempty" cmdLongFlag:"--pinned_numa_node" cmdShortFlag:"-p"`
}

FabricConfig encapsulates networking fabric configuration.

func (*FabricConfig) GetNumaNode

func (fc *FabricConfig) GetNumaNode() (uint, error)

GetNumaNode retrieves the value configured by the YML if it was supplied returns an error if it was not configured.

func (*FabricConfig) Update

func (fc *FabricConfig) Update(other FabricConfig)

Update fills in any missing fields from the provided FabricConfig.

func (*FabricConfig) Validate

func (fc *FabricConfig) Validate() error

Validate ensures that the configuration meets minimum standards.

type Rank

type Rank uint32

Rank is used to uniquely identify a server within a cluster

const (
	// MaxRank is the largest valid Rank value
	MaxRank Rank = math.MaxUint32 - 1
	// NilRank is an unset Rank (0 is a valid Rank)
	NilRank Rank = math.MaxUint32
)

func NewRankPtr

func NewRankPtr(in uint32) *Rank

func (*Rank) Equals

func (r *Rank) Equals(other *Rank) bool

Equals compares this rank to the given rank. If either value is nil, the comparison is always false.

func (*Rank) String

func (r *Rank) String() string

func (*Rank) Uint32 added in v0.9.0

func (r *Rank) Uint32() uint32

func (*Rank) UnmarshalYAML

func (r *Rank) UnmarshalYAML(unmarshal func(interface{}) error) error

type Runner

type Runner struct {
	Config *Config
	// contains filtered or unexported fields
}

Runner starts and manages an instance of a DAOS I/O Server

func NewRunner

func NewRunner(log logging.Logger, config *Config) *Runner

NewRunner returns a configured ioserver.Runner

func (*Runner) GetConfig

func (r *Runner) GetConfig() *Config

GetConfig returns the runner's configuration

func (*Runner) IsRunning added in v0.9.0

func (r *Runner) IsRunning() bool

IsRunning indicates whether the Runner process is running or not.

func (*Runner) Start

func (r *Runner) Start(ctx context.Context, errOut chan<- error) error

Start asynchronously starts the IOServer instance.

func (*Runner) Stop added in v0.9.0

func (r *Runner) Stop(force bool) error

Stop sends relevant shutdown signal to the Runner process (idempotent).

type StorageConfig

type StorageConfig struct {
	SCM  storage.ScmConfig  `yaml:",inline"`
	Bdev storage.BdevConfig `yaml:",inline"`
}

StorageConfig encapsulates an I/O server's storage configuration.

func (*StorageConfig) Validate

func (sc *StorageConfig) Validate() error

Validate ensures that the configuration meets minimum standards.

type TestRunner

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

func NewTestRunner

func NewTestRunner(trc *TestRunnerConfig, sc *Config) *TestRunner

func (*TestRunner) GetConfig

func (tr *TestRunner) GetConfig() *Config

func (*TestRunner) IsRunning added in v0.9.0

func (tr *TestRunner) IsRunning() bool

func (*TestRunner) Start

func (tr *TestRunner) Start(ctx context.Context, errChan chan<- error) error

func (*TestRunner) Stop added in v0.9.0

func (tr *TestRunner) Stop(bool) error

type TestRunnerConfig

type TestRunnerConfig struct {
	StartCb    func()
	StartErr   error
	ErrChanCb  func() error
	ErrChanErr error
}

Jump to

Keyboard shortcuts

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