diff --git a/cmd/controller/app/job/builder.go b/cmd/controller/app/job/builder.go index b8abf3520..3cb2991e6 100644 --- a/cmd/controller/app/job/builder.go +++ b/cmd/controller/app/job/builder.go @@ -465,10 +465,6 @@ func (b *JobBuilder) isTemplatesConnected(templates map[string]*taskTemplate) er // If no error is thrown during the executiom of this function, then it returns a nil value. } -func (b *JobBuilder) isConverging(dataRoles []string, templates map[string]*taskTemplate) bool { - return true -} - func (b *JobBuilder) postCheck(dataRoles []string, templates map[string]*taskTemplate) error { // This function will evolve as more invariants are defined // At the end of processing templates, the following invariants should be met: diff --git a/cmd/controller/app/job/builder_test.go b/cmd/controller/app/job/builder_test.go index e295229dc..5afbc7faf 100644 --- a/cmd/controller/app/job/builder_test.go +++ b/cmd/controller/app/job/builder_test.go @@ -193,52 +193,52 @@ func TestIsTemplatesConnected(t *testing.T) { builder.schema.Channels[0].Pair = savedPair } -func TestIsConverging(t *testing.T) { - t.Skipf("Skip for now") - - builder := NewJobBuilder(nil, config.JobParams{}) - assert.NotNil(t, builder) - builder.jobSpec = &testJobSpec - - // success case - builder.schema = testSchema - builder.datasets["trainer"][composeGroup(defaultGroup, "uk")] = testDatasets - builder.roleCode = testRoleCode - dataRoles, templates := builder.getTaskTemplates() - res := builder.isConverging(dataRoles, templates) - assert.True(t, res) - - // failure case - testSchema.Channels[1].GroupBy.Type = "tag" - testSchema.Channels[1].GroupBy.Value = []string{ - composeGroup(defaultGroup, "uk"), - composeGroup(defaultGroup, "us"), - } - dataRoles, templates = builder.getTaskTemplates() - res = builder.isConverging(dataRoles, templates) - assert.False(t, res) - // reset the changes - testSchema.Channels[1].GroupBy.Type = "" - testSchema.Channels[1].GroupBy.Value = nil - - // success case - builder.schema = testSchemaWithTwoDataConsumers - builder.datasets["trainer"][composeGroup(defaultGroup, "uk")] = testDatasets - builder.roleCode = testRoleCodeWithTwoDataConsumers - dataRoles, templates = builder.getTaskTemplates() - res = builder.isConverging(dataRoles, templates) - assert.True(t, res) - - // failure case - testSchemaWithTwoDataConsumers.Channels[2].GroupBy.Type = "tag" - testSchemaWithTwoDataConsumers.Channels[2].GroupBy.Value = []string{ - composeGroup(defaultGroup, "uk"), - composeGroup(defaultGroup, "us"), - } - dataRoles, templates = builder.getTaskTemplates() - res = builder.isConverging(dataRoles, templates) - assert.False(t, res) - // reset the changes - testSchemaWithTwoDataConsumers.Channels[2].GroupBy.Type = "" - testSchemaWithTwoDataConsumers.Channels[2].GroupBy.Value = nil -} +// func TestIsConverging(t *testing.T) { +// t.Skipf("Skip for now") + +// builder := NewJobBuilder(nil, config.JobParams{}) +// assert.NotNil(t, builder) +// builder.jobSpec = &testJobSpec + +// // success case +// builder.schema = testSchema +// builder.datasets["trainer"][composeGroup(defaultGroup, "uk")] = testDatasets +// builder.roleCode = testRoleCode +// dataRoles, templates := builder.getTaskTemplates() +// res := builder.isConverging(dataRoles, templates) +// assert.True(t, res) + +// // failure case +// testSchema.Channels[1].GroupBy.Type = "tag" +// testSchema.Channels[1].GroupBy.Value = []string{ +// composeGroup(defaultGroup, "uk"), +// composeGroup(defaultGroup, "us"), +// } +// dataRoles, templates = builder.getTaskTemplates() +// res = builder.isConverging(dataRoles, templates) +// assert.False(t, res) +// // reset the changes +// testSchema.Channels[1].GroupBy.Type = "" +// testSchema.Channels[1].GroupBy.Value = nil + +// // success case +// builder.schema = testSchemaWithTwoDataConsumers +// builder.datasets["trainer"][composeGroup(defaultGroup, "uk")] = testDatasets +// builder.roleCode = testRoleCodeWithTwoDataConsumers +// dataRoles, templates = builder.getTaskTemplates() +// res = builder.isConverging(dataRoles, templates) +// assert.True(t, res) + +// // failure case +// testSchemaWithTwoDataConsumers.Channels[2].GroupBy.Type = "tag" +// testSchemaWithTwoDataConsumers.Channels[2].GroupBy.Value = []string{ +// composeGroup(defaultGroup, "uk"), +// composeGroup(defaultGroup, "us"), +// } +// dataRoles, templates = builder.getTaskTemplates() +// res = builder.isConverging(dataRoles, templates) +// assert.False(t, res) +// // reset the changes +// testSchemaWithTwoDataConsumers.Channels[2].GroupBy.Type = "" +// testSchemaWithTwoDataConsumers.Channels[2].GroupBy.Value = nil +// } diff --git a/cmd/deployer/app/monitor_jobs.go b/cmd/deployer/app/monitor_jobs.go index d9bbac0f4..caa0addce 100644 --- a/cmd/deployer/app/monitor_jobs.go +++ b/cmd/deployer/app/monitor_jobs.go @@ -56,7 +56,7 @@ func (r *resourceHandler) monitorPods() { } r.dplyr.DeleteTaskFromMonitoring(pod.TaskID) - zap.S().Info("task % failed", pod.TaskID) + zap.S().Info("task %s failed; pod status: %s", pod.TaskID, pod.Status.Phase) } }