Bump version to 0.4.1 [Check concurrency against all scheduled experiments]
@@ -282,6 +282,13 @@ class ExperimentGroup(DiffModel,
return self.group_experiments.filter(
status__status__in=ExperimentLifeCycle.RUNNING_STATUS).distinct()
+ @property
+ def k8s_experiments(self):
+ scheduled_statuses = (ExperimentLifeCycle.RUNNING_STATUS |
+ {ExperimentLifeCycle.UNKNOWN, ExperimentLifeCycle.WARNING})
+ return self.group_experiments.filter(
+ status__status__in=scheduled_statuses).distinct()
+
@property
def done_experiments(self):
return self.group_experiments.filter(
@@ -297,7 +304,7 @@ class ExperimentGroup(DiffModel,
"""We need to check if we are allowed to start the experiment
If the polyaxonfile has concurrency we need to check how many experiments are running.
"""
- return self.concurrency - self.running_experiments.count()
+ return self.concurrency - self.k8s_experiments.count()
@property
def iteration(self):
