Documentation ¶
Index ¶
- Constants
- Variables
- func CmdConfigMachineType(c *cli.Context) error
- func CmdConfigMachineTypeList(c *cli.Context) (err error)
- func CmdConfigMachineTypeSet(c *cli.Context) (err error)
- func CmdConfigMachineTypeShow(c *cli.Context) (err error)
- func CmdConfigProject(c *cli.Context) error
- func CmdConfigProjectSet(c *cli.Context) (err error)
- func CmdConfigProjectShow(c *cli.Context) (err error)
- func CmdConfigRegion(c *cli.Context) error
- func CmdConfigRegionList(c *cli.Context) (err error)
- func CmdConfigRegionSet(c *cli.Context) (err error)
- func CmdConfigRegionShow(c *cli.Context) (err error)
- func CmdDataPut(c *cli.Context) (err error)
- func CmdInit(c *cli.Context) (err error)
- func CmdLog(c *cli.Context) (err error)
- func CmdQueueAdd(c *cli.Context) (err error)
- func CmdQueueDelete(c *cli.Context) (err error)
- func CmdQueueInstanceAdd(c *cli.Context) (err error)
- func CmdQueueInstanceList(c *cli.Context) (err error)
- func CmdQueueLog(c *cli.Context) error
- func CmdQueueRestart(c *cli.Context) (err error)
- func CmdQueueStatus(c *cli.Context) error
- func CmdQueueStop(c *cli.Context) (err error)
- func CmdResult(c *cli.Context) error
- func CmdResultDelete(c *cli.Context) (err error)
- func CmdResultGet(c *cli.Context) error
- func CmdResultList(c *cli.Context) (err error)
- func CmdResultShow(c *cli.Context) (err error)
- func CmdRun(c *cli.Context) (err error)
- func CmdSourcePut(c *cli.Context) (err error)
- func CmdStatus(c *cli.Context) error
- func CmdStatusKill(c *cli.Context) error
- func GenerateDeleteAction(container string) func(*cli.Context) error
- func GenerateGetAction(container string) func(*cli.Context) error
- func GenerateListAction(container string) func(*cli.Context) error
- func PrepareCommand(c *cli.Context) (err error)
- func PrintDirList(m *Metadata, container, prefix string, url, quiet bool) (err error)
- func PrintFileList(m *Metadata, container, prefix string, url, quiet bool) (err error)
- func UpdateResultSection(s *script.Script, overwrite bool, warning io.Writer) (err error)
- func UpdateSourceSection(m *Metadata, s *script.Script, opt *SourceOpt, storage *cloud.Storage) (err error)
- type AddRecorder
- type Metadata
- func (m *Metadata) InstanceManager() (cloud.InstanceManager, error)
- func (m *Metadata) LogManager() (cloud.LogManager, error)
- func (m *Metadata) QueueManager() (cloud.QueueManager, error)
- func (m *Metadata) ResourceManager() (cloud.ResourceManager, error)
- func (m *Metadata) StorageManager() (cloud.StorageManager, error)
- type QueueName
- type SourceOpt
Constants ¶
const ( // DefaultSleepTime defines a default sleep time. DefaultSleepTime = 30 * time.Second // PrintTimeFormat defines time format to be used to print logs. PrintTimeFormat = "2006/01/02 15:04:05" // ConfigFile defines the default configuration file name. ConfigFile = "roadie.yml" // DefaultWaitTimeOfInstanceCreation defines the default waiting time // for creating an instance. DefaultWaitTimeOfInstanceCreation = 3 * time.Minute )
const ( // QueueStatusHeaderName is the header name for queue names. QueueStatusHeaderName = "QUEUE NAME" // QueueStatusHeaderRunning is the header name for the numbers of running tasks. QueueStatusHeaderRunning = "RUNNING" // QueueStatusHeaderWaiting is the header name for the numbers of waiting tasks. QueueStatusHeaderWaiting = "WAITING" // QueueStatusHeaderPending is the header name for the numbers of pending tasks. QueueStatusHeaderPending = "PENDING" // QueueStatusHeaderWorker is the header name for the number of worker instances. QueueStatusHeaderWorker = "WORKER" // TaskStatusHeaderName is the header name for task names. TaskStatusHeaderName = "TASK NAME" // TaskStatusHeaderStatus is the header name for task statuses. TaskStatusHeaderStatus = "STATUS" )
const (
// MsgNotSet is the message to be printed when some config isn't set.
MsgNotSet = "Not set"
)
const (
// StdoutFilePrefix defines a prefix for stdout result files.
StdoutFilePrefix = "stdout"
)
Variables ¶
var ( // ErrNoMetadata is an error raised then no metadata are attached to contexts. ErrNoMetadata = fmt.Errorf("No metadata are attached") // ErrNoConfiguration is an error raised when no configurations are given. ErrNoConfiguration = fmt.Errorf("No configurations are given") // ErrServiceConfiguration is an error raised when the given service // configuration is not correct. ErrServiceConfiguration = fmt.Errorf("Cloud service configuration is not correct") )
Functions ¶
func CmdConfigMachineType ¶ added in v0.3.5
CmdConfigMachineType shows current configuration of machine type, or show help message when either -h or --help flag is set.
func CmdConfigMachineTypeList ¶ added in v0.3.5
CmdConfigMachineTypeList implements `config machine list` command.
func CmdConfigMachineTypeSet ¶ added in v0.3.5
CmdConfigMachineTypeSet implements `config machine set` command.
func CmdConfigMachineTypeShow ¶ added in v0.3.5
CmdConfigMachineTypeShow implements `config machine set` command.
func CmdConfigProject ¶
CmdConfigProject shows or sets project ID to config file.
func CmdConfigProjectSet ¶
CmdConfigProjectSet implements `config project set` command.
func CmdConfigProjectShow ¶
CmdConfigProjectShow implements `config project show` command.
func CmdConfigRegion ¶ added in v0.3.5
CmdConfigRegion shows current configuration of zone, or show help message when either -h or --help flag is set.
func CmdConfigRegionList ¶ added in v0.3.5
CmdConfigRegionList implements `config region list` command.
func CmdConfigRegionSet ¶ added in v0.3.5
CmdConfigRegionSet implements `config region set` command.
func CmdConfigRegionShow ¶ added in v0.3.5
CmdConfigRegionShow implements `config region show` command.
func CmdQueueAdd ¶ added in v0.3.5
CmdQueueAdd adds a given script to a given named queue.
func CmdQueueDelete ¶ added in v0.3.5
CmdQueueDelete deletes a task in a queue or whole queue.
func CmdQueueInstanceAdd ¶ added in v0.3.0
CmdQueueInstanceAdd implements `queue instance add`.
func CmdQueueInstanceList ¶ added in v0.3.0
CmdQueueInstanceList implements `queue instance list` command.
func CmdQueueLog ¶ added in v0.3.5
CmdQueueLog prints all log from a queue if only queue name is given; otherwise prints log of a specific task.
func CmdQueueRestart ¶ added in v0.3.0
CmdQueueRestart implements `queue restart` command.
func CmdQueueStatus ¶ added in v0.3.5
CmdQueueStatus lists up existing queue information if no arguments given; otherwise lists up existing tasks' information in a given queue. Each information should have queue name, the number of items in the queue, the number of instances working to the queue.
func CmdQueueStop ¶ added in v0.3.0
CmdQueueStop implements `queue stop` command.
func CmdResult ¶
CmdResult defines the default behavior which is showing help with --help or -h. Otherwise, do as list command.
func CmdResultDelete ¶
CmdResultDelete deletes result files which belong to a given instance and matches given queries.
func CmdResultGet ¶
CmdResultGet downloads results files which belong to a given named instance and matches one of given queries. If no queries are given, the wild card * will be used instead.
func CmdResultList ¶
CmdResultList shows a list of instance names or result files belonging to an instance. This command takes one optional argument, instance name. If an instance name is given, this command shows result files associated with the given instance. If any instance names are not given, this command shows names of instances of which results are stored in a cloud storage.
func CmdResultShow ¶
CmdResultShow shows results of a given named instance. This command takes two arguments, instance name and file name; and prints the body of the given named file belonging to the given named instance. File name argument can be omitted and then all files which have prefix `stdout` will be printed.
func CmdSourcePut ¶
CmdSourcePut archives a given folder and uploads it as a given named file. This command takes two arguments: - filepath: path for a file or a directory - name: uploading archive name Argument name can be omitted. If name is omitted, the name of file or directory where filepath points will be used as the name argument. Note that source files are archived by tar-gz method and actual uploaded file will have `.tar.gz` suffix.
The source put command also takes --exclude flag. If the flag is given, any files mathing the excluding patters will be omitted from the source archive file.
func GenerateDeleteAction ¶
GenerateDeleteAction generates an action which deletes files from a given container.
func GenerateGetAction ¶
GenerateGetAction generates an action which downloads files from a given container.
func GenerateListAction ¶
GenerateListAction generates an action which prints list of files in a given container. If url is true, show urls, too.
func PrepareCommand ¶ added in v0.3.4
PrepareCommand prepares executing any command; it loads the configuratio file, checkes global flags.
func PrintDirList ¶
PrintDirList prints a list of directoris in a given prefix.
func PrintFileList ¶
PrintFileList prints a list of files having a given prefix.
func UpdateResultSection ¶ added in v0.3.5
UpdateResultSection updates result section of the given script file.
Types ¶
type AddRecorder ¶
AddRecorder is a callback to add file information to a table.
type Metadata ¶ added in v0.3.5
type Metadata struct { // Context for running a command. Context context.Context // Config for running a command. Config *config.Config // Stdin in an io.Readre to read user's input. Stdin io.Reader // Stdout is an io.Writer to output messages to the standard output. Stdout io.Writer // Stderr is an io.Writer to output messages to the standard error. Stderr io.Writer // Logger to output logs. Logger *log.Logger // Spinner for decorating output standard message; not logging information. // If verbose mode is set, the spinner will be disabled. Spinner *spinner.Spinner // contains filtered or unexported fields }
Metadata is a set of data used for any commands.
func (*Metadata) InstanceManager ¶ added in v0.3.5
func (m *Metadata) InstanceManager() (cloud.InstanceManager, error)
InstanceManager returns an instance manager interface.
func (*Metadata) LogManager ¶ added in v0.3.5
func (m *Metadata) LogManager() (cloud.LogManager, error)
LogManager returns a log manager interface.
func (*Metadata) QueueManager ¶ added in v0.3.5
func (m *Metadata) QueueManager() (cloud.QueueManager, error)
QueueManager returns a queue manager interface.
func (*Metadata) ResourceManager ¶ added in v0.3.5
func (m *Metadata) ResourceManager() (cloud.ResourceManager, error)
ResourceManager returns a resource manager interface.
func (*Metadata) StorageManager ¶ added in v0.3.5
func (m *Metadata) StorageManager() (cloud.StorageManager, error)
StorageManager returns a storage manager interface.
type QueueName ¶ added in v0.3.0
type QueueName struct { // Queue name. QueueName string }
QueueName is a structure to obtaine QueueName attribute from entities in cloud datastore.
type SourceOpt ¶ added in v0.3.5
type SourceOpt struct { // Git specifies a URL for a git repository to be used as source code. Git string // URL specifies a URL of an archive or executable file. URL string // Local specifies a local path which contains source code. All files except // matched the exclude pattern are archived and uploaded to a cloud storage. Local string // Exclude specifies a glob patters. Matched paths are excluded from the // source code archive. This option works with the local option. Exclude []string // Source specifies a file name in uploaded as source code already. Source string }
SourceOpt defines options to update source section