Skip to content

Commit eb80d1c

Browse files
Added formulation support and test cases
Signed-off-by: Steve Springett <steve@springett.us>
1 parent 52104c3 commit eb80d1c

6 files changed

Lines changed: 3577 additions & 23 deletions

File tree

schema/bom-1.5.proto

Lines changed: 325 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ message Bom {
3737
repeated Annotation annotations = 11;
3838
// Specifies optional, custom, properties
3939
repeated Property properties = 12;
40+
// Describes how a component or service was manufactured or deployed. This is achieved through the use of formulas, workflows, tasks, and steps, which declare the precise steps to reproduce along with the observed formulas describing the steps which transpired in the manufacturing process.
41+
repeated Formula formulation = 13;
4042
}
4143

4244
enum Classification {
@@ -245,6 +247,14 @@ enum ExternalReferenceType {
245247
EXTERNAL_REFERENCE_TYPE_CODIFIED_INFRASTRUCTURE = 29;
246248
// A model card describes the intended uses of a machine learning model, potential limitations, biases, ethical considerations, training parameters, datasets used to train the model, performance metrics, and other relevant data useful for ML transparency.
247249
EXTERNAL_REFERENCE_TYPE_MODEL_CARD = 30;
250+
// TODO
251+
EXTERNAL_REFERENCE_TYPE_LOG = 31;
252+
// TODO
253+
EXTERNAL_REFERENCE_TYPE_CONFIGURATION = 32;
254+
// TODO
255+
EXTERNAL_REFERENCE_TYPE_EVIDENCE = 33;
256+
// TODO
257+
EXTERNAL_REFERENCE_TYPE_FORMULATION = 34;
248258
}
249259

250260
enum HashAlg {
@@ -1088,8 +1098,10 @@ enum ComponentDataType {
10881098
COMPONENT_DATA_TYPE_CONFIGURATION = 1;
10891099
// A collection of data.
10901100
COMPONENT_DATA_TYPE_DATASET = 2;
1101+
// Data that can be used to create new instances of what the definition defines.
1102+
COMPONENT_DATA_TYPE_DEFINITION = 3;
10911103
// Any other type of data that does not fit into existing definitions.
1092-
COMPONENT_DATA_TYPE_OTHER = 3;
1104+
COMPONENT_DATA_TYPE_OTHER = 4;
10931105
}
10941106

10951107
message GraphicsCollection {
@@ -1104,5 +1116,316 @@ message GraphicsCollection {
11041116
// The graphic (vector or raster). Base64 encoding MUST be specified for binary images.
11051117
optional AttachedText image = 2;
11061118
}
1119+
}
1120+
1121+
// Describes workflows and resources that captures rules and other aspects of how the associated BOM component or service was formed.
1122+
message Formula {
1123+
// BOM unique reference to the resource.
1124+
optional string bom_ref = 1;
1125+
// Transient components that are used in tasks that constitute one or more of this formula's workflows
1126+
repeated Component components = 2;
1127+
// Transient services that are used in tasks that constitute one or more of this formula's workflows
1128+
repeated Service services = 3;
1129+
// List of workflows that can be declared to accomplish specific orchestrated goals and independently triggered.
1130+
repeated Workflow workflows = 4;
1131+
// Domain-specific formula properties.
1132+
repeated Property properties = 5;
1133+
}
1134+
1135+
// A specialized orchestration task.
1136+
message Workflow {
1137+
// BOM unique reference to the resource.
1138+
string bom_ref = 1;
1139+
// The unique identifier for the resource instance within its deployment context.
1140+
string uid = 2;
1141+
// The name of the resource instance.
1142+
optional string name = 3;
1143+
// A description of the resource instance.
1144+
optional string description = 4;
1145+
// Domain-specific resource instance properties.
1146+
repeated Property properties = 5;
1147+
// References to component or service resources that are used to realize the resource instance.
1148+
repeated ResourceReferenceChoice resourceReferences = 6;
1149+
// The tasks that comprise the workflow.
1150+
repeated Task tasks = 7;
1151+
// The graph of dependencies between tasks within the workflow.
1152+
repeated Dependency taskDependencies = 8;
1153+
// Indicates the types of activities performed by the set of workflow tasks.
1154+
repeated TaskType taskTypes = 9;
1155+
// The trigger that initiated the task.
1156+
optional Trigger trigger = 10;
1157+
// The sequence of steps for the task.
1158+
repeated Step steps = 11;
1159+
// Represents resources and data brought into a task at runtime by executor or task commands
1160+
repeated InputType inputs = 12;
1161+
// Represents resources and data output from a task at runtime by executor or task commands
1162+
repeated OutputType outputs = 13;
1163+
// The date and time (timestamp) when the task started.
1164+
optional google.protobuf.Timestamp timeStart = 14;
1165+
// The date and time (timestamp) when the task ended.
1166+
optional google.protobuf.Timestamp timeEnd = 15;
1167+
// A set of named filesystem or data resource shareable by workflow tasks.
1168+
repeated Workspace workspaces = 16;
1169+
// A graph of the component runtime topology for workflow's instance.
1170+
repeated Dependency runtimeTopology = 17;
1171+
}
1172+
1173+
// Describes the inputs, sequence of steps and resources used to accomplish a task and its output.
1174+
message Task {
1175+
// BOM unique reference to the resource.
1176+
string bom_ref = 1;
1177+
// The unique identifier for the resource instance within its deployment context.
1178+
string uid = 2;
1179+
// The name of the resource instance.
1180+
optional string name = 3;
1181+
// A description of the resource instance.
1182+
optional string description = 4;
1183+
// Domain-specific task instance properties.
1184+
repeated Property properties = 5;
1185+
// References to component or service resources that are used to realize the resource instance.
1186+
repeated ResourceReferenceChoice resourceReferences = 6;
1187+
// Indicates the types of activities performed by the set of workflow tasks.
1188+
repeated TaskType taskTypes = 7;
1189+
// The trigger that initiated the task.
1190+
optional Trigger trigger = 8;
1191+
// "The sequence of steps for the task.
1192+
repeated Step steps = 9;
1193+
// Represents resources and data brought into a task at runtime by executor or task commands
1194+
repeated InputType inputs = 10;
1195+
// Represents resources and data output from a task at runtime by executor or task commands
1196+
repeated OutputType outputs = 11;
1197+
// The date and time (timestamp) when the task started.
1198+
optional google.protobuf.Timestamp timeStart = 14;
1199+
// The date and time (timestamp) when the task ended.
1200+
optional google.protobuf.Timestamp timeEnd = 15;
1201+
// A set of named filesystem or data resource shareable by workflow tasks.
1202+
repeated Workspace workspaces = 16;
1203+
// A graph of the component runtime topology for task's instance.
1204+
repeated Dependency runtimeTopology = 17;
1205+
}
1206+
1207+
// Executes specific commands or tools in order to accomplish its owning task as part of a sequence.
1208+
message Step {
1209+
// A name for the step.
1210+
optional string name = 1;
1211+
// A description of the step.
1212+
optional string description = 2;
1213+
// Ordered list of commands or directives for the step
1214+
repeated Command commands = 3;
1215+
// Domain-specific step properties.
1216+
repeated Property properties = 4;
1217+
}
1218+
1219+
message Command {
1220+
// A text representation of the executed command.
1221+
optional string executed = 1;
1222+
// Domain-specific command properties.
1223+
repeated Property properties = 2;
1224+
}
1225+
1226+
// A named filesystem or data resource shareable by workflow tasks.
1227+
message Workspace {
1228+
// BOM unique reference to the resource.
1229+
string bom_ref = 1;
1230+
// The unique identifier for the resource instance within its deployment context.
1231+
string uid = 2;
1232+
// The name of the resource instance.
1233+
optional string name = 3;
1234+
// The names for the workspace as referenced by other workflow tasks. Effectively, a name mapping so other tasks can use their own local name in their steps.
1235+
repeated string aliases = 4;
1236+
// A description of the resource instance.
1237+
optional string description = 5;
1238+
// Domain-specific workspace instance properties.
1239+
repeated Property properties = 6;
1240+
// References to component or service resources that are used to realize the resource instance.
1241+
repeated ResourceReferenceChoice resourceReferences = 7;
1242+
// Describes the read-write access control for the workspace relative to the owning resource instance.
1243+
optional AccessMode accessMode = 8;
1244+
// A path to a location on disk where the workspace will be available to the associated task's steps.
1245+
optional string mountPath = 9;
1246+
// The name of a domain-specific data type the workspace represents.
1247+
optional string managedDataType = 10;
1248+
// Identifies the reference to the request for a specific volume type and parameters.
1249+
optional string volumeRequest = 11;
1250+
// Information about the actual volume instance allocated to the workspace.
1251+
optional Volume volume = 12;
1252+
1253+
enum AccessMode {
1254+
ACCESS_MODE_READ_ONLY = 0;
1255+
ACCESS_MODE_READ_WRITE = 1;
1256+
ACCESS_MODE_READ_WRITE_ONCE = 2;
1257+
ACCESS_MODE_WRITE_ONCE = 3;
1258+
ACCESS_MODE_WRITE_ONLY = 4;
1259+
}
1260+
}
1261+
1262+
// An identifiable, logical unit of data storage tied to a physical device.
1263+
message Volume {
1264+
// The unique identifier for the volume instance within its deployment context.
1265+
optional string uid = 1;
1266+
// The name of the volume instance
1267+
optional string name = 2;
1268+
// The volume mode for the volume instance.
1269+
optional VolumeMode mode = 3;
1270+
// The underlying path created from the actual volume.
1271+
optional string path = 4;
1272+
// The allocated size of the volume accessible to the associated workspace. This should include the scalar size as well as IEC standard unit in either decimal or binary form.
1273+
optional string sizeAllocated = 5;
1274+
// Indicates if the volume persists beyond the life of the resource it is associated with.
1275+
optional bool persistent = 6;
1276+
// Indicates if the volume is remotely (i.e., network) attached.
1277+
optional bool remote = 7;
1278+
// Domain-specific volume instance properties.
1279+
repeated Property properties = 8;
1280+
1281+
enum VolumeMode {
1282+
VOLUME_MODE_FILESYSTEM = 0;
1283+
VOLUME_MODE_BLOCK = 1;
1284+
}
1285+
}
1286+
1287+
// Represents a resource that can conditionally activate (or fire) tasks based upon associated events and their data.
1288+
message Trigger {
1289+
// BOM unique reference to the resource.
1290+
string bom_ref = 1;
1291+
// The unique identifier for the resource instance within its deployment context.
1292+
string uid = 2;
1293+
// The name of the resource instance.
1294+
optional string name = 3;
1295+
// A description of the resource instance.
1296+
optional string description = 4;
1297+
// Additional properties of the trigger.
1298+
repeated Property properties = 5;
1299+
// References to component or service resources that are used to realize the resource instance.
1300+
repeated ResourceReferenceChoice resourceReferences = 6;
1301+
// The source type of event which caused the trigger to fire.
1302+
TriggerType type = 7;
1303+
// The event data that caused the associated trigger to activate.
1304+
optional Event event = 8;
1305+
// Conditions
1306+
repeated Condition conditions = 9;
1307+
// The date and time (timestamp) when the trigger was activated.
1308+
optional google.protobuf.Timestamp timeActivated = 10;
1309+
// Represents resources and data brought into a task at runtime by executor or task commands
1310+
repeated InputType inputs = 11;
1311+
// Represents resources and data output from a task at runtime by executor or task commands
1312+
repeated OutputType outputs = 12;
1313+
1314+
enum TriggerType {
1315+
TRIGGER_TYPE_MANUAL = 0;
1316+
TRIGGER_TYPE_API = 1;
1317+
TRIGGER_TYPE_WEBHOOK = 2;
1318+
TRIGGER_TYPE_SCHEDULED = 3;
1319+
}
1320+
}
1321+
1322+
// Represents something that happened that may trigger a response.
1323+
message Event {
1324+
// The unique identifier of the event.
1325+
optional string uid = 1;
1326+
// A description of the event.
1327+
optional string description = 2;
1328+
// The date and time (timestamp) when the event was received.
1329+
optional google.protobuf.Timestamp timeReceived = 3;
1330+
// Encoding of the raw event data.
1331+
optional AttachedText data = 4;
1332+
// References the component or service that was the source of the event
1333+
optional ResourceReferenceChoice source = 5;
1334+
// References the component or service that was the target of the event
1335+
optional ResourceReferenceChoice target = 6;
1336+
// Additional properties of the event.
1337+
repeated Property properties = 7;
1338+
}
1339+
1340+
// Type that represents various input data types and formats.
1341+
message InputType {
1342+
// A references to the component or service that provided the input to the task (e.g., reference to a service with data flow value of `inbound`)
1343+
optional ResourceReferenceChoice source = 1;
1344+
// A reference to the component or service that received or stored the input if not the task itself (e.g., a local, named storage workspace)
1345+
optional ResourceReferenceChoice target = 2;
1346+
// A reference to an independent resource provided as an input to a task by the workflow runtime.
1347+
optional ResourceReferenceChoice resource = 3;
1348+
// Inputs that have the form of parameters with names and values.
1349+
repeated Parameter parameters = 4;
1350+
// Inputs that have the form of parameters with names and values.
1351+
repeated EnvironmentVars environmentVars = 5;
1352+
// Inputs that have the form of data.
1353+
optional AttachedText data = 6;
1354+
// Additional properties of the input data.
1355+
repeated Property properties = 7;
1356+
}
1357+
1358+
message OutputType {
1359+
// Describes the type of data output.
1360+
optional OutputTypeType type = 1;
1361+
// Component or service that generated or provided the output from the task (e.g., a build tool)
1362+
optional ResourceReferenceChoice source = 2;
1363+
// Component or service that received the output from the task (e.g., reference to an artifactory service with data flow value of `outbound`)
1364+
optional ResourceReferenceChoice target = 3;
1365+
// A reference to an independent resource generated as output by the task.
1366+
optional ResourceReferenceChoice resource = 4;
1367+
// Outputs that have the form of data.
1368+
optional AttachedText data = 5;
1369+
// Outputs that have the form of environment variables.
1370+
repeated EnvironmentVars environmentVars = 6;
1371+
// Additional properties of the output data.
1372+
repeated Property properties = 7;
1373+
1374+
enum OutputTypeType {
1375+
OUTPUT_TYPE_ARTIFACT = 0;
1376+
OUTPUT_TYPE_ATTESTATION = 1;
1377+
OUTPUT_TYPE_LOG = 2;
1378+
OUTPUT_TYPE_EVIDENCE = 3;
1379+
OUTPUT_TYPE_METRICS = 4;
1380+
OUTPUT_TYPE_OTHER = 5;
1381+
}
1382+
}
1383+
1384+
message ResourceReferenceChoice {
1385+
oneof choice {
1386+
string ref = 1;
1387+
ExternalReference externalReference = 2;
1388+
}
1389+
}
1390+
1391+
// A condition that was used to determine a trigger should be activated.
1392+
message Condition {
1393+
// Describes the set of conditions which cause the trigger to activate.
1394+
optional string description = 1;
1395+
// The logical expression that was evaluated that determined the trigger should be fired.
1396+
optional string expression = 2;
1397+
// Domain-specific condition instance properties.
1398+
repeated Property properties = 3;
1399+
}
1400+
1401+
enum TaskType {
1402+
TASK_TYPE_COPY = 0;
1403+
TASK_TYPE_CLONE = 1;
1404+
TASK_TYPE_LINT = 2;
1405+
TASK_TYPE_SCAN = 3;
1406+
TASK_TYPE_MERGE = 4;
1407+
TASK_TYPE_BUILD = 5;
1408+
TASK_TYPE_TEST = 6;
1409+
TASK_TYPE_DELIVER = 7;
1410+
TASK_TYPE_DEPLOY = 8;
1411+
TASK_TYPE_RELEASE = 9;
1412+
TASK_TYPE_CLEAN = 10;
1413+
TASK_TYPE_OTHER = 11;
1414+
}
1415+
1416+
// A representation of a functional parameter.
1417+
message Parameter {
1418+
// The name of the parameter.
1419+
optional string name = 1;
1420+
// The value of the parameter.
1421+
optional string value = 2;
1422+
// The data type of the parameter.
1423+
optional string dataType = 3;
1424+
}
11071425

1108-
}
1426+
message EnvironmentVars {
1427+
oneof choice {
1428+
Property property = 1;
1429+
string value = 2;
1430+
}
1431+
}

0 commit comments

Comments
 (0)