go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/swarming/internal/remoteworkers/worker.proto (about) 1 syntax = "proto3"; 2 3 package google.devtools.remoteworkers.v1test2; 4 5 import "google/protobuf/any.proto"; 6 7 option csharp_namespace = "Google.DevTools.RemoteWorkers.V1Test2"; 8 option go_package = "go.chromium.org/luci/swarming/internal/remoteworkers"; 9 option java_multiple_files = true; 10 option java_outer_classname = "RemoteWorkersWorker"; 11 option java_package = "com.google.devtools.remoteworkers.v1test2"; 12 option objc_class_prefix = "RW"; 13 14 // Describes a worker, which is a list of one or more devices and the 15 // connections between them. A device could be a computer, a phone, or even an 16 // accelerator like a GPU; it's up to the farm administrator to decide how to 17 // model their farm. For example, if a farm only has one type of GPU, the GPU 18 // could be modelled as a "has_gpu" property on its host computer; if it has 19 // many subproperties itself, it might be better to model it as a separate 20 // device. 21 // 22 // The first device in the worker is the "primary device" - that is, the device 23 // running a bot and which is responsible for actually executing commands. All 24 // other devices are considered to be attached devices, and must be controllable 25 // by the primary device. 26 // 27 // This message (and all its submessages) can be used in two contexts: 28 // 29 // * Status: sent by the bot to report the current capabilities of the device to 30 // allow reservation matching. 31 // * Request: sent by a client to request a device with certain capabilities in 32 // a reservation. 33 // 34 // Several of the fields in this message have different semantics depending on 35 // which of which of these contexts it is used. These semantics are described 36 // below. 37 // 38 // Several messages in Worker and its submessages have the concept of keys and 39 // values, such as `Worker.Property` and `Device.Property`. All keys are simple 40 // strings, but certain keys are "standard" keys and should be broadly supported 41 // across farms and implementations; these are listed below each relevant 42 // message. Bot implementations or farm admins may add *additional* keys, but 43 // these SHOULD all begin with an underscore so they do not conflict with 44 // standard keys that may be added in the future. 45 // 46 // Keys are not context sensitive. 47 // 48 // See http://goo.gl/NurY8g for more information on the Worker message. 49 message Worker { 50 // A list of devices; the first device is the primary device. See the `Device` 51 // message for more information. 52 repeated Device devices = 1; 53 54 // A global property; see the `properties` field for more information. 55 message Property { 56 // For general information on keys, see the documentation to `Worker`. 57 // 58 // The current set of standard keys are: 59 // 60 // * pool: different workers can be reserved for different purposes. For 61 // example, an admin might want to segregate long-running integration tests 62 // from short-running unit tests, so unit tests will always get some 63 // throughput. To support this, the server can assign different values for 64 // `pool` (such as "itest" and "utest") to different workers, and then have 65 // jobs request workers from those pools. 66 string key = 1; 67 68 // The property's value. 69 string value = 2; 70 } 71 72 // A worker may contain "global" properties. For example, certain machines 73 // might be reserved for certain types of jobs, like short-running compilation 74 // versus long-running integration tests. This property is known as a "pool" 75 // and is not related to any one device within the worker; rather, it applies 76 // to the worker as a whole. 77 // 78 // The behaviour of repeated keys is identical to that of Device.Property. 79 repeated Property properties = 2; 80 81 // A configuration request or report; see the `configs` field for more 82 // information. 83 message Config { 84 // For general information on keys, see the documentation to `Worker`. 85 // 86 // The current set of standard keys are: 87 // 88 // * DockerImage: the image of the container. When being reported by the 89 // bot, the empty value should always be included if the bot is able to pull 90 // its own images; the bot may optionally *also* report images that are 91 // present in its cache. When being requested in a lease, the value is the 92 // URI of the image (eg `gcr.io/user/image@sha256:hash`). 93 string key = 1; 94 95 // The configuration's value. 96 string value = 2; 97 } 98 99 // Bots can be configured in certain ways when accepting leases. For example, 100 // many leases are executed inside a Docker container. To support this, the 101 // bot needs to be able to report that it has Docker installed (and knows how 102 // to execute something inside a container), and the task submitter needs to 103 // specify which image should be used to start the container. Similarly, a 104 // lease may be able to run as one of several users on the worker; in such 105 // cases, the bot needs to report what users are available, and the submitter 106 // needs to choose one. 107 // 108 // Therefore, when this message is reported by the bot to the service, each 109 // key represents a *type* of configuration that the bot knows how to set, 110 // while each *value* represents a legal value for that configuration (the 111 // empty string is interpreted as a wildcard, such as for Docker images). 112 // When this message is sent by the server to the bot in the context of a 113 // lease, it represents a command to the bot to apply the setting. Keys may 114 // be repeated during reporting but not in a lease. 115 repeated Config configs = 3; 116 117 // Implementation-dependent metadata about the worker. Both servers and bots 118 // may define messages which can be encoded here; bots are free to provide 119 // metadata in multiple formats, and servers are free to choose one or more 120 // of the values to process and ignore others. In particular, it is *not* 121 // considered an error for the bot to provide the server with a field that it 122 // doesn't know about. 123 repeated google.protobuf.Any metadata = 4; 124 } 125 126 // Any device, including computers, phones, accelerators (e.g. GPUs), etc. All 127 // names must be unique. 128 message Device { 129 // The handle can be thought of as the "name" of the device, and must be 130 // unique within a Worker. 131 // 132 // In the Status context, the handle should be some human-understandable name, 133 // perhaps corresponding to a label physically written on the device to make 134 // it easy to locate. In the Request context, the name should be the 135 // *logical* name expected by the task. The bot is responsible for mapping the 136 // logical name expected by the task to a machine-readable name that the task 137 // can actually use, such as a USB address. The method by which this mapping 138 // is communicated to the task is not covered in this API. 139 string handle = 1; 140 141 // A device property; see `properties` for more information. 142 message Property { 143 // For general information on keys, see the documentation to `Worker`. 144 // 145 // The current set of standard keys are: 146 // 147 // * os: a human-readable description of the OS. Examples include `linux`, 148 // `ubuntu` and `ubuntu 14.04` (note that a bot may advertise itself as more 149 // than one). This will be replaced in the future by more well-structured 150 // keys and values to represent OS variants. 151 // 152 // * has-docker: "true" if the bot has Docker installed. This will be 153 // replaced in the future by a more structured message for Docker support. 154 string key = 1; 155 156 // The property's value. 157 string value = 2; 158 } 159 160 // Properties of this device that don't change based on the tasks that are 161 // running on it, e.g. OS, CPU architecture, etc. 162 // 163 // Keys may be repeated, and have the following interpretation: 164 // 165 // * Status context: the device can support *any* the listed values. For 166 // example, an "ISA" property might include "x86", "x86-64" and "sse4". 167 // 168 // * Request context: the device *must* support *all* of the listed values. 169 repeated Property properties = 2; 170 }