Skip to content

Commit 0d8a002

Browse files
fix: fix script path
1 parent 321c919 commit 0d8a002

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

controller/src/controller/gpu/controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ type Controller interface {
2828
type controller struct{}
2929

3030
func (c *controller) dispatchGpuJob(gpuJob *apiObject.GpuJob) {
31-
log("received %+v gpu: ", gpuJob)
3231
jobFullName := gpuJob.Namespace() + "/" + gpuJob.Name()
3332
gpuServerCommands := []string{
3433
"./gpu-server",
@@ -109,6 +108,7 @@ func (c *controller) dispatchGpuJob(gpuJob *apiObject.GpuJob) {
109108
}
110109

111110
func (c *controller) deleteGpuJobPod(gpuJob *apiObject.GpuJob) {
111+
log("delete gpu job pod %s/%s", gpuJob.Namespace(), gpuJob.Name())
112112
namespace, name := gpuJob.Namespace(), gpuJob.Name()
113113
URL := url.Prefix + path.Join(url.PodURL, namespace, name)
114114
httputil.DeleteWithoutBody(URL)
@@ -119,6 +119,7 @@ func (c *controller) handleGpuJobUpdate(msg *redis.Message) {
119119
if err := json.Unmarshal([]byte(msg.Payload), gpuJobUpdate); err != nil {
120120
return
121121
}
122+
log("received gpu update: %+v", gpuJobUpdate)
122123
gpuJob := gpuJobUpdate.Target
123124
switch gpuJobUpdate.Action {
124125
case entity.CreateAction:

gpu/run/gpu-server

-5.57 KB
Binary file not shown.

gpu/src/gpu/server.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,22 @@ func (s *server) uploadJobStatus(jobStatus *entity.GpuJobStatus) {
7373
client.Publish(ctx, topicutil.GpuJobStatusTopic(), msg)
7474
}
7575

76-
func (s *server) poll() bool {
77-
defer s.recover()
78-
fmt.Println("Poll")
79-
state, completed := s.cli.JobCompleted(s.jobID)
80-
jobName := s.args.JobName
76+
func parseJobName(jobName string) (namespace, name string) {
8177
parts := strings.Split(jobName, "/")
82-
var namespace, name string
8378
if len(parts) == 2 {
8479
namespace, name = parts[0], parts[1]
8580
} else {
8681
namespace, name = "default", jobName
8782
}
83+
return
84+
}
85+
86+
func (s *server) poll() bool {
87+
defer s.recover()
88+
fmt.Println("Poll")
89+
state, completed := s.cli.JobCompleted(s.jobID)
90+
jobName := s.args.JobName
91+
namespace, name := parseJobName(jobName)
8892
status := &entity.GpuJobStatus{
8993
Namespace: namespace,
9094
Name: name,
@@ -127,7 +131,7 @@ func (s *server) uploadSmallFiles(filenames []string) error {
127131
}
128132

129133
func (s *server) scriptPath() string {
130-
return path.Join(s.args.WorkDir, s.args.JobName+"-"+s.uid+".slurm")
134+
return path.Join(s.args.WorkDir, s.uid+".slurm")
131135
}
132136

133137
func (s *server) createJobScript() error {

kubectl/src/cmd/get_describe_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ func getFunctionStatusesFromApiServer() (functions []*entity.FunctionStatus, err
452452

453453
func getGpuJobStatusFromApiServer(fullName string) (gpu *entity.GpuJobStatus, err error) {
454454
namespace, name := parseName(fullName)
455-
URL := url.Prefix + path.Join(url.GpuURL, namespace, name)
455+
URL := url.Prefix + path.Join(url.GpuURL, "status", namespace, name)
456456
err = httputil.GetAndUnmarshal(URL, &gpu)
457457
return
458458
}

0 commit comments

Comments
 (0)