use of com.google.cloud.aiplatform.v1.Port in project VERDICT by ge-high-assurance.
the class Agree2Vdm method getVdmExpressionFromAgreeExpression.
// method to translate expression in Agree to expression in vdm
private Expression getVdmExpressionFromAgreeExpression(Expr agreeExpr, HashSet<String> dataTypeDecl, HashSet<String> nodeDecl, Model model) {
Expression vdmExpr = new Expression();
if (agreeExpr instanceof IfThenElseExpr) {
IfThenElseExpr ifexpr = (IfThenElseExpr) agreeExpr;
// for vdm model
IfThenElse ifThenElseVal = new IfThenElse();
Expression condExpr = getVdmExpressionFromAgreeExpression(ifexpr.getA(), dataTypeDecl, nodeDecl, model);
ifThenElseVal.setCondition(condExpr);
Expression thenBranchExpr = getVdmExpressionFromAgreeExpression(ifexpr.getB(), dataTypeDecl, nodeDecl, model);
ifThenElseVal.setThenBranch(thenBranchExpr);
Expression elseBranchExpr = getVdmExpressionFromAgreeExpression(ifexpr.getC(), dataTypeDecl, nodeDecl, model);
ifThenElseVal.setElseBranch(elseBranchExpr);
vdmExpr.setConditionalExpression(ifThenElseVal);
} else if (agreeExpr instanceof CallExpr) {
CallExpr callExpr = (CallExpr) agreeExpr;
DoubleDotRef ddref = (DoubleDotRef) callExpr.getRef();
if (ddref.getElm() instanceof NodeDef) {
NodeDef nodeDef = (NodeDef) ddref.getElm();
addNodeDefToTypeDeclarations(nodeDef, dataTypeDecl, nodeDecl, model);
// create node call in vdm model
NodeCall vdmNodeCall = new NodeCall();
// setting node name
vdmNodeCall.setNodeId(nodeDef.getName());
EList<Expr> callExprArgs = callExpr.getArgs();
// below are the parameters passed to the function call
for (Expr callExprArg : callExprArgs) {
Expression argExpr = getVdmExpressionFromAgreeExpression(callExprArg, dataTypeDecl, nodeDecl, model);
// setting node arguments
vdmNodeCall.getArgument().add(argExpr);
}
vdmExpr.setCall(vdmNodeCall);
} else {
System.out.println("Unmapped Typed");
}
} else if (agreeExpr instanceof NamedElmExpr) {
NamedElmExpr nmExpr = (NamedElmExpr) agreeExpr;
vdmExpr.setIdentifier(nmExpr.getElm().getName());
// define corresponding types in the VDM if not already defined
if (nmExpr.getElm() instanceof Arg) {
Arg nmElmArg = (Arg) nmExpr.getElm();
// define corresponding type in the VDM if not already defined
Type argType = nmElmArg.getType();
defineDataTypeDataImplementationTypeInVDM(argType, dataTypeDecl, model);
} else if (nmExpr.getElm() instanceof Port) {
Port nmElmPort = (Port) nmExpr.getElm();
// define corresponding type in the VDM if not already defined
if (nmElmPort instanceof DataPortImpl) {
DataPort nmElmDataPort = (DataPort) nmElmPort;
DataSubcomponentType dSubCompType = nmElmDataPort.getDataFeatureClassifier();
defineDataTypeDataImplementationTypeInVDM(dSubCompType, dataTypeDecl, model);
} else if (nmElmPort instanceof EventDataPortImpl) {
EventDataPort nmElmDataPort = (EventDataPort) nmElmPort;
DataSubcomponentType dSubCompType = nmElmDataPort.getDataFeatureClassifier();
defineDataTypeDataImplementationTypeInVDM(dSubCompType, dataTypeDecl, model);
} else {
if (!(nmElmPort instanceof EventPort)) {
System.out.println("Unresolved Port Type");
}
}
} else if (nmExpr.getElm() instanceof ConstStatement) {
ConstStatement nmElmConstStatement = (ConstStatement) nmExpr.getElm();
String nmElmConstStatementName = nmElmConstStatement.getName();
// add const declaration to VDM if not already defined
if (!dataTypeDecl.contains(nmElmConstStatementName)) {
dataTypeDecl.add(nmElmConstStatementName);
ConstantDeclaration vdmConstDeclaration = new ConstantDeclaration();
vdmConstDeclaration.setName(nmElmConstStatementName);
vdmConstDeclaration.setDefinition(getVdmExpressionFromAgreeExpression(nmElmConstStatement.getExpr(), dataTypeDecl, nodeDecl, model));
vdmConstDeclaration.setDataType(getVdmTypeFromAgreeType(nmElmConstStatement.getType(), dataTypeDecl, model));
LustreProgram lustreProgram = model.getDataflowCode();
lustreProgram.getConstantDeclaration().add(vdmConstDeclaration);
model.setDataflowCode(lustreProgram);
}
} else {
System.out.println("Unresolved/unmapped NamedExprElm: " + nmExpr.getElm().getName());
}
} else if (agreeExpr instanceof SelectionExpr) {
// selection expression corresponds to record projection in VDM
RecordProjection vdmRecordProj = new RecordProjection();
SelectionExpr selExpr = (SelectionExpr) agreeExpr;
if (selExpr.getField() == null) {
System.out.println("Null Selection Expr field: " + selExpr.getField());
} else {
NamedElement field = selExpr.getField();
// set record-projection's reference
if (selExpr.getTarget() != null) {
// target can be NamedElmExpr or a SelectionExpr
vdmRecordProj.setRecordReference(getVdmExpressionFromAgreeExpression(selExpr.getTarget(), dataTypeDecl, nodeDecl, model));
}
// set record-projection's field id
vdmRecordProj.setFieldId(field.getName());
// also set the name of the field's type as the record-projection's record-type
if (field instanceof DataPortImpl) {
DataPort dport = (DataPort) field;
DataSubcomponentType dSubCompType = dport.getDataFeatureClassifier();
defineDataTypeDataImplementationTypeInVDM(dSubCompType, dataTypeDecl, model);
vdmRecordProj.setRecordType(dSubCompType.getName());
} else if (field instanceof DataSubcomponentImpl) {
DataSubcomponent dSubComp = (DataSubcomponent) field;
DataSubcomponentType dSubCompType = dSubComp.getDataSubcomponentType();
defineDataTypeDataImplementationTypeInVDM(dSubCompType, dataTypeDecl, model);
vdmRecordProj.setRecordType(dSubCompType.getName());
} else if (field instanceof ArgImpl) {
Arg arg = (Arg) field;
Type argType = arg.getType();
defineDataTypeDataImplementationTypeInVDM(argType, dataTypeDecl, model);
if (argType instanceof PrimType) {
vdmRecordProj.setRecordType(getDataTypeName(argType));
} else {
System.out.println("Unresolved Arg Type so not setting record-type in record-projection.");
}
} else {
System.out.println("Unresolved type of field.");
}
}
vdmExpr.setRecordProjection(vdmRecordProj);
} else if (agreeExpr instanceof BinaryExpr) {
BinaryExpr binExpr = (BinaryExpr) agreeExpr;
// for vdm
BinaryOperation binoper = new BinaryOperation();
// set left operand
Expression leftOperand = getVdmExpressionFromAgreeExpression(binExpr.getLeft(), dataTypeDecl, nodeDecl, model);
binoper.setLhsOperand(leftOperand);
// set right operand
Expression rightOperand = getVdmExpressionFromAgreeExpression(binExpr.getRight(), dataTypeDecl, nodeDecl, model);
binoper.setRhsOperand(rightOperand);
// set appropriate operator
String operator = binExpr.getOp();
if (operator.equalsIgnoreCase("->")) {
vdmExpr.setArrow(binoper);
} else if (operator.equalsIgnoreCase("=>")) {
vdmExpr.setImplies(binoper);
} else if (operator.equalsIgnoreCase("and")) {
vdmExpr.setAnd(binoper);
} else if (operator.equalsIgnoreCase("or")) {
vdmExpr.setOr(binoper);
} else if (operator.equalsIgnoreCase("=")) {
vdmExpr.setEqual(binoper);
} else if (operator.equalsIgnoreCase(">")) {
vdmExpr.setGreaterThan(binoper);
} else if (operator.equalsIgnoreCase("<")) {
vdmExpr.setLessThan(binoper);
} else if (operator.equalsIgnoreCase(">=")) {
vdmExpr.setGreaterThanOrEqualTo(binoper);
} else if (operator.equalsIgnoreCase("<=")) {
vdmExpr.setLessThanOrEqualTo(binoper);
} else if (operator.equalsIgnoreCase("+")) {
vdmExpr.setPlus(binoper);
} else if (operator.equalsIgnoreCase("-")) {
vdmExpr.setMinus(binoper);
} else if (operator.equalsIgnoreCase("!=") || operator.equalsIgnoreCase("<>")) {
vdmExpr.setNotEqual(binoper);
} else if (operator.equalsIgnoreCase("/")) {
vdmExpr.setDiv(binoper);
} else if (operator.equalsIgnoreCase("*")) {
vdmExpr.setTimes(binoper);
} else {
System.out.println("Unmapped binary operator: " + operator);
}
} else if (agreeExpr instanceof UnaryExpr) {
UnaryExpr unExpr = (UnaryExpr) agreeExpr;
Expression singleOperand = getVdmExpressionFromAgreeExpression(unExpr.getExpr(), dataTypeDecl, nodeDecl, model);
String operator = unExpr.getOp();
if (operator.equalsIgnoreCase("this")) {
vdmExpr.setCurrent(singleOperand);
} else if (operator.equalsIgnoreCase("not")) {
vdmExpr.setNot(singleOperand);
} else if (operator.equalsIgnoreCase("-")) {
vdmExpr.setNegative(singleOperand);
} else {
System.out.println("Unmapped unary operator.");
}
} else if (agreeExpr instanceof BoolLitExpr) {
BoolLitExpr boolExpr = (BoolLitExpr) agreeExpr;
vdmExpr.setBoolLiteral(boolExpr.getVal().getValue());
} else if (agreeExpr instanceof EnumLitExpr) {
EnumLitExpr enumExpr = (EnumLitExpr) agreeExpr;
// check if elm is DataImplementationImpl or DataTypeImpl -- if yes add definition to type declarations if not already present
DoubleDotRef enumType = enumExpr.getEnumType();
if (enumType.getElm() instanceof DataTypeImpl) {
org.osate.aadl2.DataType aadlDType = (org.osate.aadl2.DataType) enumType.getElm();
resolveAADLDataType(aadlDType, dataTypeDecl, model);
} else {
System.out.println("Unexpected Elm type for EnumLitExpr");
}
vdmExpr.setIdentifier(enumExpr.getValue());
} else if (agreeExpr instanceof PreExpr) {
PreExpr preExpr = (PreExpr) agreeExpr;
Expression expr = getVdmExpressionFromAgreeExpression(preExpr.getExpr(), dataTypeDecl, nodeDecl, model);
vdmExpr.setPre(expr);
} else if (agreeExpr instanceof RecordLitExpr) {
RecordLiteral vdmRecordLiteral = new RecordLiteral();
RecordLitExpr recLitExpr = (RecordLitExpr) agreeExpr;
if (recLitExpr.getRecordType() instanceof DoubleDotRef) {
DoubleDotRef recType = (DoubleDotRef) recLitExpr.getRecordType();
if (recType.getElm().getName() != null) {
// check if elm is DataImplementationImpl -- if yes add definition to type declarations if not already present
if (recType.getElm() instanceof DataImplementation) {
org.osate.aadl2.DataImplementation aadlDImpl = (org.osate.aadl2.DataImplementation) recType.getElm();
resolveAADLDataImplementationType(aadlDImpl, dataTypeDecl, model);
} else {
System.out.println("Unexpected Elm type for EnumLitExpr");
}
// set name of the record literal in the vdm model
vdmRecordLiteral.setRecordType(recType.getElm().getName());
// get args and arg-expr and set them as field identifier and value in the vdm model
EList<NamedElement> recLitArgs = recLitExpr.getArgs();
EList<Expr> recLitArgsExpr = recLitExpr.getArgExpr();
// below are the values set to variable
for (int ind = 0; ind < recLitArgs.size(); ind++) {
FieldDefinition fieldDef = new FieldDefinition();
fieldDef.setFieldIdentifier(recLitArgs.get(ind).getName());
fieldDef.setFieldValue(getVdmExpressionFromAgreeExpression(recLitArgsExpr.get(ind), dataTypeDecl, nodeDecl, model));
// set field definitions in the record literal in the vdm model
vdmRecordLiteral.getFieldDefinition().add(fieldDef);
}
vdmExpr.setRecordLiteral(vdmRecordLiteral);
} else {
System.out.println("Unexpected Literal's Record Type that has null named elm.");
}
} else {
System.out.println("Unresolved or unmapped record literal expression.");
}
} else if (agreeExpr instanceof IntLitExpr) {
IntLitExpr intLitExpr = (IntLitExpr) agreeExpr;
BigInteger bigInt = new BigInteger(intLitExpr.getVal());
vdmExpr.setIntLiteral(bigInt);
} else if (agreeExpr instanceof RealLitExpr) {
RealLitExpr realLitExpr = (RealLitExpr) agreeExpr;
BigDecimal bigDecimal = new BigDecimal(realLitExpr.getVal());
vdmExpr.setRealLiteral(bigDecimal);
} else if (agreeExpr instanceof EventExpr) {
EventExpr eventExpr = (EventExpr) agreeExpr;
if (eventExpr.getPort() != null) {
vdmExpr.setEvent(getVdmExpressionFromAgreeExpression(eventExpr.getPort(), dataTypeDecl, nodeDecl, model));
} else {
System.out.println("EventExpr does not have port infornation.");
}
} else if (agreeExpr instanceof RealCast) {
RealCast realCastExpr = (RealCast) agreeExpr;
vdmExpr.setToReal(getVdmExpressionFromAgreeExpression(realCastExpr.getExpr(), dataTypeDecl, nodeDecl, model));
} else {
System.out.println("Unresolved/umapped agree expr" + agreeExpr.toString());
}
return vdmExpr;
}
use of com.google.cloud.aiplatform.v1.Port in project osate2 by osate.
the class CreateConnectionsSwitch method doModeTransitionConnections.
/**
* As we are following connection declarations we need to check whether the
* destination of the connection is named in one of the mode transitions of
* the component instance that is the destination of the connection being
* added
*
* @param parentci
* The component that is the context in which the connections are
* declared
* @param pci
* PortConnectionInstance that is being created
* @param conn
* connection being added to the ConnectionInstance
* @return true if we created a ModetransitionInstance
*/
private boolean doModeTransitionConnections(final ComponentInstance parentci, ConnectionInfo connInfo, Connection conn) {
boolean didTransition = false;
if (!(conn instanceof PortConnection || conn instanceof FeatureGroupConnection)) {
return false;
}
ComponentInstance parent = null;
Context fc = conn.getAllDestinationContext();
Element connContext = null;
if (fc instanceof ComponentImplementation || fc instanceof FeatureGroup) {
// we
// have
// an
// outgoing
// connection
parent = (ComponentInstance) parentci.eContainer();
connContext = parentci.getSubcomponent();
} else if (fc instanceof Subcomponent) {
parent = parentci.findSubcomponentInstance((Subcomponent) fc);
connContext = ((Subcomponent) fc).getAllClassifier();
}
if (parent == null) {
return false;
}
EList<ModeTransitionInstance> mtl = parent.getModeTransitionInstances();
Feature f = (Feature) conn.getAllDestination();
for (ModeTransitionInstance mti : mtl) {
ModeTransition mt = mti.getModeTransition();
Context co = null;
for (ModeTransitionTrigger trigger : mt.getOwnedTriggers()) {
TriggerPort tp = trigger.getTriggerPort();
if (tp instanceof Port) {
Port o = (Port) tp;
co = trigger.getContext();
NamedElement context = co;
if (context instanceof FeatureGroup) {
context = parent.getSubcomponent().getAllClassifier();
}
if (f == o && context == connContext) {
final ConnectionInstance mtci = addConnectionInstance(parentci.getSystemInstance(), connInfo.convertToModeTransition(), mti);
fillInModes(mtci);
fillInModeTransitions(mtci);
didTransition = true;
}
} else {
// TODO-LW: what if it's a processor port or internal event?
}
}
}
return didTransition;
}
use of com.google.cloud.aiplatform.v1.Port in project osate2 by osate.
the class CreateConnectionsSwitch method doModeTransitionConnections.
// ------------------------------------------------------------------------
// Methods related to mode transition connections
// ------------------------------------------------------------------------
/**
* handles the situation that a mode transition may name an event port in a
* thread (or other leaf component instance) and that port is not the
* destination of a connection instance - it is the start of a connection
* instance
*
* @param ci
* ComponentInstance
* @param fi
* FeatureInstance
* @return true if we created a ModetransitionInstance
*/
private boolean doModeTransitionConnections(ComponentInstance ci, FeatureInstance fi) {
boolean didTransition = false;
if (fi.getCategory() == FeatureCategory.EVENT_PORT) {
Subcomponent sub = ci.getSubcomponent();
Feature f = fi.getFeature();
for (ModeTransitionInstance mti : ci.getContainingComponentInstance().getModeTransitionInstances()) {
for (ModeTransitionTrigger trigger : mti.getModeTransition().getOwnedTriggers()) {
TriggerPort tp = trigger.getTriggerPort();
if (tp instanceof Port) {
Port p = (Port) tp;
Context c = trigger.getContext();
if (f == p && c == sub) {
addConnectionInstance(ci.getSystemInstance(), ConnectionInfo.newModeTransition(fi), mti);
didTransition = true;
}
} else {
// TODO-LW: what if it's a processor port or internal
// event?
}
}
}
}
return didTransition;
}
use of com.google.cloud.aiplatform.v1.Port in project java-aiplatform by googleapis.
the class GetModelSample method getModelSample.
static void getModelSample(String project, String modelId) throws IOException {
ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
String location = "us-central1";
ModelName modelName = ModelName.of(project, location, modelId);
Model modelResponse = modelServiceClient.getModel(modelName);
System.out.println("Get Model response");
System.out.format("\tName: %s\n", modelResponse.getName());
System.out.format("\tDisplay Name: %s\n", modelResponse.getDisplayName());
System.out.format("\tDescription: %s\n", modelResponse.getDescription());
System.out.format("\tMetadata Schema Uri: %s\n", modelResponse.getMetadataSchemaUri());
System.out.format("\tMetadata: %s\n", modelResponse.getMetadata());
System.out.format("\tTraining Pipeline: %s\n", modelResponse.getTrainingPipeline());
System.out.format("\tArtifact Uri: %s\n", modelResponse.getArtifactUri());
System.out.format("\tSupported Deployment Resources Types: %s\n", modelResponse.getSupportedDeploymentResourcesTypesList());
System.out.format("\tSupported Input Storage Formats: %s\n", modelResponse.getSupportedInputStorageFormatsList());
System.out.format("\tSupported Output Storage Formats: %s\n", modelResponse.getSupportedOutputStorageFormatsList());
System.out.format("\tCreate Time: %s\n", modelResponse.getCreateTime());
System.out.format("\tUpdate Time: %s\n", modelResponse.getUpdateTime());
System.out.format("\tLabels: %s\n", modelResponse.getLabelsMap());
PredictSchemata predictSchemata = modelResponse.getPredictSchemata();
System.out.println("\tPredict Schemata");
System.out.format("\t\tInstance Schema Uri: %s\n", predictSchemata.getInstanceSchemaUri());
System.out.format("\t\tParameters Schema Uri: %s\n", predictSchemata.getParametersSchemaUri());
System.out.format("\t\tPrediction Schema Uri: %s\n", predictSchemata.getPredictionSchemaUri());
for (ExportFormat exportFormat : modelResponse.getSupportedExportFormatsList()) {
System.out.println("\tSupported Export Format");
System.out.format("\t\tId: %s\n", exportFormat.getId());
}
ModelContainerSpec containerSpec = modelResponse.getContainerSpec();
System.out.println("\tContainer Spec");
System.out.format("\t\tImage Uri: %s\n", containerSpec.getImageUri());
System.out.format("\t\tCommand: %s\n", containerSpec.getCommandList());
System.out.format("\t\tArgs: %s\n", containerSpec.getArgsList());
System.out.format("\t\tPredict Route: %s\n", containerSpec.getPredictRoute());
System.out.format("\t\tHealth Route: %s\n", containerSpec.getHealthRoute());
for (EnvVar envVar : containerSpec.getEnvList()) {
System.out.println("\t\tEnv");
System.out.format("\t\t\tName: %s\n", envVar.getName());
System.out.format("\t\t\tValue: %s\n", envVar.getValue());
}
for (Port port : containerSpec.getPortsList()) {
System.out.println("\t\tPort");
System.out.format("\t\t\tContainer Port: %s\n", port.getContainerPort());
}
for (DeployedModelRef deployedModelRef : modelResponse.getDeployedModelsList()) {
System.out.println("\tDeployed Model");
System.out.format("\t\tEndpoint: %s\n", deployedModelRef.getEndpoint());
System.out.format("\t\tDeployed Model Id: %s\n", deployedModelRef.getDeployedModelId());
}
}
}
use of com.google.cloud.aiplatform.v1.Port in project java-aiplatform by googleapis.
the class GetTrainingPipelineSample method getTrainingPipeline.
static void getTrainingPipeline(String project, String trainingPipelineId) throws IOException {
PipelineServiceSettings pipelineServiceSettings = PipelineServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create(pipelineServiceSettings)) {
String location = "us-central1";
TrainingPipelineName trainingPipelineName = TrainingPipelineName.of(project, location, trainingPipelineId);
TrainingPipeline trainingPipelineResponse = pipelineServiceClient.getTrainingPipeline(trainingPipelineName);
System.out.println("Get Training Pipeline Response");
System.out.format("\tName: %s\n", trainingPipelineResponse.getName());
System.out.format("\tDisplay Name: %s\n", trainingPipelineResponse.getDisplayName());
System.out.format("\tTraining Task Definition: %s\n", trainingPipelineResponse.getTrainingTaskDefinition());
System.out.format("\tTraining Task Inputs: %s\n", trainingPipelineResponse.getTrainingTaskInputs());
System.out.format("\tTraining Task Metadata: %s\n", trainingPipelineResponse.getTrainingTaskMetadata());
System.out.format("\tState: %s\n", trainingPipelineResponse.getState());
System.out.format("\tCreate Time: %s\n", trainingPipelineResponse.getCreateTime());
System.out.format("\tStart Time: %s\n", trainingPipelineResponse.getStartTime());
System.out.format("\tEnd Time: %s\n", trainingPipelineResponse.getEndTime());
System.out.format("\tUpdate Time: %s\n", trainingPipelineResponse.getUpdateTime());
System.out.format("\tLabels: %s\n", trainingPipelineResponse.getLabelsMap());
InputDataConfig inputDataConfig = trainingPipelineResponse.getInputDataConfig();
System.out.println("\tInput Data Config");
System.out.format("\t\tDataset Id: %s\n", inputDataConfig.getDatasetId());
System.out.format("\t\tAnnotations Filter: %s\n", inputDataConfig.getAnnotationsFilter());
FractionSplit fractionSplit = inputDataConfig.getFractionSplit();
System.out.println("\t\tFraction Split");
System.out.format("\t\t\tTraining Fraction: %s\n", fractionSplit.getTrainingFraction());
System.out.format("\t\t\tValidation Fraction: %s\n", fractionSplit.getValidationFraction());
System.out.format("\t\t\tTest Fraction: %s\n", fractionSplit.getTestFraction());
FilterSplit filterSplit = inputDataConfig.getFilterSplit();
System.out.println("\t\tFilter Split");
System.out.format("\t\t\tTraining Filter: %s\n", filterSplit.getTrainingFilter());
System.out.format("\t\t\tValidation Filter: %s\n", filterSplit.getValidationFilter());
System.out.format("\t\t\tTest Filter: %s\n", filterSplit.getTestFilter());
PredefinedSplit predefinedSplit = inputDataConfig.getPredefinedSplit();
System.out.println("\t\tPredefined Split");
System.out.format("\t\t\tKey: %s\n", predefinedSplit.getKey());
TimestampSplit timestampSplit = inputDataConfig.getTimestampSplit();
System.out.println("\t\tTimestamp Split");
System.out.format("\t\t\tTraining Fraction: %s\n", timestampSplit.getTrainingFraction());
System.out.format("\t\t\tTest Fraction: %s\n", timestampSplit.getTestFraction());
System.out.format("\t\t\tValidation Fraction: %s\n", timestampSplit.getValidationFraction());
System.out.format("\t\t\tKey: %s\n", timestampSplit.getKey());
Model modelResponse = trainingPipelineResponse.getModelToUpload();
System.out.println("\t\tModel to upload");
System.out.format("\t\tName: %s\n", modelResponse.getName());
System.out.format("\t\tDisplay Name: %s\n", modelResponse.getDisplayName());
System.out.format("\t\tDescription: %s\n", modelResponse.getDescription());
System.out.format("\t\tMetadata Schema Uri: %s\n", modelResponse.getMetadataSchemaUri());
System.out.format("\t\tMeta Data: %s\n", modelResponse.getMetadata());
System.out.format("\t\tTraining Pipeline: %s\n", modelResponse.getTrainingPipeline());
System.out.format("\t\tArtifact Uri: %s\n", modelResponse.getArtifactUri());
System.out.format("\t\tSupported Deployment Resources Types: %s\n", modelResponse.getSupportedDeploymentResourcesTypesList().toString());
System.out.format("\t\tSupported Input Storage Formats: %s\n", modelResponse.getSupportedInputStorageFormatsList().toString());
System.out.format("\t\tSupported Output Storage Formats: %s\n", modelResponse.getSupportedOutputStorageFormatsList().toString());
System.out.format("\t\tCreate Time: %s\n", modelResponse.getCreateTime());
System.out.format("\t\tUpdate Time: %s\n", modelResponse.getUpdateTime());
System.out.format("\t\tLabels: %s\n", modelResponse.getLabelsMap());
PredictSchemata predictSchemata = modelResponse.getPredictSchemata();
System.out.println("\tPredict Schemata");
System.out.format("\t\tInstance Schema Uri: %s\n", predictSchemata.getInstanceSchemaUri());
System.out.format("\t\tParameters Schema Uri: %s\n", predictSchemata.getParametersSchemaUri());
System.out.format("\t\tPrediction Schema Uri: %s\n", predictSchemata.getPredictionSchemaUri());
for (Model.ExportFormat supportedExportFormat : modelResponse.getSupportedExportFormatsList()) {
System.out.println("\tSupported Export Format");
System.out.format("\t\tId: %s\n", supportedExportFormat.getId());
}
ModelContainerSpec containerSpec = modelResponse.getContainerSpec();
System.out.println("\tContainer Spec");
System.out.format("\t\tImage Uri: %s\n", containerSpec.getImageUri());
System.out.format("\t\tCommand: %s\n", containerSpec.getCommandList());
System.out.format("\t\tArgs: %s\n", containerSpec.getArgsList());
System.out.format("\t\tPredict Route: %s\n", containerSpec.getPredictRoute());
System.out.format("\t\tHealth Route: %s\n", containerSpec.getHealthRoute());
for (EnvVar envVar : containerSpec.getEnvList()) {
System.out.println("\t\tEnv");
System.out.format("\t\t\tName: %s\n", envVar.getName());
System.out.format("\t\t\tValue: %s\n", envVar.getValue());
}
for (Port port : containerSpec.getPortsList()) {
System.out.println("\t\tPort");
System.out.format("\t\t\tContainer Port: %s\n", port.getContainerPort());
}
for (DeployedModelRef deployedModelRef : modelResponse.getDeployedModelsList()) {
System.out.println("\tDeployed Model");
System.out.format("\t\tEndpoint: %s\n", deployedModelRef.getEndpoint());
System.out.format("\t\tDeployed Model Id: %s\n", deployedModelRef.getDeployedModelId());
}
Status status = trainingPipelineResponse.getError();
System.out.println("\tError");
System.out.format("\t\tCode: %s\n", status.getCode());
System.out.format("\t\tMessage: %s\n", status.getMessage());
}
}
Aggregations