Skip to content

Commit

Permalink
Merge branch 'tedi/dependencylist' into tedi/podmansock
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Nov 25, 2024
2 parents d9e4235 + 9820014 commit 1587f41
Show file tree
Hide file tree
Showing 21 changed files with 321 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.4.1"
".": "1.4.2"
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [1.4.2](https://github.com/kurtosis-tech/kurtosis/compare/v1.4.1...1.4.2) (2024-11-10)


### Bug Fixes

* don't include component name in release please tags ([#2590](https://github.com/kurtosis-tech/kurtosis/issues/2590)) ([28582cc](https://github.com/kurtosis-tech/kurtosis/commit/28582cce6b41903b1d683126ed0f75c6503d45ff))
* make releases work again without v in tags ([#2586](https://github.com/kurtosis-tech/kurtosis/issues/2586)) ([a87f945](https://github.com/kurtosis-tech/kurtosis/commit/a87f945ca9014a632ccde85631b364dad3304fbb))
* remove closeChannelWhenEmpty busy loop ([#2594](https://github.com/kurtosis-tech/kurtosis/issues/2594)) ([dbb2193](https://github.com/kurtosis-tech/kurtosis/commit/dbb2193c3215ee86ea5a54a19efecc0985b4511b))
* wrong config structure for release please ([#2588](https://github.com/kurtosis-tech/kurtosis/issues/2588)) ([e7263c3](https://github.com/kurtosis-tech/kurtosis/commit/e7263c3558b27390439a0e3456955306a06a7cb0))

## [1.4.1](https://github.com/kurtosis-tech/kurtosis/compare/1.4.0...v1.4.1) (2024-11-01)


Expand Down

Large diffs are not rendered by default.

38 changes: 37 additions & 1 deletion api/golang/core/lib/enclaves/enclave_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,50 @@ func (enclaveCtx *EnclaveContext) GetStarlarkRun(ctx context.Context) (*kurtosis
return response, nil
}

func (enclaveCtx *EnclaveContext) GetStarlarkPackagePlanYaml(ctx context.Context, packageId string, serializedParams string) (*kurtosis_core_rpc_api_bindings.PlanYaml, error) {
func (enclaveCtx *EnclaveContext) GetStarlarkRemotePackagePlanYaml(ctx context.Context, packageId string, serializedParams string) (*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 '%s':\n%s", packageId, serializedParams)
}
response, err := enclaveCtx.client.GetStarlarkPackagePlanYaml(ctx, &kurtosis_core_rpc_api_bindings.StarlarkPackagePlanYamlArgs{
PackageId: packageId,
SerializedParams: &serializedParams,
IsRemote: true,
RelativePathToMainFile: nil,
MainFunctionName: nil,
})
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred while getting the Starlark package plan yaml.")
}
return response, nil
}

func (enclaveCtx *EnclaveContext) GetStarlarkPackagePlanYaml(ctx context.Context, packageRootPath string, serializedParams string) (*kurtosis_core_rpc_api_bindings.PlanYaml, error) {
packageName, packageReplaceOptions, err := getPackageNameAndReplaceOptions(packageRootPath)
if err != nil {
return nil, err
}

serializedParams, err = maybeParseYaml(serializedParams)
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred when parsing YAML args for package '%s':\n%s", packageName, serializedParams)
}

err = enclaveCtx.uploadStarlarkPackage(packageName, packageRootPath)
if err != nil {
return nil, stacktrace.Propagate(err, "Error uploading package '%s' prior to executing it", packageRootPath)
}

if len(packageReplaceOptions) > 0 {
if err = enclaveCtx.uploadLocalStarlarkPackageDependencies(packageRootPath, packageReplaceOptions); err != nil {
return nil, stacktrace.Propagate(err, "An error occurred while uploading the local starlark package dependencies from the replace options '%+v'", packageReplaceOptions)
}
}

response, err := enclaveCtx.client.GetStarlarkPackagePlanYaml(ctx, &kurtosis_core_rpc_api_bindings.StarlarkPackagePlanYamlArgs{
PackageId: packageName,
SerializedParams: &serializedParams,
IsRemote: false,
RelativePathToMainFile: nil,
MainFunctionName: nil,
})
Expand Down
2 changes: 1 addition & 1 deletion api/golang/kurtosis_version/kurtosis_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ const (
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
// This is necessary so that Kurt Core consumers will know if they're compatible with the currently-running
// API container
KurtosisVersion = "1.4.1"
KurtosisVersion = "1.4.2"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
)
7 changes: 5 additions & 2 deletions api/protobuf/core/api_container_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,12 @@ message StarlarkPackagePlanYamlArgs {
// This should be a valid JSON string
optional string serialized_params = 2;

// whether or not this is package yaml should be pulled from on disk package or cloned
bool is_remote = 3;

// The relative main file filepath, the default value is the "main.star" file in the root of a package
optional string relative_path_to_main_file = 3;
optional string relative_path_to_main_file = 4;

// The name of the main function, the default value is "run"
optional string main_function_name = 4;
optional string main_function_name = 5;
}
2 changes: 1 addition & 1 deletion api/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kurtosis-sdk"
version = "1.4.1"
version = "1.4.2"
license = "BUSL-1.1"
description = "Rust SDK for Kurtosis"
edition = "2021"
Expand Down
7 changes: 5 additions & 2 deletions api/rust/src/api_container_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,13 +719,16 @@ pub struct StarlarkPackagePlanYamlArgs {
/// This should be a valid JSON string
#[prost(string, optional, tag = "2")]
pub serialized_params: ::core::option::Option<::prost::alloc::string::String>,
/// whether or not this is package yaml should be pulled from on disk package or cloned
#[prost(bool, tag = "3")]
pub is_remote: bool,
/// The relative main file filepath, the default value is the "main.star" file in the root of a package
#[prost(string, optional, tag = "3")]
#[prost(string, optional, tag = "4")]
pub relative_path_to_main_file: ::core::option::Option<
::prost::alloc::string::String,
>,
/// The name of the main function, the default value is "run"
#[prost(string, optional, tag = "4")]
#[prost(string, optional, tag = "5")]
pub main_function_name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
Expand Down
2 changes: 1 addition & 1 deletion api/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kurtosis-sdk",
"//": "NOTE: DO NOT UPDATE THIS VERSION MANUALLY - IT WILL BE UPDATED DURING THE RELEASE PROCESS!",
"version": "1.4.1",
"version": "1.4.2",
"main": "./build/index",
"description": "This repo contains a Typescript client for communicating with the Kurtosis Engine server, which is responsible for creating, managing and destroying Kurtosis Enclaves.",
"types": "./build/index",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,9 @@ export class StarlarkPackagePlanYamlArgs extends jspb.Message {
hasSerializedParams(): boolean;
clearSerializedParams(): StarlarkPackagePlanYamlArgs;

getIsRemote(): boolean;
setIsRemote(value: boolean): StarlarkPackagePlanYamlArgs;

getRelativePathToMainFile(): string;
setRelativePathToMainFile(value: string): StarlarkPackagePlanYamlArgs;
hasRelativePathToMainFile(): boolean;
Expand All @@ -1568,6 +1571,7 @@ export namespace StarlarkPackagePlanYamlArgs {
export type AsObject = {
packageId: string,
serializedParams?: string,
isRemote: boolean,
relativePathToMainFile?: string,
mainFunctionName?: string,
}
Expand All @@ -1579,12 +1583,12 @@ export namespace StarlarkPackagePlanYamlArgs {

export enum RelativePathToMainFileCase {
_RELATIVE_PATH_TO_MAIN_FILE_NOT_SET = 0,
RELATIVE_PATH_TO_MAIN_FILE = 3,
RELATIVE_PATH_TO_MAIN_FILE = 4,
}

export enum MainFunctionNameCase {
_MAIN_FUNCTION_NAME_NOT_SET = 0,
MAIN_FUNCTION_NAME = 4,
MAIN_FUNCTION_NAME = 5,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11108,8 +11108,9 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.toObject = function(includeI
var f, obj = {
packageId: jspb.Message.getFieldWithDefault(msg, 1, ""),
serializedParams: jspb.Message.getFieldWithDefault(msg, 2, ""),
relativePathToMainFile: jspb.Message.getFieldWithDefault(msg, 3, ""),
mainFunctionName: jspb.Message.getFieldWithDefault(msg, 4, "")
isRemote: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
relativePathToMainFile: jspb.Message.getFieldWithDefault(msg, 4, ""),
mainFunctionName: jspb.Message.getFieldWithDefault(msg, 5, "")
};

if (includeInstance) {
Expand Down Expand Up @@ -11155,10 +11156,14 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.deserializeBinaryFromReader
msg.setSerializedParams(value);
break;
case 3:
var value = /** @type {boolean} */ (reader.readBool());
msg.setIsRemote(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setRelativePathToMainFile(value);
break;
case 4:
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setMainFunctionName(value);
break;
Expand Down Expand Up @@ -11205,9 +11210,9 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.serializeBinaryToWriter = fu
f
);
}
f = /** @type {string} */ (jspb.Message.getField(message, 3));
if (f != null) {
writer.writeString(
f = message.getIsRemote();
if (f) {
writer.writeBool(
3,
f
);
Expand All @@ -11219,6 +11224,13 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.serializeBinaryToWriter = fu
f
);
}
f = /** @type {string} */ (jspb.Message.getField(message, 5));
if (f != null) {
writer.writeString(
5,
f
);
}
};


Expand Down Expand Up @@ -11277,11 +11289,29 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.hasSerializedParam


/**
* optional string relative_path_to_main_file = 3;
* optional bool is_remote = 3;
* @return {boolean}
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.getIsRemote = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
};


/**
* @param {boolean} value
* @return {!proto.api_container_api.StarlarkPackagePlanYamlArgs} returns this
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.setIsRemote = function(value) {
return jspb.Message.setProto3BooleanField(this, 3, value);
};


/**
* optional string relative_path_to_main_file = 4;
* @return {string}
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.getRelativePathToMainFile = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};


Expand All @@ -11290,7 +11320,7 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.getRelativePathToM
* @return {!proto.api_container_api.StarlarkPackagePlanYamlArgs} returns this
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.setRelativePathToMainFile = function(value) {
return jspb.Message.setField(this, 3, value);
return jspb.Message.setField(this, 4, value);
};


Expand All @@ -11299,7 +11329,7 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.setRelativePathToM
* @return {!proto.api_container_api.StarlarkPackagePlanYamlArgs} returns this
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.clearRelativePathToMainFile = function() {
return jspb.Message.setField(this, 3, undefined);
return jspb.Message.setField(this, 4, undefined);
};


Expand All @@ -11308,16 +11338,16 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.clearRelativePathT
* @return {boolean}
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.hasRelativePathToMainFile = function() {
return jspb.Message.getField(this, 3) != null;
return jspb.Message.getField(this, 4) != null;
};


/**
* optional string main_function_name = 4;
* optional string main_function_name = 5;
* @return {string}
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.getMainFunctionName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};


Expand All @@ -11326,7 +11356,7 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.getMainFunctionNam
* @return {!proto.api_container_api.StarlarkPackagePlanYamlArgs} returns this
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.setMainFunctionName = function(value) {
return jspb.Message.setField(this, 4, value);
return jspb.Message.setField(this, 5, value);
};


Expand All @@ -11335,7 +11365,7 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.setMainFunctionNam
* @return {!proto.api_container_api.StarlarkPackagePlanYamlArgs} returns this
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.clearMainFunctionName = function() {
return jspb.Message.setField(this, 4, undefined);
return jspb.Message.setField(this, 5, undefined);
};


Expand All @@ -11344,7 +11374,7 @@ proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.clearMainFunctionN
* @return {boolean}
*/
proto.api_container_api.StarlarkPackagePlanYamlArgs.prototype.hasMainFunctionName = function() {
return jspb.Message.getField(this, 4) != null;
return jspb.Message.getField(this, 5) != null;
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1914,17 +1914,24 @@ export declare class StarlarkPackagePlanYamlArgs extends Message<StarlarkPackage
*/
serializedParams?: string;

/**
* whether or not this is package yaml should be pulled from on disk package or cloned
*
* @generated from field: bool is_remote = 3;
*/
isRemote: boolean;

/**
* The relative main file filepath, the default value is the "main.star" file in the root of a package
*
* @generated from field: optional string relative_path_to_main_file = 3;
* @generated from field: optional string relative_path_to_main_file = 4;
*/
relativePathToMainFile?: string;

/**
* The name of the main function, the default value is "run"
*
* @generated from field: optional string main_function_name = 4;
* @generated from field: optional string main_function_name = 5;
*/
mainFunctionName?: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,9 @@ export const StarlarkPackagePlanYamlArgs = proto3.makeMessageType(
() => [
{ no: 1, name: "package_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "serialized_params", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
{ no: 3, name: "relative_path_to_main_file", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
{ no: 4, name: "main_function_name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
{ no: 3, name: "is_remote", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
{ no: 4, name: "relative_path_to_main_file", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
{ no: 5, name: "main_function_name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
],
);

2 changes: 1 addition & 1 deletion api/typescript/src/kurtosis_version/kurtosis_version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
// This is necessary so that Kurt Core consumers (e.g. modules) will know if they're compatible with the currently-running
// API container
export const KURTOSIS_VERSION: string = "1.4.1"
export const KURTOSIS_VERSION: string = "1.4.2"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
16 changes: 15 additions & 1 deletion cli/cli/commands/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ func getPackageDependencyYaml(
var packageYaml *kurtosis_core_rpc_api_bindings.PlanYaml
var err error
if isRemote {
packageYaml, err = enclaveCtx.GetStarlarkPackagePlanYaml(ctx, starlarkScriptOrPackageId, packageArgs)
packageYaml, err = enclaveCtx.GetStarlarkRemotePackagePlanYaml(ctx, starlarkScriptOrPackageId, packageArgs)
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred retrieving plan yaml for provided package.")
}
Expand All @@ -698,6 +698,20 @@ func getPackageDependencyYaml(
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred retrieving plan yaml for provided package.")
}
} else {
// if the path is a file with `kurtosis.yml` at the end it's a module dir
// we remove the `kurtosis.yml` to get just the Dir containing the module
if isKurtosisYMLFileInPackageDir(fileOrDir, kurtosisYMLFilePath) {
starlarkScriptOrPackageId = path.Dir(starlarkScriptOrPackageId)
}
// we pass the sanitized path and look for a Kurtosis YML within it to get the package name
if err != nil {
return nil, stacktrace.Propagate(err, "Tried parsing Kurtosis YML at '%v' to get package name but failed", starlarkScriptOrPackageId)
}
packageYaml, err = enclaveCtx.GetStarlarkPackagePlanYaml(ctx, starlarkScriptOrPackageId, packageArgs)
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred retrieving plan yaml for provided package.")
}
}
}
return packageYaml, nil
Expand Down
Loading

0 comments on commit 1587f41

Please sign in to comment.