Skip to content

Commit

Permalink
Merge branch 'main' into tedi/dryrun
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 authored Feb 22, 2024
2 parents 4ab95ea + e584751 commit fd8ac0c
Show file tree
Hide file tree
Showing 91 changed files with 1,079 additions and 561 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/check-proto-break.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ on:
- edited

jobs:
check-if-code-change:
runs-on: ubuntu-latest
outputs:
change: ${{ steps.check.outputs.change }}
steps:
- uses: actions/checkout@v4
with:
go-version: '1.20'
fetch-depth: 0
- run: |
if git --no-pager diff --exit-code origin/main...HEAD -- . ':!docs' ':!*.md'; then
echo "::set-output name=change::false"
else
echo "::set-output name=change::true"
fi
id: check
check-proto-break:
needs: check-if-code-change
if: ${{ needs.check-if-code-change.outputs.change == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/gofmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,25 @@ on:
merge_group:

jobs:
check-if-code-change:
runs-on: ubuntu-latest
outputs:
change: ${{ steps.check.outputs.change }}
steps:
- uses: actions/checkout@v4
with:
go-version: '1.20'
fetch-depth: 0
- run: |
if git --no-pager diff --exit-code origin/main...HEAD -- . ':!docs' ':!*.md'; then
echo "::set-output name=change::false"
else
echo "::set-output name=change::true"
fi
id: check
gofmt:
needs: check-if-code-change
if: ${{ needs.check-if-code-change.outputs.change == 'true' }}
name: gofmt
runs-on: ubuntu-latest
steps:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,25 @@ env:
GOLINT_VERSION: v1.53.3

jobs:
check-if-code-change:
runs-on: ubuntu-latest
outputs:
change: ${{ steps.check.outputs.change }}
steps:
- uses: actions/checkout@v4
with:
go-version: '1.20'
fetch-depth: 0
- run: |
if git --no-pager diff --exit-code origin/main...HEAD -- . ':!docs' ':!*.md'; then
echo "::set-output name=change::false"
else
echo "::set-output name=change::true"
fi
id: check
golangci:
needs: check-if-code-change
if: ${{ needs.check-if-code-change.outputs.change == 'true' }}
name: golang-lint
runs-on: ubuntu-latest
steps:
Expand Down
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# Changelog

## [0.87.1](https://github.com/kurtosis-tech/kurtosis/compare/0.87.0...0.87.1) (2024-02-21)


### Features

* use description field in emui logs ([#2199](https://github.com/kurtosis-tech/kurtosis/issues/2199)) ([ad00ee1](https://github.com/kurtosis-tech/kurtosis/commit/ad00ee13c1cab56cd6fb7455dd62900f7fa6b0c0))


### Bug Fixes

* admonition in github guide ([#2195](https://github.com/kurtosis-tech/kurtosis/issues/2195)) ([c2d4d42](https://github.com/kurtosis-tech/kurtosis/commit/c2d4d428e7b2d174cee6161370177eca26a13979))
* Fix the connect to enclave CLI commands in the EM UI ([#2203](https://github.com/kurtosis-tech/kurtosis/issues/2203)) ([2218f4b](https://github.com/kurtosis-tech/kurtosis/commit/2218f4bb561d5b3e15977f3c28d8c3c7a1811699))

## [0.87.0](https://github.com/kurtosis-tech/kurtosis/compare/0.86.25...0.87.0) (2024-02-20)


### ⚠ BREAKING CHANGES

* change registry spec to imagespec ([#2191](https://github.com/kurtosis-tech/kurtosis/issues/2191))

### Features

* change registry spec to imagespec ([#2191](https://github.com/kurtosis-tech/kurtosis/issues/2191)) ([bc20d51](https://github.com/kurtosis-tech/kurtosis/commit/bc20d51fd8fb7d02a8270586dcd4be85564cb415)), closes [#2189](https://github.com/kurtosis-tech/kurtosis/issues/2189)


### Bug Fixes

* change default verbosity to description ([#2173](https://github.com/kurtosis-tech/kurtosis/issues/2173)) ([d3b3de9](https://github.com/kurtosis-tech/kurtosis/commit/d3b3de9b6cb7ff0a83488ccbf8756dfb77814c9c))
* improved some descriptions for starlark instructions ([#2168](https://github.com/kurtosis-tech/kurtosis/issues/2168)) ([d7fdbc5](https://github.com/kurtosis-tech/kurtosis/commit/d7fdbc5fa56f81a9194a68f37d1ab9549dc45abd))

## [0.86.25](https://github.com/kurtosis-tech/kurtosis/compare/0.86.24...0.86.25) (2024-02-16)


### Features

* emui builder python nodes ([#2170](https://github.com/kurtosis-tech/kurtosis/issues/2170)) ([26ad571](https://github.com/kurtosis-tech/kurtosis/commit/26ad5716548edec84e5276ddfe972203c7d5838d))
* kurtosis run `--non-blocking-tasks` ([#2153](https://github.com/kurtosis-tech/kurtosis/issues/2153)) ([6c70247](https://github.com/kurtosis-tech/kurtosis/commit/6c70247531eb0343434101fe54cf6ef028ded873))


### Bug Fixes

* allow for single quotes in run_python ([#2172](https://github.com/kurtosis-tech/kurtosis/issues/2172)) ([4048368](https://github.com/kurtosis-tech/kurtosis/commit/4048368f9fe38d28f1e912a108b79cdbac17a1b7)), closes [#2171](https://github.com/kurtosis-tech/kurtosis/issues/2171)

## [0.86.24](https://github.com/kurtosis-tech/kurtosis/compare/0.86.23...0.86.24) (2024-02-15)


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.24
Licensed Work: Kurtosis 0.87.1
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-15
Change Date: 2028-02-21

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.24"
KurtosisVersion = "0.87.1"
// !!!!!!!!!!! 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.24"
version = "0.87.1"
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.24",
"version": "0.87.1",
"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.24"
export const KURTOSIS_VERSION: string = "0.87.1"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
35 changes: 34 additions & 1 deletion cli/cli/commands/github/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ import (
"github.com/kurtosis-tech/kurtosis/cli/cli/command_framework/lowlevel/args"
"github.com/kurtosis-tech/kurtosis/cli/cli/command_framework/lowlevel/flags"
"github.com/kurtosis-tech/kurtosis/cli/cli/command_str_consts"
"github.com/kurtosis-tech/kurtosis/cli/cli/defaults"
"github.com/kurtosis-tech/kurtosis/cli/cli/helpers/engine_manager"
"github.com/kurtosis-tech/kurtosis/cli/cli/helpers/github_auth_store"
"github.com/kurtosis-tech/kurtosis/cli/cli/helpers/oauth"
"github.com/kurtosis-tech/kurtosis/cli/cli/out"
"github.com/kurtosis-tech/stacktrace"
"github.com/sirupsen/logrus"
)

const (
defaultEngineVersion = ""
restartEngineOnSameVersionIfAnyRunning = true
)

var LoginCmd = &lowlevel.LowlevelKurtosisCommand{
Expand All @@ -24,7 +32,7 @@ var LoginCmd = &lowlevel.LowlevelKurtosisCommand{
PostValidationAndRunFunc: nil,
}

func run(_ context.Context, _ *flags.ParsedFlags, _ *args.ParsedArgs) error {
func run(ctx context.Context, _ *flags.ParsedFlags, _ *args.ParsedArgs) error {
githubAuthStore, err := github_auth_store.GetGitHubAuthStore()
if err != nil {
return stacktrace.Propagate(err, "An error occurred retrieving GitHub auth store.")
Expand All @@ -46,5 +54,30 @@ func run(_ context.Context, _ *flags.ParsedFlags, _ *args.ParsedArgs) error {
return stacktrace.Propagate(err, "An error occurred setting GitHub user: %v", username)
}
out.PrintOutLn(fmt.Sprintf("Successfully logged in GitHub user: %v", username))
logrus.Info("Restarting engine for GitHub auth to take effect...")
err = RestartEngineAfterGitHubAuth(ctx)
if err != nil {
return err
}
logrus.Infof("Engine restarted successfully")
return nil
}

func RestartEngineAfterGitHubAuth(ctx context.Context) error {
engineManager, err := engine_manager.NewEngineManager(ctx)
if err != nil {
return stacktrace.Propagate(err, "An error occurred creating an engine manager.")
}
var engineClientCloseFunc func() error
var restartEngineErr error
_, engineClientCloseFunc, restartEngineErr = engineManager.RestartEngineIdempotently(ctx, defaults.DefaultEngineLogLevel, defaultEngineVersion, restartEngineOnSameVersionIfAnyRunning, defaults.DefaultEngineEnclavePoolSize, defaults.DefaultEnableDebugMode, defaults.DefaultGitHubAuthTokenOverride)
if restartEngineErr != nil {
return stacktrace.Propagate(restartEngineErr, "An error occurred restarting the Kurtosis engine")
}
defer func() {
if err = engineClientCloseFunc(); err != nil {
logrus.Warnf("Error closing the engine client:\n'%v'", err)
}
}()
return nil
}
4 changes: 2 additions & 2 deletions cli/cli/commands/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const (
autogenerateEnclaveIdentifierKeyword = ""

verbosityFlagKey = "verbosity"
defaultVerbosity = "brief"
defaultVerbosity = "description"

parallelismFlagKey = "parallelism"
defaultParallelism = "4"
Expand Down Expand Up @@ -143,7 +143,7 @@ var StarlarkRunCmd = &engine_consuming_kurtosis_command.EngineConsumingKurtosisC
},
{
Key: verbosityFlagKey,
Usage: fmt.Sprintf("The verbosity of the command output: %s. If unset, it defaults to `brief` for a concise and explicit output. Use `detailed` to display the exhaustive list of arguments for each command. `executable` will generate executable Starlark instructions. `description` will just print a description of what is about to happen without any details", strings.Join(command_args_run.VerbosityStrings(), ", ")),
Usage: fmt.Sprintf("The verbosity of the command output: %s. If unset, it defaults to `description` for a crisp output that explains whats about to happen. Use `brief` for a concise yet explicit ouptut, to see the entire instruction thats about to execute. Use `detailed` to display the exhaustive list of arguments for each instruction. `executable` will generate executable Starlark instructions.", strings.Join(command_args_run.VerbosityStrings(), ", ")),
Type: flags.FlagType_String,
Shorthand: "v",
Default: defaultVerbosity,
Expand Down
5 changes: 3 additions & 2 deletions cli/cli/helpers/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type OAuth interface {
func AuthFlow() (string, string, error) {
httpClient := &http.Client{} // nolint: exhaustruct

minimumScopes := []string{"repo", "read:org", "gist"}
minimumScopes := []string{"repo"}

callbackURI := "http://127.0.0.1/callback"
flow := &oauth.Flow{ // nolint: exhaustruct
Expand All @@ -51,6 +51,7 @@ func AuthFlow() (string, string, error) {
Scopes: minimumScopes,
DisplayCode: func(code, verificationURL string) error {
fmt.Fprintf(os.Stdout, "First copy your one-time code: %s\n", code)
fmt.Fprintf(os.Stdout, "Then, press Enter to be directed to a browser window where you'll enter this code.\n")
return nil
},
BrowseURL: func(authURL string) error {
Expand Down Expand Up @@ -162,7 +163,7 @@ p {
<svg height="52" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="52" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<div class="box">
<h1>Successfully authenticated Kurtosis CLI</h1>
<p>You may now close this tab and return to the terminal.</p>
<p>You may now close this tab and return to the terminal. Your Kurtosis Engine will restart for GitHub auth to take effect. </p>
</div>
</body>
`
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package service

import (
"encoding/json"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/image_registry_spec"
"testing"
"time"

"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/image_build_spec"
"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/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/port_spec"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service_directory"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func KurtosisTypeConstructors() []*starlark.Builtin {
starlark.NewBuiltin(service_config.ReadyConditionTypeName, service_config.NewReadyConditionType().CreateBuiltin()),
starlark.NewBuiltin(service_config.ImageBuildSpecTypeName, service_config.NewImageBuildSpecType().CreateBuiltin()),
starlark.NewBuiltin(service_config.NixBuildSpecTypeName, service_config.NewNixBuildSpecType().CreateBuiltin()),
starlark.NewBuiltin(service_config.ImageRegistrySpecTypeName, service_config.NewImageRegistrySpec().CreateBuiltin()),
starlark.NewBuiltin(service_config.ImageSpecTypeName, service_config.NewImageSpec().CreateBuiltin()),
starlark.NewBuiltin(service_config.UserTypeName, service_config.NewUserType().CreateBuiltin()),
starlark.NewBuiltin(service_config.TolerationTypeName, service_config.NewTolerationType().CreateBuiltin()),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (builtin *RunPythonCapabilities) FillPersistableAttributes(builder *enclave
}

func (builtin *RunPythonCapabilities) Description() string {
return "Running a one time python script"
return "Running Python script"
}

func setupRequiredPackages(ctx context.Context, builtin *RunPythonCapabilities) (*exec_result.ExecResult, error) {
Expand Down Expand Up @@ -362,9 +362,9 @@ func getPythonCommandToRun(builtin *RunPythonCapabilities) (string, error) {
maybePythonArgumentsWithRuntimeValueReplaced = append(maybePythonArgumentsWithRuntimeValueReplaced, maybePythonArgumentWithRuntimeValueReplaced)
}
argumentsAsString := strings.Join(maybePythonArgumentsWithRuntimeValueReplaced, spaceDelimiter)

runEscaped := strings.ReplaceAll(builtin.run, `"`, `\"`)
if len(argumentsAsString) > 0 {
return fmt.Sprintf("python -c '%s' %s", builtin.run, argumentsAsString), nil
return fmt.Sprintf(`python -c "%s" %s`, runEscaped, argumentsAsString), nil
}
return fmt.Sprintf("python -c '%s'", builtin.run), nil
return fmt.Sprintf(`python -c "%s"`, runEscaped), nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const (
RunShBuiltinName = "run_sh"

DefaultRunShImageName = "badouralix/curl-jq"
shScriptPrintCharLimit = 80
runningShScriptPrefix = "Running sh script"
)

func NewRunShService(serviceNetwork service_network.ServiceNetwork, runtimeValueStore *runtime_value_store.RuntimeValueStore, nonBlockingMode bool) *kurtosis_plan_instruction.KurtosisPlanInstruction {
Expand Down Expand Up @@ -273,7 +275,10 @@ func (builtin *RunShCapabilities) FillPersistableAttributes(builder *enclave_pla
}

func (builtin *RunShCapabilities) Description() string {
return "Running a one time bash script"
if len(builtin.run) < shScriptPrintCharLimit {
return fmt.Sprintf("%v: `%v`", runningShScriptPrefix, builtin.run)
}
return runningShScriptPrefix
}

func getCommandToRun(builtin *RunShCapabilities) (string, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,5 @@ func (builtin *UploadFilesCapabilities) FillPersistableAttributes(builder *encla
}

func (builtin *UploadFilesCapabilities) Description() string {
return fmt.Sprintf("Uploading file '%v' to files articact '%v'", builtin.src, builtin.artifactName)
return fmt.Sprintf("Uploading file '%v' to files artifact '%v'", builtin.src, builtin.artifactName)
}
Loading

0 comments on commit fd8ac0c

Please sign in to comment.