Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
802 changes: 400 additions & 402 deletions cmd/ateom-microvm/internal/third_party/kata/agentpb/agent.proto

Large diffs are not rendered by default.

554 changes: 277 additions & 277 deletions cmd/ateom-microvm/internal/third_party/kata/agentpb/oci.proto

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions cmd/ateom-microvm/internal/third_party/kata/agentpb/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,60 @@ option go_package = "github.com/agent-substrate/substrate/cmd/ateom-microvm/inte
package types;

enum IPFamily {
v4 = 0;
v6 = 1;
v4 = 0;
v6 = 1;
}

// FSGroupChangePolicy defines the policy for applying group id ownership change on a mounted volume.
enum FSGroupChangePolicy {
// Always indicates that the volume ownership will always be changed.
Always = 0;
// OnRootMismatch indicates that the volume ownership will be changed only
// when the ownership of the root directory does not match with the expected group id for the volume.
OnRootMismatch = 1;
// Always indicates that the volume ownership will always be changed.
Always = 0;
// OnRootMismatch indicates that the volume ownership will be changed only
// when the ownership of the root directory does not match with the expected group id for the volume.
OnRootMismatch = 1;
}

message IPAddress {
IPFamily family = 1;
string address = 2;
string mask = 3;
IPFamily family = 1;
string address = 2;
string mask = 3;
}

message Interface {
string device = 1;
string name = 2;
repeated IPAddress IPAddresses = 3;
uint64 mtu = 4;
string hwAddr = 5;
string device = 1;
string name = 2;
repeated IPAddress IPAddresses = 3;
uint64 mtu = 4;
string hwAddr = 5;

// Path for the device (see the pci::Path (Rust) and types.PciPath
// (Go) or ccw::Device (Rust) and types.CcwDevice (Go) types for
// format details, depending on architecture)
string devicePath = 6;
// Path for the device (see the pci::Path (Rust) and types.PciPath
// (Go) or ccw::Device (Rust) and types.CcwDevice (Go) types for
// format details, depending on architecture)
string devicePath = 6;

// Type defines the type of interface described by this structure.
// The expected values are the one that are defined by the netlink
// library, regarding each type of link. Here is a non exhaustive
// list: "veth", "macvtap", "vlan", "macvlan", "tap", ...
string type = 7;
uint32 raw_flags = 8;
// Type defines the type of interface described by this structure.
// The expected values are the one that are defined by the netlink
// library, regarding each type of link. Here is a non exhaustive
// list: "veth", "macvtap", "vlan", "macvlan", "tap", ...
string type = 7;
uint32 raw_flags = 8;
}

message Route {
string dest = 1;
string gateway = 2;
string device = 3;
string source = 4;
uint32 scope = 5;
IPFamily family = 6;
uint32 flags = 7;
uint32 mtu = 8;
string dest = 1;
string gateway = 2;
string device = 3;
string source = 4;
uint32 scope = 5;
IPFamily family = 6;
uint32 flags = 7;
uint32 mtu = 8;
}

message ARPNeighbor {
IPAddress toIPAddress = 1;
string device = 2;
string lladdr = 3;
int32 state = 4;
int32 flags = 5;
IPAddress toIPAddress = 1;
string device = 2;
string lladdr = 3;
int32 state = 4;
int32 flags = 5;
}
52 changes: 52 additions & 0 deletions hack/update/proto-fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash

# Copyright 2026 Google LLC
#
# Licensed 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.

set -o errexit -o nounset -o pipefail

ROOT="$(git rev-parse --show-toplevel)"
cd "${ROOT}"

# Find clang-format in the PATH, and exit if not found.
tool="clang-format"
clangfmt="$(which "$tool" 2>/dev/null || true)"
if [[ ! -x "${clangfmt}" ]]; then
echo "Failed to find ${tool}: please make sure it is in your PATH" >&2
exit 1
fi

# Find all top-level directories containing proto files, and run clangfmt on them.
# shellcheck disable=SC2207 # reading array
files=(
$(git ls-files \
-cmo \
--exclude-standard \
-- \
':(glob)**/*.proto' \
':!:vendor/*' \
':!:**/vendor/*' \
':!:LICENSES/*' \
| sort \
| uniq)
)

# Run clang-format on the found files.
#
# Don't reflow long lines, wince those tend to be comments which then require
# re-running the proto generators, which makes "update-all" awkward.
"${clangfmt}" \
-i \
--style="{BasedOnStyle: LLVM, ColumnLimit: 0}" \
"${files[@]}"
22 changes: 22 additions & 0 deletions hack/verify/proto-fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# Copyright 2026 Google LLC
#
# Licensed 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.

set -o errexit -o nounset -o pipefail

ROOT="$(git rev-parse --show-toplevel)"
cd "${ROOT}"

./hack/third_party/kubernetes/verify-generated.sh proto-fmt "$@"
44 changes: 21 additions & 23 deletions internal/proto/ateletpb/atelet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ message RunRequest {
string actor_id = 3;

string actor_template_namespace = 4;
string actor_template_name = 5;
string actor_template_name = 5;

WorkloadSpec spec = 6;

Expand Down Expand Up @@ -69,20 +69,20 @@ message ArchAssets {
// architecture (GOARCH) and then by asset name. atelet's backend code
// interprets the asset names (gVisor expects "runsc").
message SandboxAssets {
string sandbox_class = 1; // e.g. "gvisor"
string sandbox_class = 1; // e.g. "gvisor"
map<string, ArchAssets> assets = 2; // arch -> {name -> file}
}

// WorkloadSpec parallels Pod, but with far fewer configurable fields.
message WorkloadSpec {
repeated Container containers = 1;
string pause_image = 2;
repeated Volume volumes = 3;
repeated Container containers = 1;
string pause_image = 2;
repeated Volume volumes = 3;
}

enum VolumeType {
VOLUME_TYPE_UNSPECIFIED = 0;
VOLUME_TYPE_DURABLE_DIR = 1;
VOLUME_TYPE_UNSPECIFIED = 0;
VOLUME_TYPE_DURABLE_DIR = 1;
}

message DurableDirVolume {
Expand All @@ -93,27 +93,27 @@ message Volume {

VolumeType type = 2;

oneof source{
oneof source {
DurableDirVolume durable_dir = 3;
}
}

message VolumeMount{
message VolumeMount {
string name = 1;
string mount_path = 2;
}

message Container {
string name = 1;
string image = 2;
repeated string command = 3;
repeated EnvEntry env = 4;
Readyz readyz = 5;
string name = 1;
string image = 2;
repeated string command = 3;
repeated EnvEntry env = 4;
Readyz readyz = 5;
repeated VolumeMount volume_mounts = 6;
}

message EnvEntry {
string name = 1;
string name = 1;
string value = 2;
}

Expand All @@ -128,7 +128,7 @@ message HTTPGetAction {
// Path to access on the HTTP server. Empty means "/readyz".
string path = 1;
// TCP port to connect to (1..65535).
int32 port = 2;
int32 port = 2;
}

message RunResponse {
Expand Down Expand Up @@ -158,7 +158,7 @@ enum CheckpointType {
// Should never happen
CHECKPOINT_TYPE_UNSPECIFIED = 0;
// Save snapshot only in local filesystem
CHECKPOINT_TYPE_LOCAL = 1;
CHECKPOINT_TYPE_LOCAL = 1;
// Save snapshot to object storage
CHECKPOINT_TYPE_EXTERNAL = 2;
}
Expand All @@ -182,7 +182,7 @@ message CheckpointRequest {
string actor_id = 3;

string actor_template_namespace = 4;
string actor_template_name = 5;
string actor_template_name = 5;

// Sandbox binary config is not sent on checkpoint: atelet uses the version the
// actor is currently running (recorded with the actor's on-node state at
Expand All @@ -193,7 +193,7 @@ message CheckpointRequest {

// The checkpoint configuration, depending on the type.
oneof config {
LocalCheckpointConfiguration local_config = 8;
LocalCheckpointConfiguration local_config = 8;
ExternalCheckpointConfiguration external_config = 9;
}

Expand All @@ -202,7 +202,6 @@ message CheckpointRequest {
}

message CheckpointResponse {

}

message RestoreRequest {
Expand All @@ -212,7 +211,7 @@ message RestoreRequest {
string actor_id = 3;

string actor_template_namespace = 4;
string actor_template_name = 5;
string actor_template_name = 5;

// Sandbox binary config is not sent on restore: the snapshot is
// self-describing. atelet reads the snapshot manifest to recover the pinned
Expand All @@ -223,7 +222,7 @@ message RestoreRequest {

// The checkpoint configuration, depending on the type.
oneof config {
LocalCheckpointConfiguration local_config = 8;
LocalCheckpointConfiguration local_config = 8;
ExternalCheckpointConfiguration external_config = 9;
}

Expand All @@ -232,5 +231,4 @@ message RestoreRequest {
}

message RestoreResponse {

}
13 changes: 6 additions & 7 deletions internal/proto/ateompb/ateom.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ message RunWorkloadRequest {
string actor_id = 2;

string actor_template_namespace = 3;
string actor_template_name = 4;
string actor_template_name = 4;

string runsc_path = 5;

Expand All @@ -71,8 +71,8 @@ message WorkloadSpec {
}

message Container {
string name = 1;
Readyz readyz = 2;
string name = 1;
Readyz readyz = 2;
repeated string durable_dir_volumes = 3;
}

Expand All @@ -87,7 +87,7 @@ message HTTPGetAction {
// Path to access on the HTTP server. Empty means "/readyz".
string path = 1;
// TCP port to connect to (1..65535).
int32 port = 2;
int32 port = 2;
}

message RunWorkloadResponse {
Expand All @@ -110,7 +110,7 @@ message CheckpointWorkloadRequest {
string actor_id = 2;

string actor_template_namespace = 3;
string actor_template_name = 4;
string actor_template_name = 4;

string runsc_path = 5;

Expand Down Expand Up @@ -146,7 +146,7 @@ message RestoreWorkloadRequest {
string actor_id = 2;

string actor_template_namespace = 3;
string actor_template_name = 4;
string actor_template_name = 4;

string runsc_path = 5;

Expand All @@ -164,5 +164,4 @@ message RestoreWorkloadRequest {
}

message RestoreWorkloadResponse {

}
Loading
Loading