Skip to content

Commit

Permalink
Merge branch 'main' into laurent/self-cloud-hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentluce committed Jun 11, 2024
2 parents 130a139 + 9ff7b9d commit 78b175f
Show file tree
Hide file tree
Showing 20 changed files with 329 additions and 196 deletions.
1 change: 0 additions & 1 deletion .github/workflows/change-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
api/scripts/update-package-versions.sh "$(cat version.txt)"
api/scripts/update-own-version-constants.sh "$(cat version.txt)"
enclave-manager/web/scripts/update-package-versions.sh "$(cat version.txt)"
scripts/update-license-version.sh "$(cat version.txt)"
- uses: stefanzweifel/git-auto-commit-action@v5
with:
token: "${{ secrets.RELEASER_TOKEN }}"
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## [0.90.0](https://github.com/kurtosis-tech/kurtosis/compare/0.89.18...0.90.0) (2024-06-11)


### ⚠ BREAKING CHANGES

* change license to apache 2.0 ([#2481](https://github.com/kurtosis-tech/kurtosis/issues/2481))

### Features

* change license to apache 2.0 ([#2481](https://github.com/kurtosis-tech/kurtosis/issues/2481)) ([d884144](https://github.com/kurtosis-tech/kurtosis/commit/d88414497e38c32982cf52ac41a5c08ee5927298))

## [0.89.18](https://github.com/kurtosis-tech/kurtosis/compare/0.89.17...0.89.18) (2024-06-10)


### Bug Fixes

* exec recipe in ready condition ([#2479](https://github.com/kurtosis-tech/kurtosis/issues/2479)) ([288ddba](https://github.com/kurtosis-tech/kurtosis/commit/288ddba53468a376d10ef720f9ab197633237201))

## [0.89.17](https://github.com/kurtosis-tech/kurtosis/compare/0.89.16...0.89.17) (2024-06-07)


### Features

* add optional names to tasks ([#2477](https://github.com/kurtosis-tech/kurtosis/issues/2477)) ([5d7bb67](https://github.com/kurtosis-tech/kurtosis/commit/5d7bb677ba7ac854c61b78247432bfd8da55e920))
* port name validation RFC-6335 ([#2474](https://github.com/kurtosis-tech/kurtosis/issues/2474)) ([ffbd30b](https://github.com/kurtosis-tech/kurtosis/commit/ffbd30bbb55bf7d4c5cf3d955d221c1c48f67ce4))

## [0.89.16](https://github.com/kurtosis-tech/kurtosis/compare/0.89.15...0.89.16) (2024-06-05)


Expand Down
301 changes: 201 additions & 100 deletions LICENSE.md

Large diffs are not rendered by default.

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.89.16"
KurtosisVersion = "0.90.0"
// !!!!!!!!!!! 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.89.16"
version = "0.90.0"
license = "BUSL-1.1"
description = "Rust SDK for Kurtosis"
edition = "2021"
Expand Down
17 changes: 8 additions & 9 deletions api/typescript/package-lock.json

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

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.89.16",
"version": "0.90.0",
"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.89.16"
export const KURTOSIS_VERSION: string = "0.90.0"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
6 changes: 3 additions & 3 deletions api/typescript/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
typescript "4.5.2"

"@grpc/grpc-js@^1.4.4":
version "1.8.8"
resolved "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.8.8.tgz"
integrity sha512-4gfDqMLXTrorvYTKA1jL22zLvVwiHJ73t6Re1OHwdCFRjdGTDOVtSJuaWhtHaivyeDGg0LeCkmU77MTKoV3wPA==
version "1.8.22"
resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.8.22.tgz#847930c9af46e14df05b57fc12325db140ceff1d"
integrity sha512-oAjDdN7fzbUi+4hZjKG96MR6KTEubAeMpQEb+77qy+3r0Ua5xTFuie6JOLr4ZZgl5g+W5/uRTS2M1V8mVAFPuA==
dependencies:
"@grpc/proto-loader" "^0.7.0"
"@types/node" ">=12.12.47"
Expand Down
2 changes: 1 addition & 1 deletion cli/cli/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ brews:
commit_msg_template: "Automated formula update for the CLI, version {{ .Tag }}"
homepage: "https://www.kurtosistech.com"
description: "CLI for managing Kurtosis environments."
license: "BSL"
license: "Apache-2.0"

# NOTE: Goreleaser *should* automatically detect the binaries packaged inside the archives being installed by the Homebrew formula, but it doesn't due to:
# https://github.com/goreleaser/goreleaser/issues/2488
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/kurtosis-tech/kurtosis/core/server/api_container/server/startosis_engine/startosis_packages"
"github.com/kurtosis-tech/kurtosis/core/server/api_container/server/startosis_engine/startosis_validator"
"github.com/kurtosis-tech/stacktrace"
"github.com/xtgo/uuid"
"go.starlark.net/starlark"
"go.starlark.net/starlarkstruct"
"strings"
Expand Down Expand Up @@ -60,6 +59,11 @@ func NewRunPythonService(
Name: RunPythonBuiltinName,

Arguments: []*builtin_argument.BuiltinArgument{
{
Name: TaskNameArgName,
IsOptional: true,
ZeroValueProvider: builtin_argument.ZeroValueProvider[starlark.String],
},
{
Name: RunArgName,
IsOptional: false,
Expand Down Expand Up @@ -163,8 +167,11 @@ type RunPythonCapabilities struct {
}

func (builtin *RunPythonCapabilities) Interpret(locatorOfModuleInWhichThisBuiltinIsBeingCalled string, arguments *builtin_argument.ArgumentValuesSet) (starlark.Value, *startosis_errors.InterpretationError) {
randomUuid := uuid.NewRandom()
builtin.name = fmt.Sprintf("task-%v", randomUuid.String())
taskName, err := getTaskNameFromArgs(arguments)
if err != nil {
return nil, startosis_errors.WrapWithInterpretationError(err, "Unable to get task name from args.")
}
builtin.name = taskName

pythonScript, err := builtin_argument.ExtractArgumentValue[starlark.String](arguments, RunArgName)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/kurtosis-tech/kurtosis/core/server/api_container/server/startosis_engine/startosis_packages"
"github.com/kurtosis-tech/kurtosis/core/server/api_container/server/startosis_engine/startosis_validator"
"github.com/kurtosis-tech/stacktrace"
"github.com/xtgo/uuid"
"go.starlark.net/starlark"
"go.starlark.net/starlarkstruct"
)
Expand All @@ -49,6 +48,11 @@ func NewRunShService(
Name: RunShBuiltinName,

Arguments: []*builtin_argument.BuiltinArgument{
{
Name: TaskNameArgName,
IsOptional: true,
ZeroValueProvider: builtin_argument.ZeroValueProvider[starlark.String],
},
{
Name: RunArgName,
IsOptional: false,
Expand Down Expand Up @@ -141,6 +145,12 @@ type RunShCapabilities struct {
}

func (builtin *RunShCapabilities) Interpret(locatorOfModuleInWhichThisBuiltinIsBeingCalled string, arguments *builtin_argument.ArgumentValuesSet) (starlark.Value, *startosis_errors.InterpretationError) {
taskName, err := getTaskNameFromArgs(arguments)
if err != nil {
return nil, startosis_errors.WrapWithInterpretationError(err, "Unable to get task name from args.")
}
builtin.name = taskName

runCommand, err := builtin_argument.ExtractArgumentValue[starlark.String](arguments, RunArgName)
if err != nil {
return nil, startosis_errors.WrapWithInterpretationError(err, "Unable to extract value for '%s' argument", RunArgName)
Expand Down Expand Up @@ -225,8 +235,6 @@ func (builtin *RunShCapabilities) Interpret(locatorOfModuleInWhichThisBuiltinIsB
return nil, startosis_errors.NewInterpretationError("An error occurred while generating UUID for future reference for %v instruction", RunShBuiltinName)
}
builtin.resultUuid = resultUuid
randomUuid := uuid.NewRandom()
builtin.name = fmt.Sprintf("task-%v", randomUuid.String())

defaultDescription := runningShScriptPrefix
if len(builtin.run) < shScriptPrintCharLimit {
Expand All @@ -253,7 +261,7 @@ func (builtin *RunShCapabilities) Validate(_ *builtin_argument.ArgumentValuesSet
// Make task as its own entity instead of currently shown under services
func (builtin *RunShCapabilities) Execute(ctx context.Context, _ *builtin_argument.ArgumentValuesSet) (string, error) {
// swap env vars with their runtime value
serviceConfigWithReplacedEnvVars, err := repacaeMagicStringsInEnvVars(builtin.runtimeValueStore, builtin.serviceConfig)
serviceConfigWithReplacedEnvVars, err := replaceMagicStringsInEnvVars(builtin.runtimeValueStore, builtin.serviceConfig)
if err != nil {
return "", stacktrace.Propagate(err, "An error occurred replacing magic strings in env vars.")
}
Expand Down Expand Up @@ -343,7 +351,7 @@ func getCommandToRun(builtin *RunShCapabilities) (string, error) {
return maybeSubCommandWithRuntimeValues, nil
}

func repacaeMagicStringsInEnvVars(runtimeValueStore *runtime_value_store.RuntimeValueStore, serviceConfig *service.ServiceConfig) (
func replaceMagicStringsInEnvVars(runtimeValueStore *runtime_value_store.RuntimeValueStore, serviceConfig *service.ServiceConfig) (
*service.ServiceConfig,
error) {
var envVars map[string]string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/image_download_mode"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/image_registry_spec"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/nix_build_spec"
"github.com/xtgo/uuid"
"reflect"
"strings"
"time"
Expand All @@ -32,6 +33,7 @@ import (
// shared constants
const (
ImageNameArgName = "image"
TaskNameArgName = "name"
RunArgName = "run"
StoreFilesArgName = "store"
WaitArgName = "wait"
Expand Down Expand Up @@ -312,3 +314,16 @@ func extractEnvVarsIfDefined(arguments *builtin_argument.ArgumentValuesSet) (*ma
}
return &envVars, nil
}

func getTaskNameFromArgs(arguments *builtin_argument.ArgumentValuesSet) (string, error) {
if arguments.IsSet(TaskNameArgName) {
taskName, err := builtin_argument.ExtractArgumentValue[starlark.String](arguments, TaskNameArgName)
if err != nil {
return "", startosis_errors.WrapWithInterpretationError(err, "Unable to extract value for '%s' argument", TaskNameArgName)
}
return taskName.GoString(), nil
} else {
randomUuid := uuid.NewRandom()
return fmt.Sprintf("task-%v", randomUuid.String()), nil
}
}
26 changes: 26 additions & 0 deletions docs/docs/api-reference/starlark-reference/ready-condition.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,32 @@ def run(plan):
# finally we execute the add_service instruction using all the pre-configured data
plan.add_service(name = "web-server", config = service_config)
```
and with an `ExecRecipe`:

```python
def run(plan):
# we define the recipe first
exec_recipe = ExecRecipe(
command = ["echo '{"key":"Hi}'],
)

ready_conditions_config = ReadyCondition(
recipe = exec_recipe,
# note how the possible fields are based on the result of executing the ExecRecipe - in this case, .extract
field = "output"
assertion = "!=",
target_value = "",
interval = "10s",
timeout = "200s",
)

service_config = ServiceConfig(
image = "ubuntu",
ready_conditions= ready_conditions_config,
)

plan.add_service(name = "web-server", config = service_config)
```

<!--------------- ONLY LINKS BELOW THIS POINT ---------------------->

Expand Down
26 changes: 17 additions & 9 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@
"@docusaurus/theme-search-algolia" "2.3.1"
"@docusaurus/types" "2.3.1"

"@docusaurus/[email protected]", "react-loadable@npm:@docusaurus/[email protected]":
"@docusaurus/[email protected]":
version "5.5.2"
resolved "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
Expand Down Expand Up @@ -2853,11 +2853,11 @@ brace-expansion@^2.0.1:
balanced-match "^1.0.0"

braces@^3.0.2, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
version "3.0.3"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
dependencies:
fill-range "^7.0.1"
fill-range "^7.1.1"

browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.18.1, browserslist@^4.21.3, browserslist@^4.21.4:
version "4.21.4"
Expand Down Expand Up @@ -4091,10 +4091,10 @@ filesize@^8.0.6:
resolved "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz"
integrity sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==

fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz"
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
fill-range@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
dependencies:
to-regex-range "^5.0.1"

Expand Down Expand Up @@ -6856,6 +6856,14 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1:
dependencies:
"@babel/runtime" "^7.10.3"

"react-loadable@npm:@docusaurus/[email protected]":
version "5.5.2"
resolved "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz"
integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
dependencies:
"@types/react" "*"
prop-types "^15.6.2"

react-router-config@^5.1.1:
version "5.1.1"
resolved "https://registry.npmjs.org/react-router-config/-/react-router-config-5.1.1.tgz"
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.89.16",
"version": "0.90.0",
"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.89.16",
"version": "0.90.0",
"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.31",
"kurtosis-ui-components": "0.89.16",
"kurtosis-ui-components": "0.90.0",
"react-error-boundary": "^4.0.11",
"react-hook-form": "^7.47.0",
"react-mentions": "^4.4.10",
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.89.16",
"version": "0.90.0",
"private": false,
"main": "build/index",
"description": "This repo contains components used by Kurtosis UI applications.",
Expand Down
Loading

0 comments on commit 78b175f

Please sign in to comment.