Documentation
¶
Overview ¶
Package platform contains interface and implementation to run SDA code amongst multiple platforms. Such implementations include Localhost (run your test locally) and Deterlab (similar to emulab).
Index ¶
- func Build(path, out, goarch, goos string, buildArgs ...string) (string, error)
- func KillGo()
- func Rsync(username, host, file, dest string) error
- func SSHRun(username, host, command string) ([]byte, error)
- func SSHRunStdout(username, host, command string) error
- func Scp(username, host, file, dest string) error
- type Config
- type Deterlab
- type Localhost
- type Platform
- type RunConfig
- func (r *RunConfig) Clone() *RunConfig
- func (r *RunConfig) Delete(field string)
- func (r *RunConfig) Get(field string) string
- func (r *RunConfig) GetInt(field string) (int, error)
- func (r *RunConfig) Map() map[string]string
- func (r *RunConfig) Put(field, value string)
- func (r *RunConfig) String() string
- func (r *RunConfig) Toml() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build builds the the golang packages in `path` and stores the result in `out`. Besides specifying the environment variables GOOS and GOARCH you can pass any additional argument using the buildArgs argument. The command which will be executed is of the following form: $ go build -v buildArgs... -o out path
func Rsync ¶
Rsync copies files or directories to the remote host. If the DebugVisible is > 1, the rsync-operation is displayed on screen.
func SSHRunStdout ¶
SSHRunStdout runs a command on the remote host but redirects stdout and stderr of the Ssh-command to the os.Stderr and os.Stdout
Types ¶
type Config ¶
Config is passed to Platform.Config and prepares the platform for specific system-wide configurations
type Deterlab ¶
type Deterlab struct { // *** Deterlab-related configuration // The login on the platform Login string // The outside host on the platform Host string // The name of the project Project string // Name of the Experiment - also name of hosts Experiment string // DNS-resolvable names Phys []string // VLAN-IP names (physical machines) Virt []string // ProxyAddress : the proxy will redirect every traffic it // receives to this address ProxyAddress string // MonitorAddress is the address given to clients to connect to the monitor // It is actually the Proxy that will listen to that address and clients // won't know a thing about it MonitorAddress string // Port number of the monitor and the proxy MonitorPort int // Number of available servers Servers int // Name of the simulation Simulation string // Number of machines Hosts int // Debugging-level: 0 is none - 5 is everything Debug int // The number of seconds to wait for closing the connection CloseWait int // contains filtered or unexported fields }
Deterlab holds all fields necessary for a Deterlab-run
func (*Deterlab) Build ¶
Build prepares all binaries for the Deterlab-simulation. If 'build' is empty, all binaries are created, else only the ones indicated. Either "simul" or "users"
func (*Deterlab) Cleanup ¶
Cleanup kills all eventually remaining processes from the last Deploy-run
func (*Deterlab) Configure ¶
Configure initialises the directories and loads the saved config for Deterlab
func (*Deterlab) Deploy ¶
Deploy creates the appropriate configuration-files and copies everything to the deterlab-installation.
type Localhost ¶
type Localhost struct { // The simulation to run Simulation string // contains filtered or unexported fields }
Localhost is the platform for launching thee apps locally
type Platform ¶
type Platform interface { // Does the initial configuration of all structures needed for the platform Configure(*Config) // Build builds all necessary binaries Build(build string, arg ...string) error // Makes sure that there is no part of the application still running Cleanup() error // Copies the binaries to the appropriate directory/machines, together with // the necessary configuration. RunConfig is a simple string that should // be copied as 'app.toml' to the directory where the app resides Deploy(RunConfig) error // Starts the application and returns - non-blocking! Start(args ...string) error // Waits for the application to quit Wait() error }
Platform interface that has to be implemented to add another simulation- platform.
func NewPlatform ¶
NewPlatform returns the appropriate platform [deterlab,localhost]
type RunConfig ¶
type RunConfig struct {
// contains filtered or unexported fields
}
RunConfig is a struct that represent the configuration to apply for one "test" Note: a "simulation" is a set of "tests"
func NewRunConfig ¶
func NewRunConfig() *RunConfig
NewRunConfig returns an initialised config to be used for reading in runconfig-files
func ReadRunFile ¶
ReadRunFile reads from a configuration-file for a run. The configuration-file has the following syntax: Name1 = value1 Name2 = value2 [empty line] n1, n2, n3, n4 v11, v12, v13, v14 v21, v22, v23, v24
The Name1...Namen are global configuration-options. n1..nn are configuration-options for one run Both the global and the run-configuration are copied to both the platform and the app-configuration.
func (*RunConfig) Clone ¶
Clone this runconfig so it has all fields-value relationship already present
func (*RunConfig) Delete ¶
Delete a field from the runconfig (delete for example Simulation which we dont care in the final csv)
Directories
¶
Path | Synopsis |
---|---|
Deterlab-specific files
|
Deterlab-specific files |
users
This is run on the users.deterlab.net server and will clean up the servers and then run 'cothority' on every server.
|
This is run on the users.deterlab.net server and will clean up the servers and then run 'cothority' on every server. |