Skip to content

Commit 826efb8

Browse files
authored
add endpoint for cancelling job run (#217)
1 parent 21b1d4a commit 826efb8

9 files changed

+2195
-1885
lines changed

Diff for: generated/go/porter/v1/cluster_control_plane.pb.go

+2,033-1,871
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: generated/go/porter/v1/porter_app.pb.go

+19-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: generated/go/porter/v1/porterv1connect/cluster_control_plane.connect.go

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: generated/js/src/porter/v1/cluster_control_plane_pb.d.ts

+66
Original file line numberDiff line numberDiff line change
@@ -4219,6 +4219,72 @@ export declare class ManualServiceRunRequest extends Message<ManualServiceRunReq
42194219
static equals(a: ManualServiceRunRequest | PlainMessage<ManualServiceRunRequest> | undefined, b: ManualServiceRunRequest | PlainMessage<ManualServiceRunRequest> | undefined): boolean;
42204220
}
42214221

4222+
/**
4223+
* CancelJobRunRequest is the request object for CancelJobRun
4224+
*
4225+
* @generated from message porter.v1.CancelJobRunRequest
4226+
*/
4227+
export declare class CancelJobRunRequest extends Message<CancelJobRunRequest> {
4228+
/**
4229+
* @generated from field: int64 project_id = 1;
4230+
*/
4231+
projectId: bigint;
4232+
4233+
/**
4234+
* @generated from field: int64 cluster_id = 2;
4235+
*/
4236+
clusterId: bigint;
4237+
4238+
/**
4239+
* deployment_target_identifier is the object that identifies the deployment target for the job run
4240+
*
4241+
* @generated from field: porter.v1.DeploymentTargetIdentifier deployment_target_identifier = 3;
4242+
*/
4243+
deploymentTargetIdentifier?: DeploymentTargetIdentifier;
4244+
4245+
/**
4246+
* job_run_name is the name of the job run to cancel
4247+
*
4248+
* @generated from field: string job_run_name = 4;
4249+
*/
4250+
jobRunName: string;
4251+
4252+
constructor(data?: PartialMessage<CancelJobRunRequest>);
4253+
4254+
static readonly runtime: typeof proto3;
4255+
static readonly typeName = "porter.v1.CancelJobRunRequest";
4256+
static readonly fields: FieldList;
4257+
4258+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CancelJobRunRequest;
4259+
4260+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CancelJobRunRequest;
4261+
4262+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CancelJobRunRequest;
4263+
4264+
static equals(a: CancelJobRunRequest | PlainMessage<CancelJobRunRequest> | undefined, b: CancelJobRunRequest | PlainMessage<CancelJobRunRequest> | undefined): boolean;
4265+
}
4266+
4267+
/**
4268+
* CancelJobRunResponse is the response object for CancelJobRun
4269+
*
4270+
* @generated from message porter.v1.CancelJobRunResponse
4271+
*/
4272+
export declare class CancelJobRunResponse extends Message<CancelJobRunResponse> {
4273+
constructor(data?: PartialMessage<CancelJobRunResponse>);
4274+
4275+
static readonly runtime: typeof proto3;
4276+
static readonly typeName = "porter.v1.CancelJobRunResponse";
4277+
static readonly fields: FieldList;
4278+
4279+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CancelJobRunResponse;
4280+
4281+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CancelJobRunResponse;
4282+
4283+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CancelJobRunResponse;
4284+
4285+
static equals(a: CancelJobRunResponse | PlainMessage<CancelJobRunResponse> | undefined, b: CancelJobRunResponse | PlainMessage<CancelJobRunResponse> | undefined): boolean;
4286+
}
4287+
42224288
/**
42234289
* ManualServiceRunResponse is the response object for ManualServiceRun
42244290
*

Diff for: generated/js/src/porter/v1/cluster_control_plane_pb.js

+25
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,31 @@ export const ManualServiceRunRequest = /*@__PURE__*/ proto3.makeMessageType(
14151415
],
14161416
);
14171417

1418+
/**
1419+
* CancelJobRunRequest is the request object for CancelJobRun
1420+
*
1421+
* @generated from message porter.v1.CancelJobRunRequest
1422+
*/
1423+
export const CancelJobRunRequest = /*@__PURE__*/ proto3.makeMessageType(
1424+
"porter.v1.CancelJobRunRequest",
1425+
() => [
1426+
{ no: 1, name: "project_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
1427+
{ no: 2, name: "cluster_id", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
1428+
{ no: 3, name: "deployment_target_identifier", kind: "message", T: DeploymentTargetIdentifier },
1429+
{ no: 4, name: "job_run_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
1430+
],
1431+
);
1432+
1433+
/**
1434+
* CancelJobRunResponse is the response object for CancelJobRun
1435+
*
1436+
* @generated from message porter.v1.CancelJobRunResponse
1437+
*/
1438+
export const CancelJobRunResponse = /*@__PURE__*/ proto3.makeMessageType(
1439+
"porter.v1.CancelJobRunResponse",
1440+
[],
1441+
);
1442+
14181443
/**
14191444
* ManualServiceRunResponse is the response object for ManualServiceRun
14201445
*

Diff for: generated/js/src/porter/v1/porter_app_pb.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ export declare enum EnumJobRunStatus {
104104
* @generated from enum value: ENUM_JOB_RUN_STATUS_FAILED = 3;
105105
*/
106106
FAILED = 3,
107+
108+
/**
109+
* @generated from enum value: ENUM_JOB_RUN_STATUS_CANCELED = 4;
110+
*/
111+
CANCELED = 4,
107112
}
108113

109114
/**

Diff for: generated/js/src/porter/v1/porter_app_pb.js

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export const EnumJobRunStatus = /*@__PURE__*/ proto3.makeEnum(
6262
{no: 1, name: "ENUM_JOB_RUN_STATUS_RUNNING", localName: "RUNNING"},
6363
{no: 2, name: "ENUM_JOB_RUN_STATUS_SUCCESSFUL", localName: "SUCCESSFUL"},
6464
{no: 3, name: "ENUM_JOB_RUN_STATUS_FAILED", localName: "FAILED"},
65+
{no: 4, name: "ENUM_JOB_RUN_STATUS_CANCELED", localName: "CANCELED"},
6566
],
6667
);
6768

Diff for: porter/v1/cluster_control_plane.proto

+16
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,19 @@ message ManualServiceRunRequest {
936936
AppImage image = 7;
937937
}
938938

939+
// CancelJobRunRequest is the request object for CancelJobRun
940+
message CancelJobRunRequest {
941+
int64 project_id = 1;
942+
int64 cluster_id = 2;
943+
// deployment_target_identifier is the object that identifies the deployment target for the job run
944+
DeploymentTargetIdentifier deployment_target_identifier = 3;
945+
// job_run_name is the name of the job run to cancel
946+
string job_run_name = 4;
947+
}
948+
949+
// CancelJobRunResponse is the response object for CancelJobRun
950+
message CancelJobRunResponse {}
951+
939952
// ManualServiceRunResponse is the response object for ManualServiceRun
940953
message ManualServiceRunResponse {
941954
// job_run_id is the id of the job run that was created, if any
@@ -1494,6 +1507,9 @@ service ClusterControlPlaneService {
14941507
// and runs the provided command, or if no command is provided, runs the command defined for the service.
14951508
rpc ManualServiceRun(ManualServiceRunRequest) returns (ManualServiceRunResponse) {}
14961509

1510+
// CancelJobRun cancels a job run for a given app and job service in the provided deployment target
1511+
rpc CancelJobRun(CancelJobRunRequest) returns (CancelJobRunResponse) {}
1512+
14971513
// JobRunStatus returns the status of a given job run
14981514
rpc JobRunStatus(JobRunStatusRequest) returns (JobRunStatusResponse) {}
14991515

Diff for: porter/v1/porter_app.proto

+1
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ enum EnumJobRunStatus {
231231
ENUM_JOB_RUN_STATUS_RUNNING = 1;
232232
ENUM_JOB_RUN_STATUS_SUCCESSFUL = 2;
233233
ENUM_JOB_RUN_STATUS_FAILED = 3;
234+
ENUM_JOB_RUN_STATUS_CANCELED = 4;
234235
}
235236

236237
// JobRun contains details about a job run

0 commit comments

Comments
 (0)