fix: Do not fail if no checkpoints to gc
With slurm there may be no checkpoints to gc and if so we end up with a error back from the checkpoint_gc.py script since no argument is provided to the --delete.
@@ -368,12 +368,16 @@ func (e *experiment) Receive(ctx *actor.Context) error {
}
taskSpec := *e.taskSpec
+
+ // May be no checkpoints to gc, if so skip
+ if len(checkpoints) > 0 {
taskID := model.TaskID(fmt.Sprintf("%d.%s", e.ID, uuid.New()))
ckptGCTask := newCheckpointGCTask(e.rm, e.db, e.taskLogger, taskID, e.JobID,
e.StartTime, taskSpec, e.Experiment.ID, e.Config.AsLegacy(),
checkpoints, false, taskSpec.AgentUserGroup, taskSpec.Owner, e.logCtx)
ctx.Self().System().ActorOf(addr, ckptGCTask)
+ }
if e.State == model.CompletedState {
ctx.Tell(e.hpImportance, hpimportance.ExperimentCompleted{ID: e.ID})
