• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2021 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Define a schema for representing container images generated during a build.
6// For a given build target, we map container name to metadata about the image
7// Then, for multiple builds, we map build target to each one's metadata.
8//
9// Joining multiple builds container metadata is simply achieved by using
10// MergeFrom on the individual ContainerMetadata instances.
11//
12// Example metadata:
13//    {
14//      "containers" : {
15//        "amd64-generic" : {
16//          "images" : {
17//            "cros-provision" : {
18//              "repository" : { "hostname" : "gcr.io", "project" : "chromeos-bot" },
19//              "name"       : "cros-provision",
20//              "digest"     : "sha256:3e36d3622f5adad01080cc2120bb72c0714ecec6118eb9523586410b7435ae80",
21//              "tags" : [
22//                 "8835841547076258945",
23//                 "amd64-generic-release.R96-1.2.3"
24//              ]
25//            }
26//          }
27//        }
28//    }
29//
30
31syntax = "proto3";
32
33package chromiumos.build.api;
34
35option go_package = "go.chromium.org/chromiumos/config/go/build/api";
36
37message GcrRepository {
38  string hostname = 1; // Hostname without protocol (eg: gcr.io)
39  string project  = 2; // Project name (eg: chromeos-bot)
40}
41
42message ContainerImageInfo {
43  GcrRepository repository = 1; // repository images are stored in
44  string        name       = 2; // name of the image (eg: cros-provision)
45  string        digest     = 3; // docker provided hash of the image
46  repeated string tags     = 4; // list of tags attached to image
47}
48
49// Map from container name (canonically lowercase) to its metadata
50message ContainerImageMap {
51  map<string, ContainerImageInfo> images = 1;
52}
53
54// Map from a string identifier to container metadata.
55//   For build we'll map the build target to container metadata for it
56//   For provisioning, we'll map from specific boards to metadata
57message ContainerMetadata {
58  map<string, ContainerImageMap> containers = 1;
59}
60