Serge Bazanski | efdb6e9 | 2020-07-13 17:19:27 +0200 | [diff] [blame] | 1 | // Copyright 2020 The Monogon Project Authors. |
| 2 | // |
| 3 | // SPDX-License-Identifier: Apache-2.0 |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain a copy of the License at |
| 8 | // |
| 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | // |
| 11 | // Unless required by applicable law or agreed to in writing, software |
| 12 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
| 16 | |
| 17 | syntax = "proto3"; |
Serge Bazanski | 662b5b3 | 2020-12-21 13:49:00 +0100 | [diff] [blame] | 18 | package metropolis.proto.api; |
Serge Bazanski | 31370b0 | 2021-01-07 16:31:14 +0100 | [diff] [blame] | 19 | option go_package = "source.monogon.dev/metropolis/proto/api"; |
Serge Bazanski | efdb6e9 | 2020-07-13 17:19:27 +0200 | [diff] [blame] | 20 | |
Mateusz Zalega | cf92f40 | 2022-07-08 15:08:48 +0200 | [diff] [blame] | 21 | import "google/protobuf/timestamp.proto"; |
Serge Bazanski | b91938f | 2023-03-29 14:31:22 +0200 | [diff] [blame] | 22 | import "metropolis/proto/api/management.proto"; |
Mateusz Zalega | cf92f40 | 2022-07-08 15:08:48 +0200 | [diff] [blame] | 23 | |
Serge Bazanski | 662b5b3 | 2020-12-21 13:49:00 +0100 | [diff] [blame] | 24 | // NodeDebugService exposes debug and testing endpoints that allow introspection into a running Metropolis node. |
Serge Bazanski | 77cb6c5 | 2020-12-19 00:09:22 +0100 | [diff] [blame] | 25 | // It is not authenticated and will be disabled in production. It is currently consumed by metropolis/cli/dbg and |
| 26 | // by tests. |
Serge Bazanski | efdb6e9 | 2020-07-13 17:19:27 +0200 | [diff] [blame] | 27 | service NodeDebugService { |
| 28 | // GetDebugKubeconfig issues kubeconfigs with arbitrary identities and groups for debugging |
| 29 | rpc GetDebugKubeconfig(GetDebugKubeconfigRequest) returns (GetDebugKubeconfigResponse); |
Serge Bazanski | b027218 | 2020-11-02 18:39:44 +0100 | [diff] [blame] | 30 | |
Serge Bazanski | da11486 | 2023-03-29 17:46:42 +0200 | [diff] [blame] | 31 | // A reimplementation of metropolis.api.NodeManagement.Logs that's available |
| 32 | // before the node starts up the management service. |
Serge Bazanski | b027218 | 2020-11-02 18:39:44 +0100 | [diff] [blame] | 33 | rpc GetLogs(GetLogsRequest) returns (stream GetLogsResponse); |
Lorenz Brun | 09c275b | 2021-03-30 12:47:09 +0200 | [diff] [blame] | 34 | |
| 35 | // Trace enables tracing of Metropolis using the Linux ftrace infrastructure. |
| 36 | rpc Trace(TraceRequest) returns (stream TraceEvent); |
Lorenz Brun | 9d6c4c7 | 2021-07-20 21:16:27 +0200 | [diff] [blame] | 37 | |
| 38 | // LoadImage loads an uncompressed tarball containing a Docker v1.1, v1.2 or OCI v1 image into the local |
| 39 | // containerd image store. The client streams the tarball in arbitrary-sized chunks and closes the sending side |
| 40 | // once it has sent the entire image. The server then either returns an empty response if successful or a gRPC error. |
| 41 | rpc LoadImage(stream ImagePart) returns (LoadImageResponse); |
Serge Bazanski | efdb6e9 | 2020-07-13 17:19:27 +0200 | [diff] [blame] | 42 | } |
| 43 | |
Lorenz Brun | 9d6c4c7 | 2021-07-20 21:16:27 +0200 | [diff] [blame] | 44 | message ImagePart { |
| 45 | bytes data_part = 1; |
| 46 | } |
| 47 | |
| 48 | message LoadImageResponse { |
| 49 | } |
Serge Bazanski | efdb6e9 | 2020-07-13 17:19:27 +0200 | [diff] [blame] | 50 | |
| 51 | message GetDebugKubeconfigRequest { |
| 52 | string id = 1; // Kubernetes identity (user) |
| 53 | repeated string groups = 2; // Kubernetes groups |
| 54 | } |
| 55 | |
| 56 | message GetDebugKubeconfigResponse { |
| 57 | string debug_kubeconfig = 1; |
| 58 | } |
| 59 | |
Lorenz Brun | 09c275b | 2021-03-30 12:47:09 +0200 | [diff] [blame] | 60 | message TraceRequest { |
| 61 | // Name of the tracer to use. Defined in https://www.kernel.org/doc/html/latest/trace/ftrace.html#the-tracers. |
| 62 | // Useful ones enabled in Metropolis: function_graph, function. |
| 63 | // Gets reset to nop automatically after the stream is terminated. |
| 64 | string tracer = 1; |
| 65 | |
| 66 | // List of functions to trace. Accepts wildcards using the '*' character. If left empty traces all functions. |
| 67 | repeated string function_filter = 2; |
| 68 | |
| 69 | // List of functions and their descendants to trace with the function_graph tracer. |
| 70 | repeated string graph_function_filter = 3; |
| 71 | } |
| 72 | |
| 73 | message TraceEvent { |
| 74 | // Currently we do not parse the event data and just return what the kernel outputs, line-by-line. |
| 75 | string raw_line = 1; |
Mateusz Zalega | cf92f40 | 2022-07-08 15:08:48 +0200 | [diff] [blame] | 76 | } |