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

Merged
merged 33 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
aba722a
start dependency list
tedim52 Aug 23, 2024
507ef13
add images and package dependencies to plan yaml
tedim52 Aug 30, 2024
546c1c9
hook up to cli
tedim52 Aug 30, 2024
8df95e7
add get starlark plan yaml to api
tedim52 Aug 30, 2024
d0bba73
update tests
tedim52 Aug 30, 2024
3831674
make imgs unique and sort
tedim52 Aug 30, 2024
725cf84
Merge branch 'main' into tedi/dependencylist
tedim52 Aug 30, 2024
65da4ab
refactor plan yaml
tedim52 Aug 30, 2024
b712fe8
only add module prefix and dont add parent package
tedim52 Aug 30, 2024
c1cd1fc
maybe parse yaml
tedim52 Aug 30, 2024
554b754
pull dependencies locally
tedim52 Sep 11, 2024
18c2591
fix cloning pkgs
tedim52 Sep 12, 2024
7e56e5b
replace magic vlues
tedim52 Sep 12, 2024
24bbebb
exhaust struct
tedim52 Sep 12, 2024
09e90ee
Merge branch 'main' into tedi/dependencylist
tedim52 Oct 17, 2024
070fa60
Merge branch 'main' into tedi/dependencylist
tedim52 Nov 14, 2024
f5d4014
start addressing comments
tedim52 Nov 14, 2024
db66969
remove dependencies only flag
tedim52 Nov 15, 2024
ec6e9af
rename test file
tedim52 Nov 20, 2024
5121860
typo
tedim52 Nov 20, 2024
294c325
remove add images
tedim52 Nov 20, 2024
6b489ca
clarify get module prefix
tedim52 Nov 20, 2024
807de9b
finish addressing comments
tedim52 Nov 20, 2024
0a0c10b
account for official imgs
tedim52 Nov 20, 2024
f7e5d9d
regen proto to remove dependencies only
tedim52 Nov 20, 2024
3de186f
change location of err handle
tedim52 Nov 20, 2024
a938a40
use work dir for kurt yml check
tedim52 Nov 20, 2024
57ab266
remove extra colon
tedim52 Nov 20, 2024
c2ce7f4
lint
tedim52 Nov 20, 2024
dcb43e1
change docker auth err to warn logs
tedim52 Nov 20, 2024
8f763bd
Merge branch 'main' into tedi/dependencylist
tedim52 Nov 20, 2024
18de25e
pull local package
tedim52 Nov 25, 2024
9820014
undo breaking change
tedim52 Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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