1/** 2 * Copyright 2023 Google LLC 3 * 4 * <p>Licensed under the Apache License, Version 2.0 (the "License"); you may 5 * not use this file except in compliance with the License. You may obtain a 6 * copy of the License at 7 * 8 * <p>http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * <p>Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * the License. 15 */ 16syntax = "proto3"; 17 18package google.ondevicepersonalization.federatedcompute.proto; 19 20import "fcp/protos/federatedcompute/common.proto"; 21import "fcp/protos/plan.proto"; 22import "fcp/protos/ondevicepersonalization/eligibility_spec.proto"; 23 24option java_package = "com.google.ondevicepersonalization.federatedcompute.proto"; 25option java_multiple_files = true; 26 27// Create task assignment request. 28// The url to create task assignment under v1 API is: 29// https://{host}/taskassignment/v1/population/{populationName}:create-task-assignment 30// Next Id: 3 31message CreateTaskAssignmentRequest { 32 google.internal.federatedcompute.v1.ClientVersion client_version = 1; 33 34 // The client's capabilities when downloading and processing resources. 35 google.internal.federatedcompute.v1.ResourceCapabilities resource_capabilities = 2; 36} 37 38// Create task assignment response. 39// Next Id: 3 40message CreateTaskAssignmentResponse { 41 // One of two outcomes, depending on server's decision on participation of the 42 // client. 43 oneof result { 44 // If the client joined the task with this call, information on how to 45 // proceed. 46 TaskAssignment task_assignment = 1; 47 48 // If the client was not accepted, information how to proceed. 49 google.internal.federatedcompute.v1.RejectionInfo rejection_info = 2; 50 } 51} 52 53// When client (device) is accepted for the current task, this data structure 54// carries information necessary to begin task execution. 55// Next Id: 12 56message TaskAssignment { 57 // population name. 58 string population_name = 1; 59 60 // the task id 61 string task_id = 2; 62 63 // The opaque id of the aggregation session the client has joined. This is a 64 // string generated by the server and MUST NOT contain any information that 65 // could be used to identify a specific device. 66 string aggregation_id = 3; 67 68 // assignment id 69 string assignment_id = 4; 70 71 // The identifier of the task that was assigned. It's better to use the combination of 72 // `population_name` and `task_id` to identify a task. 73 string task_name = 5; 74 75 // The checkpoint from which to start execution. 76 google.internal.federatedcompute.v1.Resource init_checkpoint = 6; 77 78 // The plan to be used for execution. 79 google.internal.federatedcompute.v1.Resource plan = 7; 80 81 // self uri 82 string self_uri = 8; 83 84 // The eligibility of the task. Device need to run this eligibility task 85 // to check if it's qualified to start the job before execute real task. 86 EligibilityTaskInfo eligibility_task_info = 9; 87 88 // The signature of eligibility task. 89 Signature eligibility_task_info_signature = 10; 90 91 // Specifies an example selection procedure. Can be used by model versioning. 92 google.internal.federated.plan.ExampleSelector example_selector = 11; 93} 94 95// The signature information. Device can verify the signature to check integrity of 96// the content. 97message Signature {} 98 99// Report result request. 100// The url to report result under v1 API is: 101// https://{host}/taskassignment/v1/population/{populationName}/task/{taskId}/aggregation/{aggregationId}/task-assignment/{assignmentId}:report-result 102// Next Id: 3 103message ReportResultRequest { 104 enum Result { 105 // Unknown 106 UNKNOWN = 0; 107 108 // Completed 109 COMPLETED = 1; 110 111 // Failed. 112 FAILED = 2; 113 114 // Failed due to eligibility task is not qualified. 115 NOT_ELIGIBLE = 3; 116 } 117 118 Result result = 1; 119 120 // The client's capabilities when uploading result. 121 google.internal.federatedcompute.v1.ResourceCapabilities resource_capabilities = 2; 122} 123 124// Report result response. 125message ReportResultResponse { 126 // Upload result instruction on succeeded. 127 UploadInstruction upload_instruction = 1; 128 129 // Rejection reason. 130 google.internal.federatedcompute.v1.RejectionInfo rejection_info = 2; 131} 132 133// The upload instruction. 134// Next id: 4 135message UploadInstruction { 136 // upload file path. 137 string upload_location = 1; 138 139 // extra head for uploading. 140 map<string, string> extra_request_headers = 2; 141 142 // The compression used for resource, or unset if the data is 143 // uncompressed. 144 google.internal.federatedcompute.v1.ResourceCompressionFormat compression_format = 3; 145} 146