-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature / Expose job logs in the platform API (#489)
* Move logging into a separate _impl module * Start implementing job logging * Add LogProvider interface, use it to record engine processing logs * Use log provider mechanism to set up trac context and model logs * Fix print job log statement * Handle saving job results at the engine level * Take result spec and save results out of graph processing * Metadata for job results * Validator updates for job results * Update test data to include job result * Validation fixes for jobs submitted as requests to the orchestrator * Fix duplicate registration for job def validator * Fix building result metadata for import model job * Add a test case for job result and log file outputs in run flow e2e * Helper for preallocated IDs * Support results and log files in orch job processor * Support for RESULT and log file outputs in the runtime * Filter search result for outputs of FILE IO model in run model test (we want the model output, not the job log) * Fixes found during testing
- Loading branch information
1 parent
4d703ce
commit 59c6c79
Showing
49 changed files
with
935 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ enum ObjectType { | |
CUSTOM = 6; | ||
STORAGE = 7; | ||
SCHEMA = 8; | ||
RESULT = 9; | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...validation/src/main/java/org/finos/tracdap/common/validation/static_/ResultValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Licensed to the Fintech Open Source Foundation (FINOS) under one or | ||
* more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* FINOS licenses this file to you under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.finos.tracdap.common.validation.static_; | ||
|
||
import com.google.protobuf.Descriptors; | ||
import org.finos.tracdap.common.validation.core.ValidationContext; | ||
import org.finos.tracdap.common.validation.core.ValidationType; | ||
import org.finos.tracdap.common.validation.core.Validator; | ||
import org.finos.tracdap.metadata.*; | ||
|
||
import static org.finos.tracdap.common.validation.core.ValidatorUtils.field; | ||
|
||
|
||
@Validator(type = ValidationType.STATIC) | ||
public class ResultValidator { | ||
|
||
private static final Descriptors.Descriptor RESULT_DEFINITION; | ||
private static final Descriptors.FieldDescriptor RD_JOB_ID; | ||
private static final Descriptors.FieldDescriptor RD_STATUS_CODE; | ||
private static final Descriptors.FieldDescriptor RD_STATUS_MESSAGE; | ||
private static final Descriptors.FieldDescriptor RD_LOG_FILE_ID; | ||
|
||
static { | ||
|
||
RESULT_DEFINITION = ResultDefinition.getDescriptor(); | ||
RD_JOB_ID = field(RESULT_DEFINITION, ResultDefinition.JOBID_FIELD_NUMBER); | ||
RD_STATUS_CODE = field(RESULT_DEFINITION, ResultDefinition.STATUSCODE_FIELD_NUMBER); | ||
RD_STATUS_MESSAGE = field(RESULT_DEFINITION, ResultDefinition.STATUSMESSAGE_FIELD_NUMBER); | ||
RD_LOG_FILE_ID = field(RESULT_DEFINITION, ResultDefinition.LOGFILEID_FIELD_NUMBER); | ||
} | ||
|
||
@Validator | ||
public static ValidationContext job(ResultDefinition msg, ValidationContext ctx) { | ||
|
||
ctx = ctx.push(RD_JOB_ID) | ||
.apply(CommonValidators::required) | ||
.apply(ObjectIdValidator::tagSelector, TagSelector.class) | ||
.apply(ObjectIdValidator::selectorType, TagSelector.class, ObjectType.JOB) | ||
.apply(ObjectIdValidator::fixedObjectVersion, TagSelector.class) | ||
.pop(); | ||
|
||
ctx = ctx.push(RD_STATUS_CODE) | ||
.apply(CommonValidators::required) | ||
.apply(CommonValidators::nonZeroEnum, JobStatusCode.class) | ||
.pop(); | ||
|
||
ctx = ctx.push(RD_STATUS_MESSAGE) | ||
.apply(CommonValidators::optional) | ||
.pop(); | ||
|
||
ctx = ctx.push(RD_LOG_FILE_ID) | ||
.apply(CommonValidators::required) | ||
.apply(ObjectIdValidator::tagSelector, TagSelector.class) | ||
.apply(ObjectIdValidator::selectorType, TagSelector.class, ObjectType.FILE) | ||
.apply(ObjectIdValidator::fixedObjectVersion, TagSelector.class) | ||
.pop(); | ||
|
||
return ctx; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.