This commit is contained in:
zhangwei 2024-11-11 18:44:13 +08:00
parent 8a7118c81b
commit 0bf316e6e2
3 changed files with 3 additions and 14 deletions

View File

@ -88,18 +88,6 @@ type ContainerConf struct {
GetNodeResources string
}
//
//type Adapter struct {
// Name string `yaml:"Name"`
// Address string `yaml:"Address"`
// RpcAddress string `yaml:"RpcAddress"`
// Type string `yaml:"Type"`
// TenantId int `yaml:"TenantId"`
// TenantName string `yaml:"TenantName"`
// Labels Labels `yaml:"Labels"`
// MetricsUrl string `yaml:"MetricsUrl"`
//}
type Labels struct {
Cloud string `yaml:"cloud"`
}

View File

@ -145,6 +145,7 @@ func PullTaskInfo() {
}
if len(resp.Jobs) == 0 {
log.Print("no such task exist in slurm")
hpcInfo.Status = "COMPLETED"
continue
}
hpcInfo.Status = resp.Jobs[0].JobState

View File

@ -68,11 +68,11 @@ func (j *job) ListDbJob() (getJobResp GetJobResp, err error) {
return getJobResp, nil
}
func (j *job) SubmitJob(jobOptions JobOptions) (submitJobResp SubmitJobResp, err error) {
func (j *job) SubmitJob(proxyAddress string, jobOptions JobOptions) (submitJobResp SubmitJobResp, err error) {
url := j.client.url + "/slurm/" + j.client.clientVersion + "/job/submit"
httpClient := resty.New().R()
httpClient := resty.New().SetProxy(proxyAddress).R()
httpResp, err := httpClient.SetHeader("Content-Type", "application/json").
SetHeader("Accept", "application/json").
SetHeader("X-SLURM-USER-NAME", j.client.restUsername).