Skip to content

Commit

Permalink
Merge branch 'main' into bgazzard/enclave-builder-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartoxian authored Feb 9, 2024
2 parents 02f523e + aaf64ca commit d1e27eb
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 34 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [0.86.18](https://github.com/kurtosis-tech/kurtosis/compare/0.86.17...0.86.18) (2024-02-09)


### Features

* add files in enclave dump ([#2136](https://github.com/kurtosis-tech/kurtosis/issues/2136)) ([0525d9f](https://github.com/kurtosis-tech/kurtosis/commit/0525d9fbb12561cf4b5a83814baf05d8d1682274))


### Bug Fixes

* node selector validation ([#2141](https://github.com/kurtosis-tech/kurtosis/issues/2141)) ([0fee848](https://github.com/kurtosis-tech/kurtosis/commit/0fee84881f83d0b5a911f511a9fcdd889a0b8784))

## [0.86.17](https://github.com/kurtosis-tech/kurtosis/compare/0.86.16...0.86.17) (2024-02-08)


Expand Down
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Business Source License 1.1
Parameters

Licensor: Kurtosis Technologies, Inc.
Licensed Work: Kurtosis 0.86.17
Licensed Work: Kurtosis 0.86.18
The Licensed Work is (c) 2024 Kurtosis Technologies, Inc.
Additional Use Grant: You may make use of the Licensed Work, provided that
you may not use the Licensed Work for an Environment Orchestration Service.
Expand All @@ -12,7 +12,7 @@ you may not use the Licensed Work for an Environment Orchestration Service.
allows third parties (other than your employees and
contractors) to create distributed system environments.

Change Date: 2028-02-08
Change Date: 2028-02-09

Change License: Apache 2.0 (Apache License, Version 2.0)

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 = "0.86.17"
KurtosisVersion = "0.86.18"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
)
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 = "0.86.17"
version = "0.86.18"
license = "BUSL-1.1"
description = "Rust SDK for Kurtosis"
edition = "2021"
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": "0.86.17",
"version": "0.86.18",
"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
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 = "0.86.17"
export const KURTOSIS_VERSION: string = "0.86.18"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
Original file line number Diff line number Diff line change
Expand Up @@ -148,31 +148,46 @@ func DurationOrNone(value starlark.Value, attributeName string) *startosis_error
}

func StringMappingToString(value starlark.Value, attributeName string) *startosis_errors.InterpretationError {
labelsMap := map[string]string{}
labelsDict, ok := value.(*starlark.Dict)
if _, err := parseMapStringString(value, attributeName); err != nil {
return err
}
return nil
}

func ServiceLabelsValidator(value starlark.Value, attributeName string) *startosis_errors.InterpretationError {
labelsMap, interpretationErr := parseMapStringString(value, attributeName)
if interpretationErr != nil {
return interpretationErr
}
if err := service.ValidateServiceConfigLabels(labelsMap); err != nil {
return startosis_errors.WrapWithInterpretationError(err, "An error occurred validating service config labels '%+v'", labelsMap)
}
return nil
}

func parseMapStringString(value starlark.Value, attributeName string) (map[string]string, *startosis_errors.InterpretationError) {
stringMap := map[string]string{}
stringDict, ok := value.(*starlark.Dict)
if !ok {
return startosis_errors.NewInterpretationError("Attribute '%s' is expected to be a dictionary of strings, got '%s'", attributeName, reflect.TypeOf(value))
return nil, startosis_errors.NewInterpretationError("Attribute '%s' is expected to be a dictionary of strings, got '%s'", attributeName, reflect.TypeOf(value))
}
for _, labelKey := range labelsDict.Keys() {
labelValue, found, err := labelsDict.Get(labelKey)
for _, mapKey := range stringDict.Keys() {
mapValue, found, err := stringDict.Get(mapKey)
if err != nil {
return startosis_errors.WrapWithInterpretationError(err, "Unexpected error iterating on dictionary. Value associated to key '%v' could not be found", labelKey)
return nil, startosis_errors.WrapWithInterpretationError(err, "Unexpected error iterating on dictionary. Value associated to key '%v' could not be found", mapKey)
} else if !found {
return startosis_errors.NewInterpretationError("Unexpected error iterating on dictionary. Value associated to key '%v' could not be found", labelKey)
return nil, startosis_errors.NewInterpretationError("Unexpected error iterating on dictionary. Value associated to key '%v' could not be found", mapKey)
}

labelKeyStr, ok := labelKey.(starlark.String)
mapKeyStr, ok := mapKey.(starlark.String)
if !ok {
return startosis_errors.NewInterpretationError("Key in '%s' dictionary was expected to be a string, got '%s'", attributeName, reflect.TypeOf(labelKey))
return nil, startosis_errors.NewInterpretationError("Key in '%s' dictionary was expected to be a string, got '%s'", attributeName, reflect.TypeOf(mapKey))
}
labelValueStr, ok := labelValue.(starlark.String)
mapValueStr, ok := mapValue.(starlark.String)
if !ok {
return startosis_errors.NewInterpretationError("Value associated to key '%s' in dictionary '%s' was expected to be a string, got '%s'", labelKeyStr, attributeName, reflect.TypeOf(value))
return nil, startosis_errors.NewInterpretationError("Value associated to key '%s' in dictionary '%s' was expected to be a string, got '%s'", mapKeyStr, attributeName, reflect.TypeOf(value))
}
labelsMap[labelKeyStr.GoString()] = labelValueStr.GoString()
stringMap[mapKeyStr.GoString()] = mapValueStr.GoString()
}
if err := service.ValidateServiceConfigLabels(labelsMap); err != nil {
return startosis_errors.WrapWithInterpretationError(err, "An error occurred validating service config labels '%+v'", labelsMap)
}
return nil
return stringMap, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ var (
testServiceConfigLabelsKey2: testServiceConfigLabelsValue2,
}

testNodeSelectorKey1 = "disktype"
testNodeSelectorValue1 = "ssd"
testNodeSelectorKey1 = "k3s.io/hostname"
testNodeSelectorValue1 = "asrock-berlin-03"
testNodeSelectors = map[string]string{
testNodeSelectorKey1: testNodeSelectorValue1,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ func NewServiceConfigType() *kurtosis_type_constructor.KurtosisTypeConstructor {
IsOptional: true,
ZeroValueProvider: builtin_argument.ZeroValueProvider[*starlark.Dict],
Validator: func(value starlark.Value) *startosis_errors.InterpretationError {
return builtin_argument.StringMappingToString(value, LabelsAttr)

return builtin_argument.ServiceLabelsValidator(value, LabelsAttr)
},
},
{
Expand Down
4 changes: 4 additions & 0 deletions enclave-manager/web/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { defineConfig } from "cypress";
export default defineConfig({
e2e: {
defaultCommandTimeout: 20000,
retries: {
runMode: 2,
openMode: 0,
},
setupNodeEvents(on, config) {
// implement node event listeners here
},
Expand Down
6 changes: 3 additions & 3 deletions enclave-manager/web/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Cypress.Commands.add("createAndGoToEnclave", (enclaveName: string) => {

cy.contains("button", "Run").click();

cy.url({ timeout: 10 * 1000 }).should("match", /enclave\/[^/]+\/logs/);
cy.url({ timeout: 30 * 1000 }).should("match", /enclave\/[^/]+\/logs/);

cy.contains("button", "Edit").should("be.disabled");
cy.contains("Validating", { timeout: 10 * 1000 });
cy.contains("Script completed", { timeout: 10 * 1000 });
cy.contains("Validating", { timeout: 30 * 1000 });
cy.contains("Script completed", { timeout: 30 * 1000 });
cy.contains("button", "Edit").should("be.enabled");

// Go to the enclave overview
Expand Down
2 changes: 1 addition & 1 deletion enclave-manager/web/lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["packages/*"],
"version": "0.86.17",
"version": "0.86.18",
"npmClient": "yarn",
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useNx": false,
Expand Down
4 changes: 2 additions & 2 deletions enclave-manager/web/packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kurtosis/emui-app",
"version": "0.86.17",
"version": "0.86.18",
"private": true,
"homepage": ".",
"dependencies": {
Expand All @@ -10,7 +10,7 @@
"html-react-parser": "^4.2.2",
"js-cookie": "^3.0.5",
"kurtosis-cloud-indexer-sdk": "^0.0.2",
"kurtosis-ui-components": "0.86.17",
"kurtosis-ui-components": "0.86.18",
"react-error-boundary": "^4.0.11",
"react-hook-form": "^7.47.0",
"react-mentions": "^4.4.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function transformFormArgsToKurtosisArgs(data: Record<string, any>, kurto
case ArgumentValueType.LIST:
return value.map((v: any) => transformValue(innerValuetype, v));
case ArgumentValueType.BOOL:
return isDefined(value) ? isStringTrue(value) : null;
return isDefined(value) && value !== "" ? isStringTrue(value) : null;
case ArgumentValueType.INTEGER:
return isNaN(value) || isNaN(parseFloat(value)) ? null : parseFloat(value);
case ArgumentValueType.STRING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type EnclaveBuilderModalProps = {
export const EnclaveBuilderModal = (props: EnclaveBuilderModalProps) => {
const variableContextKey = useRef(0);
const [error, setError] = useState<string>();
const [currentStarlarkPreview, setCurrentStarlarkPreview] = useState<string>();

const {
nodes: initialNodes,
Expand Down
2 changes: 1 addition & 1 deletion enclave-manager/web/packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kurtosis-ui-components",
"version": "0.86.17",
"version": "0.86.18",
"private": false,
"main": "build/index",
"description": "This repo contains components used by Kurtosis UI applications.",
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.86.17
0.86.18

0 comments on commit d1e27eb

Please sign in to comment.