Implement crash-safe streaming worker runtime
This commit is contained in:
parent
16cba3c317
commit
cdeef3cc1a
1 changed files with 7448 additions and 194 deletions
|
|
@ -3,8 +3,9 @@ use std::{collections::BTreeSet, fs};
|
|||
use remora_contracts::{
|
||||
ActivationResponseDto, AttemptActivateRequestDto, AttemptCheckpointRequestDto,
|
||||
AttemptOutcomeRequestDto, AttemptProgressRequestDto, AttemptRenewRequestDto,
|
||||
AttemptResolvedSourceRequestDto, ClaimRequestDto, ClaimResponseDto, JobPhaseProjectionDto,
|
||||
LeaseProjectionDto,
|
||||
AttemptResolvedSourceRequestDto, AttemptStagingMultipartRequestDto,
|
||||
AttemptStagingObjectRequestDto, AttemptStagingWriteIntentRequestDto, AttemptStopRequestDto,
|
||||
ClaimRequestDto, ClaimResponseDto, JobPhaseProjectionDto, LeaseProjectionDto,
|
||||
};
|
||||
use serde::{Serialize, de::DeserializeOwned};
|
||||
use serde_json::Value;
|
||||
|
|
@ -96,7 +97,7 @@ fn worker_routes_and_dtos_conform_to_the_mutable_openapi_contract() {
|
|||
"staging_target": {
|
||||
"store": "primary",
|
||||
"bucket": "remora-results",
|
||||
"prefix": "_remora/a/attempt_0001/"
|
||||
"prefix": "users/alice/_remora/a/attempt_0001/"
|
||||
},
|
||||
"execution_grant_ref": "grant_0001",
|
||||
"checkpoint_ref": null
|
||||
|
|
@ -135,6 +136,58 @@ fn worker_routes_and_dtos_conform_to_the_mutable_openapi_contract() {
|
|||
"AttemptActivateRequest",
|
||||
mutation.clone(),
|
||||
);
|
||||
assert_dto_and_schema::<AttemptStopRequestDto>(
|
||||
&component_schema,
|
||||
"AttemptStopRequest",
|
||||
serde_json::json!({
|
||||
"operation_id": "operation_0001",
|
||||
"fence": 1,
|
||||
"worker_incarnation": "worker_0001"
|
||||
}),
|
||||
);
|
||||
assert_dto_and_schema::<AttemptStagingObjectRequestDto>(
|
||||
&component_schema,
|
||||
"AttemptStagingObjectRequest",
|
||||
serde_json::json!({
|
||||
"operation_id": "operation_0001",
|
||||
"fence": 1,
|
||||
"worker_incarnation": "worker_0001",
|
||||
"object": {
|
||||
"store": "primary",
|
||||
"bucket": "remora-results",
|
||||
"key": "users/alice/_remora/a/attempt_0001/o/object_0001"
|
||||
}
|
||||
}),
|
||||
);
|
||||
assert_dto_and_schema::<AttemptStagingWriteIntentRequestDto>(
|
||||
&component_schema,
|
||||
"AttemptStagingWriteIntentRequest",
|
||||
serde_json::json!({
|
||||
"operation_id": "operation_0001",
|
||||
"fence": 1,
|
||||
"worker_incarnation": "worker_0001",
|
||||
"intent": {
|
||||
"store": "primary",
|
||||
"bucket": "remora-results",
|
||||
"key": "users/alice/_remora/a/attempt_0001/o/object_0001"
|
||||
}
|
||||
}),
|
||||
);
|
||||
assert_dto_and_schema::<AttemptStagingMultipartRequestDto>(
|
||||
&component_schema,
|
||||
"AttemptStagingMultipartRequest",
|
||||
serde_json::json!({
|
||||
"operation_id": "operation_0001",
|
||||
"fence": 1,
|
||||
"worker_incarnation": "worker_0001",
|
||||
"multipart": {
|
||||
"store": "primary",
|
||||
"bucket": "remora-results",
|
||||
"key": "users/alice/_remora/a/attempt_0001/o/object_0001",
|
||||
"upload_id": "upload_0001"
|
||||
}
|
||||
}),
|
||||
);
|
||||
assert_dto_and_schema::<ActivationResponseDto>(
|
||||
&component_schema,
|
||||
"ActivationResponse",
|
||||
|
|
@ -228,6 +281,30 @@ fn worker_routes_and_dtos_conform_to_the_mutable_openapi_contract() {
|
|||
"200",
|
||||
Some("ActivationResponse"),
|
||||
),
|
||||
(
|
||||
"/internal/v1/attempts/{attempt_id}/stop",
|
||||
"AttemptStopRequest",
|
||||
"204",
|
||||
None,
|
||||
),
|
||||
(
|
||||
"/internal/v1/attempts/{attempt_id}/staging/write-intent",
|
||||
"AttemptStagingWriteIntentRequest",
|
||||
"204",
|
||||
None,
|
||||
),
|
||||
(
|
||||
"/internal/v1/attempts/{attempt_id}/staging/object",
|
||||
"AttemptStagingObjectRequest",
|
||||
"204",
|
||||
None,
|
||||
),
|
||||
(
|
||||
"/internal/v1/attempts/{attempt_id}/staging/multipart",
|
||||
"AttemptStagingMultipartRequest",
|
||||
"204",
|
||||
None,
|
||||
),
|
||||
(
|
||||
"/internal/v1/attempts/{attempt_id}/resolved-source",
|
||||
"AttemptResolvedSourceRequest",
|
||||
|
|
|
|||
Loading…
Reference in a new issue