golang.org/x/build@v0.0.0-20240506185731-218518f32b70/internal/gomote/protos/gomote.proto (about)

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  syntax = "proto3";
     6  
     7  package protos;
     8  
     9  option go_package = "golang.org/x/build/internal/gomote/protos";
    10  
    11  // GomoteService can manage the lifecycle of gomote instances and interact with them.
    12  service GomoteService {
    13    // Authenticate provides authentication information without any additional action.
    14    rpc Authenticate (AuthenticateRequest) returns (AuthenticateResponse) {}
    15    // AddBootstrap adds the bootstrap version of Go to the work directory.
    16    rpc AddBootstrap (AddBootstrapRequest) returns (AddBootstrapResponse) {}
    17    // CreateInstance creates a gomote instance.
    18    rpc CreateInstance (CreateInstanceRequest) returns (stream CreateInstanceResponse) {}
    19    // DestroyInstance destroys a gomote instance.
    20    rpc DestroyInstance (DestroyInstanceRequest) returns (DestroyInstanceResponse) {}
    21    // ExecuteCommand executes a command on the gomote instance.
    22    rpc ExecuteCommand (ExecuteCommandRequest) returns (stream ExecuteCommandResponse) {}
    23    // InstanceAlive gives the liveness state of a gomote instance.
    24    rpc InstanceAlive (InstanceAliveRequest) returns (InstanceAliveResponse) {}
    25    // ListDirectory lists the contents of a directory on an gomote instance.
    26    rpc ListDirectory (ListDirectoryRequest) returns (ListDirectoryResponse) {}
    27    // ListInstances lists all of the live gomote instances owned by the caller.
    28    rpc ListInstances (ListInstancesRequest) returns (ListInstancesResponse) {}
    29    // ListSwarmingBuilders lists all of the swarming builders for the project.
    30    rpc ListSwarmingBuilders (ListSwarmingBuildersRequest) returns (ListSwarmingBuildersResponse) {}
    31    // ReadTGZToURL tars and zips a directory which exists on the gomote instance and returns a URL where it can be
    32    // downloaded from.
    33    rpc ReadTGZToURL (ReadTGZToURLRequest) returns (ReadTGZToURLResponse) {}
    34    // RemoveFiles removes files or directories from the gomote instance.
    35    rpc RemoveFiles (RemoveFilesRequest) returns (RemoveFilesResponse) {}
    36    // SignSSHKey signs an SSH public key which can be used to SSH into instances owned by the caller.
    37    rpc SignSSHKey (SignSSHKeyRequest) returns (SignSSHKeyResponse) {}
    38    // UploadFile generates a signed URL and associated fields to be used when uploading the object to GCS. Once uploaded
    39    // the corresponding Write endpoint can be used to send the file to the gomote instance.
    40    rpc UploadFile (UploadFileRequest) returns (UploadFileResponse) {}
    41    // WriteFileFromURL
    42    rpc WriteFileFromURL (WriteFileFromURLRequest) returns (WriteFileFromURLResponse) {}
    43    // WriteTGZFromURL retrieves a tar and zipped file from a URL and expands it onto the file system of a gomote instance.
    44    rpc WriteTGZFromURL (WriteTGZFromURLRequest) returns (WriteTGZFromURLResponse) {}
    45  }
    46  
    47  // AuthenticateRequest specifies the data needed for an authentication request.
    48  message AuthenticateRequest {}
    49  
    50  // AuthenticateResponse contains authenticated user data.
    51  message AuthenticateResponse {}
    52  
    53  // AddBootstrapRequest specifies the data needed for a request to add the bootstrap version of Go
    54  // to the instance.
    55  message AddBootstrapRequest {
    56    // The unique identifier for a gomote instance.
    57    string gomote_id = 1;
    58  }
    59  
    60  // AddBootstrapResponse contains the information about the add bootstrap request.
    61  message AddBootstrapResponse {
    62    // The URL for the Go version added to the work directory.
    63    // If empty, the bootstrap version is undefined and has probably been included in
    64    // the instance image.
    65    string bootstrap_go_url = 1;
    66  }
    67  
    68  // CreateInstanceRequest specifies the data needed to create a gomote instance.
    69  message CreateInstanceRequest {
    70    string builder_type = 1;
    71    repeated string experiment_option = 2;
    72  }
    73  
    74  // CreateInstanceResponse contains data about a created gomote instance.
    75  message CreateInstanceResponse {
    76    // Instance information for the requested instance.
    77    Instance instance = 1;
    78    enum Status {
    79      UNKNOWN = 0;
    80      WAITING = 1;
    81      COMPLETE = 2;
    82    }
    83    // The status for the requested create.
    84    Status status = 2;
    85    // Waiters ahead is the count of how many instances are being scheduled for
    86    // creation before the current instance creation request.
    87    int64 waiters_ahead = 3;
    88  }
    89  
    90  // DestroyInstanceRequest specifies the data needed to destroy a gomote instance.
    91  message DestroyInstanceRequest {
    92    // The unique identifier for a gomote instance.
    93    string gomote_id = 1;
    94  }
    95  
    96  // DestroyInstanceResponse contains data about a destroyed gomote instance.
    97  message DestroyInstanceResponse {}
    98  
    99  // ExecuteCommandRequest specifies the data needed to execute a command on a gomote instance.
   100  message ExecuteCommandRequest {
   101    // The unique identifier for a gomote instance.
   102    string gomote_id = 1;
   103    // The command to be executed on the buildlet.
   104    string command = 2;
   105    // Controls whether the command is run outside of the buildlet's environment.
   106    bool system_level = 3;
   107    // Debug will instruct the buildlet to include extra debugging information in the output.
   108    bool debug = 4;
   109    // These are additional environmental variables to include in the buildlet's process's
   110    // environment.
   111    repeated string append_environment = 5;
   112    // Path specifies the PATH variable of the executed procesess's environment.
   113    // A non-nil entry will clear the existing PATH value.
   114    // The string "$PATH" expands to any existing PATH element(s).
   115    // The substring "$WORKDIR" expands to buildlet's temp workdir.
   116    repeated string path = 6;
   117    // The directory from which to execute the command.
   118    // If not specified, it defaults to the directory of the command or the
   119    // work directory if system level is set.
   120    string directory = 7;
   121    // The arguments to pass to the command.
   122    repeated string args = 8;
   123    // Optional alternate builder to act like. It must be a compatible builder.
   124    string imitate_host_type = 9;
   125  }
   126  
   127  // ExecuteCommandResponse contains data about the executed command.
   128  message ExecuteCommandResponse {
   129    // The output from the executed command.
   130    bytes output = 1;
   131  }
   132  
   133  // Instance contains descriptive information about a gomote instance.
   134  message Instance {
   135    // The unique identifier for a gomote instance.
   136    string gomote_id = 1;
   137    // Builder type for the gomote instance.
   138    string builder_type = 2;
   139    // Host type for the gomote instance.
   140    string host_type = 3;
   141    // The timestamp for when the builder instance will expire. It is
   142    // represented in Unix epoch time format.
   143    int64 expires = 4;
   144    // The working directory of the instance.
   145    string working_dir = 5;
   146  }
   147  
   148  // InstanceAliveRequest specifies the data needed to check the liveness of a gomote instance.
   149  message InstanceAliveRequest {
   150    // The unique identifier for a gomote instance.
   151    string gomote_id = 1;
   152  }
   153  
   154  // InstanceAliveResponse contains instance liveness state.
   155  message InstanceAliveResponse {}
   156  
   157  // ListDirectoryRequest specifies the data needed to list contents of a directory from a gomote instance.
   158  message ListDirectoryRequest {
   159    // The unique identifier for a gomote instance.
   160    string gomote_id = 1;
   161    // The directory to list the contents of. The directory dir itself is not included.
   162    string directory = 2;
   163    // Controls whether the directory is listed recursively.
   164    bool recursive = 3;
   165    // The directories to skip, relative to the main directory.
   166    // Each item should contain only forward slashes and not start or end in slashes.
   167    repeated string skip_files = 4;
   168    // Controls whether the SHA-1 of regular files are returned.
   169    bool digest = 5;
   170  }
   171  
   172  // ListDirectoryResponse contains the directory listing of a gomote instance.
   173  message ListDirectoryResponse {
   174    // The directory entries.
   175    repeated string entries = 1;
   176  }
   177  
   178  // ListInstancesRequest specifies the data needed to list the live gomote instances owned by the caller.
   179  message ListInstancesRequest {}
   180  
   181  // ListInstancesResponse contains the list of live gomote instances owned by the caller.
   182  message ListInstancesResponse {
   183    repeated Instance instances = 1;
   184  }
   185  
   186  // ListSwarmingBuildersRequest specifies the data needed to list all swarming builders.
   187  message ListSwarmingBuildersRequest {}
   188  
   189  // ListSwarmingBuildersResponse contains a list of swarming builders.
   190  message ListSwarmingBuildersResponse {
   191    repeated string builders = 1;
   192  }
   193  
   194  // ReadTGZToURLRequest specifies the data needed to retrieve a tar and zipped directory from a gomote instance.
   195  message ReadTGZToURLRequest {
   196    // The unique identifier for a gomote instance.
   197    string gomote_id = 1;
   198    // The relative directory from the gomote's work directory to tar up.
   199    string directory = 2;
   200  }
   201  
   202  // ReadTGZToURLResponse contains a URL where the tar and zipped directory from a gomote instance can be downloaded from.
   203  message ReadTGZToURLResponse {
   204    // URL to retrieve the tarball from.
   205    string url = 1;
   206  }
   207  
   208  // RemoveFilesRequest specifies the data needed to remove files or directories from a gomote instance.
   209  message RemoveFilesRequest {
   210    // The unique identifier for a gomote instance.
   211    string gomote_id = 1;
   212    // The list of paths for files or directories to remove from the file system.
   213    // When everything should be deleted, "." should be used.
   214    // The paths are relative to the work directory.
   215    repeated string paths = 2;
   216  }
   217  
   218  // RemoveFilesResponse contains the results from removing files or directories from a gomote instance.
   219  message RemoveFilesResponse {}
   220  
   221  // SignSSHKeyRequest specifies the data needed to sign a public SSH key which attaches a certificate to the key.
   222  message SignSSHKeyRequest {
   223    // The unique identifier for a gomote instance.
   224    string gomote_id = 1;
   225    // A user provided public SSH key which the user intends to initiate an SSH session with.
   226    bytes public_ssh_key = 2;
   227  }
   228  
   229  // SignSSHKeyResponse contains the results from a request to sign a public SSH key.
   230  message SignSSHKeyResponse {
   231    // A signed SSH key can be used in conjunction with the associated private key to initiate an SSH session to a gomote instance.
   232    // The certificate attached to the key will contain principles which restrict the instance that can be logged into.
   233    bytes signed_public_ssh_key = 1;
   234  }
   235  
   236  // UploadFileRequest specifies the data needed to create a request to upload an object to GCS.
   237  message UploadFileRequest {}
   238  
   239  // UploadFileResponse contains the results from a request to upload an object to GCS.
   240  message UploadFileResponse {
   241    // URL to post file to.
   242    string url = 1;
   243    // Form fields used when http posting files to GCS.
   244    map<string, string> fields = 2;
   245    // Name used to reference the object.
   246    string object_name = 3;
   247  }
   248  
   249  // WriteFileFromURLRequest specifies the data needed to request that a gomote download the contents of a URL and place
   250  // the contents in a file.
   251  message WriteFileFromURLRequest {
   252    // The unique identifier for a gomote instance.
   253    string gomote_id = 1;
   254    // URL to post get file from.
   255    string url = 2;
   256    // The filename as it should appear at the destination.
   257    string filename = 3;
   258    // The file mode.
   259    fixed32 mode = 4;
   260  }
   261  
   262  // WriteFileFromURLResponse contains the results from requesting that a file be downloaded onto a gomote instance.
   263  message WriteFileFromURLResponse {}
   264  
   265  // WriteTGZFromURLRequest specifies the data needed to retrieve a file and expand it onto the file system of a gomote instance.
   266  // It instructs the buildlet to download the tar.gz file from the url and write it to a directory, a relative directory from the workdir.
   267  // If the directory is empty, they're placed at the root of the buildlet's work directory.
   268  // The directory is created if necessary.
   269  // The url must be of a tar.gz file.
   270  message WriteTGZFromURLRequest {
   271    string gomote_id = 1;
   272    string url = 2;
   273    string directory = 3;
   274  }
   275  
   276  // WriteTGZFromURLResponse contains the results from retrieving a file and expanding it onto the file system of a gomote instance.
   277  message WriteTGZFromURLResponse {}