Skip to content

Commit

Permalink
feat: Get Starlark Run APIC endpoint (#1455)
Browse files Browse the repository at this point in the history
## Description:
We need a way to retrieve the latest Starlark run info: package id,
serialized params... The same parameters that are passed to the
RunStarlark* APIC methods.

## Is this change user facing?
YES

## References (if applicable):

https://www.notion.so/kurtosistech/Run-Config-07b2dbdab74d45d59be76061500ee435

---------

Co-authored-by: Anders Schwartz <[email protected]>
  • Loading branch information
laurentluce and adschwartz authored Oct 5, 2023
1 parent 39e94d9 commit 503cb8d
Show file tree
Hide file tree
Showing 25 changed files with 1,474 additions and 258 deletions.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions api/golang/core/lib/enclaves/enclave_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ func (enclaveCtx *EnclaveContext) ConnectServices(ctx context.Context, connect k
return nil
}

// Docs available at https://docs.kurtosis.com/#getstarlarkrun
func (enclaveCtx *EnclaveContext) GetStarlarkRun(ctx context.Context) (*kurtosis_core_rpc_api_bindings.GetStarlarkRunResponse, error) {
response, err := enclaveCtx.client.GetStarlarkRun(ctx, &emptypb.Empty{})
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred while getting the last starlark run")
}
return response, nil
}

// ====================================================================================================
//
// Private helper methods
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions api/protobuf/core/api_container_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ service ApiContainerService {

// User services port forwarding
rpc ConnectServices(ConnectServicesArgs) returns (ConnectServicesResponse) {};

// Get last Starlark run
rpc GetStarlarkRun(google.protobuf.Empty) returns (GetStarlarkRunResponse) {};
}

// ==============================================================================================
Expand Down Expand Up @@ -513,3 +516,30 @@ message ConnectServicesArgs {

message ConnectServicesResponse {
}

// ==============================================================================================
// Get Run Starlark
// ==============================================================================================

enum RestartPolicy {
NEVER = 0;
ALWAYS = 1;
}

message GetStarlarkRunResponse {
string package_id = 1;

string serialized_script = 2;

string serialized_params = 3;

int32 parallelism = 4;

string relative_path_to_main_file = 5;

string main_function_name = 6;

repeated KurtosisFeatureFlag experimental_features = 7;

RestartPolicy restart_policy = 8;
}
Loading

0 comments on commit 503cb8d

Please sign in to comment.