Skip to content

Commit

Permalink
Only wait for SSH for StandBy instances (#805)
Browse files Browse the repository at this point in the history
Fixes #804
  • Loading branch information
fkorotkov authored Oct 24, 2024
1 parent 976dc61 commit 2a6c0ac
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions internal/executor/instance/persistentworker/isolation/tart/tart.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,22 @@ func (tart *Tart) Warmup(
additionalEnvironment map[string]string,
logger *echelon.Logger,
) error {
return tart.bootVM(ctx, ident, additionalEnvironment, "", false, logger)
err := tart.bootVM(ctx, ident, additionalEnvironment, "", false, logger)
if err != nil {
return err
}
ip, err := tart.vm.RetrieveIP(ctx)
if err != nil {
return err
}

sshClient, err := remoteagent.WaitForSSH(ctx, fmt.Sprintf("%s:%d", ip, tart.sshPort), tart.sshUser,
tart.sshPassword, tart.logger)
if err != nil {
return err
}
_ = sshClient.Close()
return err
}

func PrePull(ctx context.Context, image string, logger *echelon.Logger) error {
Expand Down Expand Up @@ -208,13 +223,6 @@ func (tart *Tart) bootVM(

bootLogger.Errorf("VM was assigned with %s IP", ip)

sshClient, err := remoteagent.WaitForSSH(ipCtx, fmt.Sprintf("%s:%d", ip, tart.sshPort), tart.sshUser,
tart.sshPassword, tart.logger)
if err != nil {
return err
}
_ = sshClient.Close()

bootLogger.Finish(true)

return nil
Expand Down

0 comments on commit 2a6c0ac

Please sign in to comment.