Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: impl dependency list flag #2543

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

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

35 changes: 35 additions & 0 deletions api/golang/core/lib/enclaves/enclave_context.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,41 @@ func (enclaveCtx *EnclaveContext) GetStarlarkRun(ctx context.Context) (*kurtosis
return response, nil
}

func (enclaveCtx *EnclaveContext) GetStarlarkPackagePlanYaml(ctx context.Context, packageId string, serializedParams string, dependenciesOnly bool) (*kurtosis_core_rpc_api_bindings.PlanYaml, error) {
serializedParams, err := maybeParseYaml(serializedParams)
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred when parsing YAML args for package '%v'", serializedParams)
tedim52 marked this conversation as resolved.
Show resolved Hide resolved
}
response, err := enclaveCtx.client.GetStarlarkPackagePlanYaml(ctx, &kurtosis_core_rpc_api_bindings.StarlarkPackagePlanYamlArgs{
PackageId: packageId,
SerializedParams: &serializedParams,
RelativePathToMainFile: nil,
MainFunctionName: nil,
DependenciesOnly: &dependenciesOnly,
})
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred while getting the starlark package plan yaml run.")
tedim52 marked this conversation as resolved.
Show resolved Hide resolved
}
return response, nil
}

func (enclaveCtx *EnclaveContext) GetStarlarkScriptPlanYaml(ctx context.Context, serializedScript string, serializedParams string, dependenciesOnly bool) (*kurtosis_core_rpc_api_bindings.PlanYaml, error) {
serializedParams, err := maybeParseYaml(serializedParams)
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred when parsing YAML args for package '%v'", serializedParams)
}
response, err := enclaveCtx.client.GetStarlarkScriptPlanYaml(ctx, &kurtosis_core_rpc_api_bindings.StarlarkScriptPlanYamlArgs{
SerializedScript: serializedScript,
SerializedParams: &serializedParams,
MainFunctionName: nil,
DependenciesOnly: &dependenciesOnly,
})
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred while getting the last starlark script plan yaml run.")
tedim52 marked this conversation as resolved.
Show resolved Hide resolved
}
return response, nil
}

// ====================================================================================================
//
// Private helper methods
Expand Down
6 changes: 6 additions & 0 deletions api/protobuf/core/api_container_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ message StarlarkScriptPlanYamlArgs {

// The name of the main function, the default value is "run"
optional string main_function_name = 5;

// Whether to return only the dependencies of the starlark script
optional bool dependencies_only = 6;
}

message StarlarkPackagePlanYamlArgs {
Expand All @@ -612,4 +615,7 @@ message StarlarkPackagePlanYamlArgs {

// The name of the main function, the default value is "run"
optional string main_function_name = 4;

// Whether to return only the dependencies of the Starlark package
optional bool dependencies_only = 5;
}
6 changes: 6 additions & 0 deletions api/rust/src/api_container_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ pub struct StarlarkScriptPlanYamlArgs {
/// The name of the main function, the default value is "run"
#[prost(string, optional, tag = "5")]
pub main_function_name: ::core::option::Option<::prost::alloc::string::String>,
/// Whether to return only the dependencies of the starlark script
#[prost(bool, optional, tag = "6")]
pub dependencies_only: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand All @@ -727,6 +730,9 @@ pub struct StarlarkPackagePlanYamlArgs {
/// The name of the main function, the default value is "run"
#[prost(string, optional, tag = "4")]
pub main_function_name: ::core::option::Option<::prost::alloc::string::String>,
/// Whether to return only the dependencies of the Starlark package
#[prost(bool, optional, tag = "5")]
pub dependencies_only: ::core::option::Option<bool>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,11 @@ export class StarlarkScriptPlanYamlArgs extends jspb.Message {
hasMainFunctionName(): boolean;
clearMainFunctionName(): StarlarkScriptPlanYamlArgs;

getDependenciesOnly(): boolean;
setDependenciesOnly(value: boolean): StarlarkScriptPlanYamlArgs;
hasDependenciesOnly(): boolean;
clearDependenciesOnly(): StarlarkScriptPlanYamlArgs;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): StarlarkScriptPlanYamlArgs.AsObject;
static toObject(includeInstance: boolean, msg: StarlarkScriptPlanYamlArgs): StarlarkScriptPlanYamlArgs.AsObject;
Expand All @@ -1524,6 +1529,7 @@ export namespace StarlarkScriptPlanYamlArgs {
serializedScript: string,
serializedParams?: string,
mainFunctionName?: string,
dependenciesOnly?: boolean,
}

export enum SerializedParamsCase {
Expand All @@ -1535,6 +1541,11 @@ export namespace StarlarkScriptPlanYamlArgs {
_MAIN_FUNCTION_NAME_NOT_SET = 0,
MAIN_FUNCTION_NAME = 5,
}

export enum DependenciesOnlyCase {
_DEPENDENCIES_ONLY_NOT_SET = 0,
DEPENDENCIES_ONLY = 6,
}
}

export class StarlarkPackagePlanYamlArgs extends jspb.Message {
Expand All @@ -1556,6 +1567,11 @@ export class StarlarkPackagePlanYamlArgs extends jspb.Message {
hasMainFunctionName(): boolean;
clearMainFunctionName(): StarlarkPackagePlanYamlArgs;

getDependenciesOnly(): boolean;
setDependenciesOnly(value: boolean): StarlarkPackagePlanYamlArgs;
hasDependenciesOnly(): boolean;
clearDependenciesOnly(): StarlarkPackagePlanYamlArgs;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): StarlarkPackagePlanYamlArgs.AsObject;
static toObject(includeInstance: boolean, msg: StarlarkPackagePlanYamlArgs): StarlarkPackagePlanYamlArgs.AsObject;
Expand All @@ -1570,6 +1586,7 @@ export namespace StarlarkPackagePlanYamlArgs {
serializedParams?: string,
relativePathToMainFile?: string,
mainFunctionName?: string,
dependenciesOnly?: boolean,
}

export enum SerializedParamsCase {
Expand All @@ -1586,6 +1603,11 @@ export namespace StarlarkPackagePlanYamlArgs {
_MAIN_FUNCTION_NAME_NOT_SET = 0,
MAIN_FUNCTION_NAME = 4,
}

export enum DependenciesOnlyCase {
_DEPENDENCIES_ONLY_NOT_SET = 0,
DEPENDENCIES_ONLY = 5,
}
}

export enum ServiceStatus {
Expand Down
Loading
Loading