blob: 23493fcfe3d5365aac23523821f005a1bce7f696 [file] [log] [blame]
syntax = "proto3";
package chromite.api;
option go_package = "go.chromium.org/chromiumos/infra/proto/go/chromite/api";
import "chromite/api/build_api.proto";
import "chromite/api/sysroot.proto";
import "chromiumos/common.proto";
import "chromiumos/metrics.proto";
// Image argument - encapsulate data about an image.
message Image {
// Path to the image file.
string path = 1;
// The image type.
chromiumos.ImageType type = 2;
// The build target used to create the image.
chromiumos.BuildTarget build_target = 3;
}
// The image test arguments.
message CreateImageRequest {
// Required.
// The build target whose image is being built.
chromiumos.BuildTarget build_target = 1;
// The types of images to build, defaults to building base image.
// Note: Building either of the VM image types will also force the
// corresponding regular image to be built. Only one VM image type may be
// built at a time, and will overwrite any previously built VM image if the
// same output directory (version) is used.
repeated chromiumos.ImageType image_types = 2;
// Whether rootfs verification should be disabled (enabled by default).
bool disable_rootfs_verification = 3;
// The image version.
string version = 4;
// Disk layout option. See README.disk_layout and legacy_disk_layout.json in
// src/scripts/build_library.
string disk_layout = 5;
// Used to set the LSB builder path key in /etc/lsb-release. See
// chromite/scripts/cros_set_lsb_release.py.
string builder_path = 6;
// The chroot to use to execute the endpoint.
chromiumos.Chroot chroot = 7;
}
message CreateImageResult {
// Whether it completed successfully.
bool success = 1;
// Images that were built. Will contain no more than one per image type.
repeated Image images = 2;
// Any packages that failed to build. Empty on success.
repeated chromiumos.PackageInfo failed_packages = 3;
// The metric events that occurred during the running of CreateImage.
repeated chromiumos.MetricEvent events = 4;
}
// The image test arguments.
message TestImageRequest {
// The image to be tested.
// Image.path is required.
Image image = 1;
// The build target whose image is being tested.
// BuildTarget.name is required.
chromiumos.BuildTarget build_target = 2;
// Test results options specifications.
message Result {
// Location where the test results should be written.
string directory = 1;
}
// Required.
Result result = 3;
// The chroot to use to execute the endpoint.
chromiumos.Chroot chroot = 4;
}
message TestImageResult {
// Whether all tests passed.
bool success = 1;
}
// Request artifacts to be pushed from the archive bucket to the release bucket,
// using chromite/scripts/pushimage.py.
message PushImageRequest {
// The chroot used to execute the endpoint.
chromiumos.Chroot chroot = 1;
// Whether or not this push image request is a dry run.
bool dryrun = 2;
// GS path of source artifacts to push to the release bucket.
string gs_image_dir = 3;
// Sysroot (board) to generate symbols for.
chromite.api.Sysroot sysroot = 4;
// Board profile in use (e.g. "asan").
// If set, the pushimage script will look for artifacts with this profile
// in their name.
chromiumos.Profile profile = 5;
// If set, only sign specified image types.
repeated chromiumos.ImageType sign_types = 6;
}
// Response from pushimage script.
message PushImageResponse {
}
// The image service.
service ImageService {
option (service_options) = {
module: "image",
service_chroot_assert: INSIDE,
};
// Build an image.
// Example json:
// {
// "build_target": {"name": "reef"},
// }
rpc Create(CreateImageRequest) returns (CreateImageResult);
// Test an image.
// Example json:
// {
// "build_target": {"name": "reef"},
// "image": {"path": "/mnt/host/source/src/build/images/reef/latest"},
// "result": {"directory": "/tmp/image_test_results"}
// }
rpc Test(TestImageRequest) returns (TestImageResult);
// Execute SignerTest for an image.
// Example json:
// {
// "build_target": {"name": "reef"},
// "image": {"path": "/mnt/host/source/src/build/images/reef/latest"},
// "result": {"directory": "/tmp/image_test_results"}
// }
rpc SignerTest(TestImageRequest) returns (TestImageResult);
// Execute PushImage for a script.
// Example json:
// {
// "dryrun": true,
// "gs_image_dir": "gs://chromeos-image-archive/atlas-release/R89-13604.0.0",
// "sysroot": {
// "build_target": {
// "name": "atlas"
// }
// },
// "sign_types": [1, 6]
// }
rpc PushImage(PushImageRequest) returns (PushImageResponse);
}