Skip to content

Commit

Permalink
ARMADA-2970 Small simulator improvements (#274) (#4052)
Browse files Browse the repository at this point in the history
* ARMADA-2970 Small simulator improvements

 - Log input files consistently
 - Fix log output to only occur every 5 seconds
   - Was bugged to log every round, but only after 5 seconds
 - Remove variance on gang jobs, so the finish at the same time

* Set 0 tailmean

Co-authored-by: James Murkin <James.Murkin@gresearch.co.uk>
  • Loading branch information
JamesMurkin and James Murkin authored Nov 15, 2024
1 parent 00c123a commit 2277120
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/simulator/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func runSimulations(cmd *cobra.Command, args []string) error {
defer outputSink.Close(ctx)

ctx.Info("Armada simulator")
ctx.Infof("ClusterSpec: %v", clusterSpec.Name)
ctx.Infof("WorkloadSpecs: %v", workloadSpec.Name)
ctx.Infof("ClusterSpec: %v", clusterFile)
ctx.Infof("WorkloadSpecs: %v", workloadFile)
ctx.Infof("SchedulingConfig: %v", configFile)
ctx.Infof("OutputDir: %v", outputDirPath)

Expand Down
4 changes: 3 additions & 1 deletion internal/scheduler/simulator/simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (s *Simulator) Run(ctx *armadacontext.Context) error {
}
if time.Now().Unix()-lastLogTime.Unix() >= 5 {
ctx.Infof("Simulator time %s", s.time)
lastLogTime = s.time
lastLogTime = time.Now()
}
if s.time.After(simTerminationTime) {
ctx.Infof("Current simulated time (%s) exceeds runtime deadline (%s). Terminating", s.time, simTerminationTime)
Expand Down Expand Up @@ -465,6 +465,8 @@ func submitJobFromJobTemplate(jobId string, jobTemplate *JobTemplate, gangId str
} else {
annotations[serverconfig.GangNodeUniformityLabelAnnotation] = "armadaproject.io/clusterName"
}
// Make it so gang jobs end at the same time, this means they don't have a distribution currently
jobTemplate.RuntimeDistribution.TailMean = 0
}

return &armadaevents.SubmitJob{
Expand Down

0 comments on commit 2277120

Please sign in to comment.