batexpe

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: LGPL-3.0 Imports: 14 Imported by: 2

README

pipeline status coverage report

This repository contains a set of Go tools around Batsim to simplify experiments.

Install

Via the go tool

go get framagit.org/batsim/batexpe/cmd/robin
go get framagit.org/batsim/batexpe/cmd/robintest

Via nix

git clone https://gitlab.inria.fr/vreis/datamove-nix.git ./datamovepkgs
nix-env --file ./datamovepkgs --install --attr batexpe

Proposed tools

  • robin manages the execution of one simulation.
    It is meant to be as robust as possible, as it is the core building block to create experiment workflows with Batsim.
  • robintest is a robin wrapper mainly used to test robin. robintest notably allows to specify what (robin/batsim/scheduler) result is expected.
  • the multiple commands are just wrappers around the batexpe library (written in Go).
    This allows users to build their own tools (in Go) with decent code reuse.

Documentation

Index

Constants

View Source
const (
	SUCCESS int = iota
	TIMEOUT
	FAILURE
)

Variables

This section is empty.

Functions

func CreateDirIfNeeded

func CreateDirIfNeeded(dir string) error

func ExecuteOne

func ExecuteOne(exp Experiment, previewOnError bool) int

Execute one Batsim simulation

func ExecuteTimeout added in v0.3.0

func ExecuteTimeout(name, cmdString, cmdFile, stdoutFile, stderrFile,
	subprocessType string,
	cmd *exec.Cmd, timeout float64, onstart chan CmdFinishedMsg,
	onexit chan CmdFinishedMsg, previewOnError bool)

Execute a command, writing status result on a channel

func IsBatsimOrBatschedRunning added in v0.2.0

func IsBatsimOrBatschedRunning() (bool, error)

func KillProcess added in v0.2.0

func KillProcess(pid int)

func ParseRobinOutput added in v0.2.0

func ParseRobinOutput(output string) ([]interface{}, error)

func PortFromBatSock

func PortFromBatSock(socket string) (port uint16, err error)

func PrepareDirs

func PrepareDirs(exp Experiment) error

func PreviewFile added in v0.2.0

func PreviewFile(filename string, maxLines int64) (preview string, err error)

func ToYaml

func ToYaml(exp Experiment) (yam string, err error)

func Version added in v0.2.0

func Version() string

func WasBatsimSuccessful added in v0.2.0

func WasBatsimSuccessful(robinJsonLines []interface{}) (successful, killed bool)

func WasContextClean added in v0.2.0

func WasContextClean(robinJsonLines []interface{}) bool

func WasSchedSuccessful added in v0.2.0

func WasSchedSuccessful(robinJsonLines []interface{}) (successful, present, killed bool)

Types

type BatsimArgs

type BatsimArgs struct {
	Socket        string
	ExportPrefix  string
	BatexecMode   bool
	RedisEnabled  bool
	RedisHostname string
	RedisPort     int
	RedisPrefix   string
}

func ParseBatsimCommand

func ParseBatsimCommand(batcmd string) (batargs BatsimArgs, err error)

type CmdFinishedMsg added in v0.3.0

type CmdFinishedMsg struct {
	Name  string
	State int
}

type Experiment

type Experiment struct {
	Batcmd            string  `json:"batcmd"`
	OutputDir         string  `json:"output-dir"`
	Schedcmd          string  `json:"schedcmd"`
	SimulationTimeout float64 `json:"simulation-timeout"`
	ReadyTimeout      float64 `json:"ready-timeout"`
	SuccessTimeout    float64 `json:"success-timeout"`
	FailureTimeout    float64 `json:"failure-timeout"`
}

Stores info on one Batsim simulation instance

func FromYaml

func FromYaml(str string) (exp Experiment, convertErr error)

type RobinResult added in v0.2.0

type RobinResult struct {
	Finished  bool
	Succeeded bool
	Output    string
}

func RunRobin added in v0.2.0

func RunRobin(descriptionFile, coverFile string,
	testTimeout float64) RobinResult

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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