Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiregion Deployments (OSS integration) #8184

Merged
merged 13 commits into from
Jun 17, 2020
Prev Previous commit
Next Next commit
start all but first region deployment in paused state
  • Loading branch information
tgross committed Jun 17, 2020
commit 4d2e61d30bf5b6a8feec12b00bcc958e9d7c3620
2 changes: 1 addition & 1 deletion nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3772,7 +3772,7 @@ func (j *Job) Validate() error {
if j.Priority < JobMinPriority || j.Priority > JobMaxPriority {
mErr.Errors = append(mErr.Errors, fmt.Errorf("Job priority must be between [%d, %d]", JobMinPriority, JobMaxPriority))
}
if len(j.Datacenters) == 0 {
if len(j.Datacenters) == 0 && !j.IsMultiregion() {
mErr.Errors = append(mErr.Errors, errors.New("Missing job datacenters"))
} else {
for _, v := range j.Datacenters {
Expand Down
5 changes: 5 additions & 0 deletions scheduler/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,11 @@ func (a *allocReconciler) computeGroup(group string, all allocSet) bool {
// A previous group may have made the deployment already
if a.deployment == nil {
a.deployment = structs.NewDeployment(a.job)
// only the first region of a multiregion job starts in the
// running state
if a.job.IsMultiregion() && a.job.Region != a.job.Multiregion.Regions[0].Name {
a.deployment.Status = structs.DeploymentStatusPaused
}
a.result.deployment = a.deployment
}

Expand Down