Documentation ¶
Index ¶
- Constants
- func ApiReq(endpoint, api string, insecure bool, args url.Values) (body []byte, err error)
- func CreateHelpErr() error
- func GetOutboundIP() string
- func HpcLive(cluster string) (err error)
- func HpcLogin(endpoint string, insecure bool, cluster, username, apikey, vault string) (err error)
- func HpcVault(vault string) (err error)
- func IsYes(str string) bool
- func ParseJobFlags(data interface{}, parser *flags.Parser, jobScriptParser *flags.Parser, ...) error
- func PreprocessArgs(args []string) ([]string, error)
- func PrintTable(table [][]string, line bool)
- func ReadJarviceConfigTarget() string
- func WriteJarviceConfig(config JarviceConfig) error
- func WriteJarviceConfigTarget(target string) error
- type HpcReq
- type JarviceApiSubmission
- type JarviceApplication
- type JarviceCluster
- type JarviceConfig
- type JarviceCreds
- type JarviceJob
- type JarviceJobRequest
- type JarviceJobResponse
- type JarviceJobs
- type JarviceMachine
- type JarviceQueue
- type JarviceQueues
- type JarviceVault
- type JobScript
- type JobSpec
Constants ¶
View Source
const ( JarviceHpcConfigPath = "/.config/jarvice-hpc/" JarviceHpcConfigFilename = "config.json" JarviceHpcConfigFilePerms = 0600 )
View Source
const ( // TODO: use application command specified by queue JarviceHpcCommand = "Batch" // XXX JarviceHpcGeometry = "1280x720" JarviceHpcStaging = false JarviceHpcCheckedout = false JarviceHpcCommandName = "HpcJob" )
Default constants
View Source
const JarviceHpcConfigEnv = "JARVICE_HPC_CONFIG"
View Source
const JobScriptArg = "PARSE_JOBSCRIPT"
Variables ¶
This section is empty.
Functions ¶
func CreateHelpErr ¶
func CreateHelpErr() error
func GetOutboundIP ¶
func GetOutboundIP() string
func ParseJobFlags ¶
func PreprocessArgs ¶
func PrintTable ¶
func ReadJarviceConfigTarget ¶
func ReadJarviceConfigTarget() string
func WriteJarviceConfig ¶
func WriteJarviceConfig(config JarviceConfig) error
Types ¶
type HpcReq ¶
type HpcReq struct { JobEnvConfig string `json:"hpc_job_env_config"` JobScript string `json:"hpc_job_script"` JobShell string `json:"hpc_job_shell"` Queue string `json:"hpc_queue"` Umask int `json:"hpc_umask"` Envs map[string]string `json:"hpc_envs,omitempty"` Resources map[string]string `json:"hpc_resources"` }
type JarviceApiSubmission ¶
type JarviceApiSubmission struct { Machine JarviceMachine `json:"machine"` Queue string `json:"queue"` }
type JarviceApplication ¶
type JarviceApplication struct { Command string `json:"command"` Walltime string `json:"walltime,omitempty"` Geometry string `json:"geometry"` Parameters map[string]interface{} `json:"parameters,omitempty"` }
JARVICE submission format
type JarviceCluster ¶
type JarviceCluster struct { Endpoint string `json:"jarvice_endpoint"` Insecure bool `json:"jarvice_insecure"` Vault string `json:"jarvice_vault"` Creds JarviceCreds `json:"jarvice_user"` }
func GetClusterConfig ¶
func GetClusterConfig() (cluster JarviceCluster, err error)
func (JarviceCluster) GetUrlCreds ¶
func (c JarviceCluster) GetUrlCreds() url.Values
type JarviceConfig ¶
type JarviceConfig map[string]JarviceCluster
func ReadJarviceConfig ¶
func ReadJarviceConfig() (JarviceConfig, error)
type JarviceCreds ¶
type JarviceJob ¶
type JarviceJob struct { Label string `json:"job_label"` User string `json:"job_owner_username"` Status string `json:"job_status"` SubmitTime int `json:"job_submit_time"` StartTime int `json:"job_start_time"` EndTime int `json:"job_end_time"` ExitCode int `json:"job_exitcode"` App string `json:"job_application"` ApiSubmission JarviceApiSubmission `json:"job_api_submission"` }
type JarviceJobRequest ¶
type JarviceJobRequest struct { App string `json:"app"` Staging bool `json:"staging"` Checkedout bool `json:"checkedout"` Application JarviceApplication `json:"application"` Machine JarviceMachine `json:"machine"` Vault JarviceVault `json:"vault"` JobLabel string `json:"job_label,omitempty"` User JarviceCreds `json:"user"` Hpc HpcReq `json:"hpc"` Licenses *string `json:"licenses,omitempty"` JobProject *string `json:"job_project,omitempty"` }
type JarviceJobResponse ¶
Return from API (jarvice/submit)
func JarviceSubmitJob ¶
func JarviceSubmitJob(endpoint string, insecure bool, jobReq JarviceJobRequest) (JarviceJobResponse, error)
Submit job request to JARVICE API
type JarviceJobs ¶
type JarviceJobs = map[int]JarviceJob
type JarviceMachine ¶
type JarviceQueue ¶
type JarviceQueues ¶
type JarviceQueues = map[string]JarviceQueue
type JarviceVault ¶
type JobScript ¶
type JobScript struct { Shell string `json:"hpc_shell"` // Args parsed from SBATCH directive Args []string `json:"hpc_args"` Script []byte `json:"hpc_script"` }
XXX Data for HPC job script
#!/bin/bash #SBATCH --job-name=job_test # Job name #SBATCH --time=00:05:00 pwd; hostname; date
func ParseJobScript ¶
type JobSpec ¶
type JobSpec struct { // Job environment variables SubmitDirectory string `json:"hpc_submit_directory"` SubmitHost string `json:"hpc_submit_host"` QueueName string `json:"hpc_queue_name"` JobName string `json:"hpc_job_name"` UserEnv map[string]string `json:"hpc_user_env"` Queue string `json:"hpc_queue"` NodeCount int `json:"hpc_node_count"` CpuCount int `json:"hpc_cpu_count"` WallClockLimit string `json:"hpc_wall_clock_limit"` OutputFile string `json:"hpc_output_file"` ErrorFile string `json:"hpc_error_file"` CopyEnvironment string `json:"hpc_opy_environment"` EventNotification string `json:"hpc_event_notification"` EmailAddress string `json:"hpc_email_address"` JobRestart bool `json:"hpc_job_restart"` WorkingDirectory string `json:"hpc_working_directory"` Exclusive bool `json:"hpc_exclusive"` Memory string `json:"hpc_memory"` ChargeAccount string `json:"hpc_charge_account"` TasksPerNode int `json:"hpc_tasks_per_node"` CpusPerTask int `json:"hpc_cpus_per_task"` JobDependency string `json:"hpc_job_dependency"` JobProject string `json:"hpc_job_project"` GenericResources string `json:"hpc_generic_resources"` Licenses string `json:"hpc_licenses"` BeginTime string `json:"hpc_begin_time"` }
Click to show internal directories.
Click to hide internal directories.