@@ -106,6 +106,34 @@ message CompletedJob {
106
106
}
107
107
}
108
108
109
+ enum DataUploadType {
110
+ UPLOAD_TYPE_UNKNOWN = 0 ;
111
+ // UPLOAD_TYPE_MODULE_FILES is used to stream over terraform module files.
112
+ // These files are located in `.terraform/modules` and are used for dynamic
113
+ // parameters.
114
+ UPLOAD_TYPE_MODULE_FILES = 1 ;
115
+ }
116
+
117
+ message DataUpload {
118
+ DataUploadType upload_type = 1 ;
119
+ // data_hash is the sha256 of the payload to be uploaded.
120
+ // This is also used to uniquely identify the upload.
121
+ bytes data_hash = 2 ;
122
+ // file_size is the total size of the data being uploaded.
123
+ int64 file_size = 3 ;
124
+ // Number of chunks to be uploaded.
125
+ int32 chunks = 4 ;
126
+ }
127
+
128
+ // ChunkPiece is used to stream over large files (over the 4mb limit).
129
+ message ChunkPiece {
130
+ bytes data = 1 ;
131
+ // full_data_hash should match the hash from the original
132
+ // DataUpload message
133
+ bytes full_data_hash = 2 ;
134
+ int32 piece_index = 3 ;
135
+ }
136
+
109
137
// LogSource represents the sender of the log.
110
138
enum LogSource {
111
139
PROVISIONER_DAEMON = 0 ;
@@ -153,6 +181,14 @@ message CommitQuotaResponse {
153
181
154
182
message CancelAcquire {}
155
183
184
+ message CompleteWithFilesRequest {
185
+ oneof type {
186
+ CompletedJob complete = 1 ;
187
+ DataUpload data_upload = 2 ;
188
+ ChunkPiece chunk_piece = 3 ;
189
+ }
190
+ }
191
+
156
192
service ProvisionerDaemon {
157
193
// AcquireJob requests a job. Implementations should
158
194
// hold a lock on the job until CompleteJob() is
@@ -180,4 +216,5 @@ service ProvisionerDaemon {
180
216
181
217
// CompleteJob indicates a job has been completed.
182
218
rpc CompleteJob (CompletedJob ) returns (Empty );
219
+ rpc CompleteJobWithFiles (stream CompleteWithFilesRequest ) returns (Empty );
183
220
}
0 commit comments