Skip to content

Commit 7133636

Browse files
Dev AgentRader
authored andcommitted
[deploy]Check if pod is creating
1 parent abaf90e commit 7133636

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

builder/deploy/deployer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@ func (d *deployer) Wakeup(ctx context.Context, dr types.DeployRequest) error {
434434

435435
// Spawn goroutine to handle HTTP request asynchronously
436436
// This ensures the client.Timeout (20s) takes effect instead of the upstream context deadline
437+
if len(cluster.AppEndpoint) < 1 {
438+
// host is required for remote cluster with app endpoint
439+
host = ""
440+
}
437441
go d.wakeUpDeploy(target, host, dr)
438442

439443
// Return immediately without waiting for the HTTP request to complete

common/types/repo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ type InstanceInfo struct {
189189
Message string `json:"message"`
190190
Reason string `json:"reason"`
191191
ReadyCount int `json:"ready_count"`
192+
IsCreating bool `json:"is_creating"`
192193
}
193194

194195
// repo object(cover model/space/code/dataset) for deployer

runner/component/service.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ func (s *serviceComponentImpl) getServicePodsWithStatus(ctx context.Context, clu
365365
readyCount++
366366
}
367367
}
368+
if !instanceInfo.IsCreating {
369+
instanceInfo.IsCreating = isContainerCreating(&pod)
370+
}
368371
}
369372
instanceInfo.Instances = podInstances
370373
instanceInfo.ReadyCount = readyCount
@@ -929,7 +932,13 @@ func (s *serviceComponentImpl) getServiceStatus(ctx context.Context, ks v1.Servi
929932
isActive, containerStatus := isUserContainerActive(instInfo.Instances)
930933
switch {
931934
case serviceCondition == nil, containerStatus == string(corev1.PodPending):
932-
resp.Code = common.Pending
935+
slog.DebugContext(ctx, "getServiceStatus for corev1.PodPending",
936+
slog.Any("ksvc_name", ks.Name), slog.Any("instance info", instInfo))
937+
if instInfo.IsCreating {
938+
resp.Code = common.Deploying
939+
} else {
940+
resp.Code = common.Pending
941+
}
933942
case serviceCondition.Status == corev1.ConditionUnknown, serviceCondition.Status == corev1.ConditionFalse:
934943
resp.Code = common.DeployFailed
935944
if isActive && containerStatus == string(corev1.PodRunning) {

0 commit comments

Comments
 (0)