Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/engine/server/google.g…
Browse files Browse the repository at this point in the history
…olang.org/grpc-1.56.3
  • Loading branch information
h4ck3rk3y authored Dec 6, 2023
2 parents aa03a4b + 3d7d465 commit f02bd9e
Show file tree
Hide file tree
Showing 135 changed files with 3,961 additions and 1,101 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,10 @@ workflows:
"pattern": "https://twitter.com/.*"
},
{
"pattern": "http://localhost:3000"
"pattern": "http://localhost:.*"
},
{
"pattern": "http://localhost/.*"
}
]
}
Expand Down
104 changes: 104 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,109 @@
# Changelog

## [0.85.42](https://github.com/kurtosis-tech/kurtosis/compare/0.85.41...0.85.42) (2023-12-05)


### Bug Fixes

* Rename jwtToken cookie ([#1876](https://github.com/kurtosis-tech/kurtosis/issues/1876)) ([3b13372](https://github.com/kurtosis-tech/kurtosis/commit/3b13372004a0448f5e40154004b2b883e5a5d57a))

## [0.85.41](https://github.com/kurtosis-tech/kurtosis/compare/0.85.40...0.85.41) (2023-12-05)


### Features

* emui design improvements ([#1892](https://github.com/kurtosis-tech/kurtosis/issues/1892)) ([9268a24](https://github.com/kurtosis-tech/kurtosis/commit/9268a2450c125ee95721d0c51a401bf68db5d68a))
* emui handle json/yaml input interchangably ([#1891](https://github.com/kurtosis-tech/kurtosis/issues/1891)) ([cd4263b](https://github.com/kurtosis-tech/kurtosis/commit/cd4263bed4e784eca2dcd9c118e5b69c5d353f06))

## [0.85.40](https://github.com/kurtosis-tech/kurtosis/compare/0.85.39...0.85.40) (2023-12-02)


### Features

* change change license to Apache 2.0 ([#1884](https://github.com/kurtosis-tech/kurtosis/issues/1884)) ([64084d8](https://github.com/kurtosis-tech/kurtosis/commit/64084d8e7ce18ebb86b05d17035db90971c2f867))


### Bug Fixes

* cache bug ([#1885](https://github.com/kurtosis-tech/kurtosis/issues/1885)) ([82e46e2](https://github.com/kurtosis-tech/kurtosis/commit/82e46e249006e85b4f71824798370968d8ee7731))
* change tail package ([#1874](https://github.com/kurtosis-tech/kurtosis/issues/1874)) ([f4e87ec](https://github.com/kurtosis-tech/kurtosis/commit/f4e87ec6757219b089ca3b7d2692bc15c42f8fd1))

## [0.85.39](https://github.com/kurtosis-tech/kurtosis/compare/0.85.38...0.85.39) (2023-11-30)


### Features

* emui package details page ([#1873](https://github.com/kurtosis-tech/kurtosis/issues/1873)) ([e2b75b2](https://github.com/kurtosis-tech/kurtosis/commit/e2b75b25d597ddfc49f0ebec1de5e2f7ca840281))
* User service ports Traefik Docker labels ([#1871](https://github.com/kurtosis-tech/kurtosis/issues/1871)) ([d18f20e](https://github.com/kurtosis-tech/kurtosis/commit/d18f20eee93d94739ea9bf497fc5d6780452d57d))


### Bug Fixes

* move log collector creation logic ([#1870](https://github.com/kurtosis-tech/kurtosis/issues/1870)) ([b695e27](https://github.com/kurtosis-tech/kurtosis/commit/b695e27742c653b635183c4db04e739b182eaec6))
* service name collision error message ([#1863](https://github.com/kurtosis-tech/kurtosis/issues/1863)) ([164b316](https://github.com/kurtosis-tech/kurtosis/commit/164b316d335e128668c9ca8b9f9eb74b22efe9ce))
* Update custom Nix dev deps to work on also linux ([#1862](https://github.com/kurtosis-tech/kurtosis/issues/1862)) ([d11cd37](https://github.com/kurtosis-tech/kurtosis/commit/d11cd37d5b733114937dd3d4e874255a03c1399d))

## [0.85.38](https://github.com/kurtosis-tech/kurtosis/compare/0.85.37...0.85.38) (2023-11-29)


### Bug Fixes

* support logs db for k8s ([#1864](https://github.com/kurtosis-tech/kurtosis/issues/1864)) ([8afa9c7](https://github.com/kurtosis-tech/kurtosis/commit/8afa9c7a7fcd7d7370e2d9740fb4e8e7bc6fe463))

## [0.85.37](https://github.com/kurtosis-tech/kurtosis/compare/0.85.36...0.85.37) (2023-11-29)


### Features

* emui catalog overview ([#1865](https://github.com/kurtosis-tech/kurtosis/issues/1865)) ([2f118d9](https://github.com/kurtosis-tech/kurtosis/commit/2f118d92da40f2f5933c5d8f58a5a08c29b96c9a))

## [0.85.36](https://github.com/kurtosis-tech/kurtosis/compare/0.85.35...0.85.36) (2023-11-27)


### Features

* emui enhancements ([#1847](https://github.com/kurtosis-tech/kurtosis/issues/1847)) ([633ba42](https://github.com/kurtosis-tech/kurtosis/commit/633ba428c9c2ca9acd860ec97b1b37af3eed28b3))


### Bug Fixes

* make run_python not create additional files artifact ([#1851](https://github.com/kurtosis-tech/kurtosis/issues/1851)) ([82d0058](https://github.com/kurtosis-tech/kurtosis/commit/82d005817af05c46e67fd7c19946af4cc13135c9))
* only print image banner if image arch is non empty string and different ([#1854](https://github.com/kurtosis-tech/kurtosis/issues/1854)) ([75b8c84](https://github.com/kurtosis-tech/kurtosis/commit/75b8c844243a55bdf5ddbd653e229e64ac555e0b))
* tasks remove containers after they are done ([#1850](https://github.com/kurtosis-tech/kurtosis/issues/1850)) ([179c541](https://github.com/kurtosis-tech/kurtosis/commit/179c54121277b6d9d757a7170e4ec86e72115225))

## [0.85.35](https://github.com/kurtosis-tech/kurtosis/compare/0.85.34...0.85.35) (2023-11-22)


### Features

* upgrade golang grpc dependency ([#1840](https://github.com/kurtosis-tech/kurtosis/issues/1840)) ([2377868](https://github.com/kurtosis-tech/kurtosis/commit/2377868363c2bdea6f38478e156269339574622e))


### Bug Fixes

* always restart logs aggregator ([#1841](https://github.com/kurtosis-tech/kurtosis/issues/1841)) ([7e6382f](https://github.com/kurtosis-tech/kurtosis/commit/7e6382f0671c3776e31381a12da31f9754222438))

## [0.85.34](https://github.com/kurtosis-tech/kurtosis/compare/0.85.33...0.85.34) (2023-11-21)


### Bug Fixes

* display the relevant number in the error message ([#1835](https://github.com/kurtosis-tech/kurtosis/issues/1835)) ([a8c24bc](https://github.com/kurtosis-tech/kurtosis/commit/a8c24bcbeff813217e10a222001ce05c325de03c))

## [0.85.33](https://github.com/kurtosis-tech/kurtosis/compare/0.85.32...0.85.33) (2023-11-20)


### Features

* search in service logs ([#1830](https://github.com/kurtosis-tech/kurtosis/issues/1830)) ([7fce5b5](https://github.com/kurtosis-tech/kurtosis/commit/7fce5b59d1060f99f8c2cbd54d7bb8483150310e)), closes [#1791](https://github.com/kurtosis-tech/kurtosis/issues/1791)

## [0.85.32](https://github.com/kurtosis-tech/kurtosis/compare/0.85.31...0.85.32) (2023-11-20)


### Features

* emui auth via cookie ([#1783](https://github.com/kurtosis-tech/kurtosis/issues/1783)) ([d5d79d8](https://github.com/kurtosis-tech/kurtosis/commit/d5d79d8c4a67d175d9dc0d842e9edbb6068b8c6c))

## [0.85.31](https://github.com/kurtosis-tech/kurtosis/compare/0.85.30...0.85.31) (2023-11-17)


Expand Down
8 changes: 4 additions & 4 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.85.31
Licensed Work: Kurtosis 0.85.42
The Licensed Work is (c) 2023 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,9 +12,9 @@ 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: 2027-11-17
Change Date: 2027-12-05

Change License: AGPLv3 (GNU Affero General Public License Version 3)
Change License: Apache 2.0 (Apache License, Version 2.0)

For information about alternative licensing arrangements for the Software,
please visit: https://kurtosis.com/
Expand Down Expand Up @@ -97,4 +97,4 @@ other recipients of the licensed work to be provided by Licensor:

3. To specify a Change Date.

4. Not to modify this License in any other way.
4. Not to modify this License in any other way.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Check out an introductory demo video here:

How do I get going?
===================
To see Kurtosis in action, first install it using the instructions [here](https://docs.kurtosis.com/install). _Note that we're working on a cloud-hosted version of Kurtosis that doesn't require any local installation; if this is interesting to you then let us know [here](https://mp2k8nqxxgj.typeform.com/to/U1HcXT1H) and we'll let you know when it's available._
To see Kurtosis in action, first install it using the instructions [here](https://docs.kurtosis.com/install) or visit [Kurtosis Cloud][https://cloud.kurtosis.com/] to provision a remote host.

Then, run the [Redis voting app Kurtosis package](https://github.com/kurtosis-tech/awesome-kurtosis/tree/main/redis-voting-app):

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.85.31"
KurtosisVersion = "0.85.42"
// !!!!!!!!!!! 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.85.31"
version = "0.85.42"
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.85.31",
"version": "0.85.42",
"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.85.31"
export const KURTOSIS_VERSION: string = "0.85.42"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
10 changes: 8 additions & 2 deletions connect-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"
)

const (
ConnectHTTPServerLogPrefix = "[Connect-HTTP-ERROR]"
)

type ConnectServer struct {
listenPort uint16
path string
Expand Down Expand Up @@ -59,8 +64,9 @@ func (server *ConnectServer) RunServerUntilStopped(
mux.Handle(server.path, server.handler)

httpServer := http.Server{
Addr: fmt.Sprintf(":%v", server.listenPort),
Handler: cors.Handler(h2c.NewHandler(mux, &http2.Server{})),
Addr: fmt.Sprintf(":%v", server.listenPort),
Handler: cors.Handler(h2c.NewHandler(mux, &http2.Server{})),
ErrorLog: log.New(logrus.StandardLogger().Out, ConnectHTTPServerLogPrefix, log.Ldate|log.Ltime|log.Lshortfile),
}

go func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,14 @@ func (backend *DockerKurtosisBackend) CreateLogsCollectorForEnclave(
if maybeLogsAggregator == nil {
logrus.Warnf("Logs aggregator container does not exist. This is unexpected as docker should have restarted the container automatically.")
logrus.Warnf("This can be fixed by restarting the engine using `kurtosis engine restart` and attempting to create the enclave again.")
return nil, stacktrace.Propagate(err, "No logs aggregator container exists. The logs collector cannot be run without a logs aggregator.")
return nil, stacktrace.NewError("No logs aggregator container exists. The logs collector cannot be run without a logs aggregator.")
}
if maybeLogsAggregator.GetStatus() != container.ContainerStatus_Running {
logrus.Warnf("Logs aggregator exists but is not running. Instead container status is '%v'. This is unexpected as docker should have restarted the container automatically.",
maybeLogsAggregator.GetStatus())
logrus.Warnf("This can be fixed by restarting the engine using `kurtosis engine restart` and attempting to create the enclave again.")
return nil, stacktrace.Propagate(err,
"The logs aggregator container exists but is not running. Instead container status is '%v'. The logs collector cannot be run without a logs aggregator.",
return nil, stacktrace.NewError(
"The logs aggregator container exists but is not running. Instead logs aggregator container status is '%v'. The logs collector cannot be run without a logs aggregator.",
maybeLogsAggregator.GetStatus(),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const (

shouldFetchStoppedContainersWhenDumpingEnclave = true

defaultHttpLogsCollectorPortNum = uint16(9712)
defaultTcpLogsCollectorPortNum = uint16(9713)

serializedArgs = "SERIALIZED_ARGS"
)

Expand Down Expand Up @@ -148,21 +145,7 @@ func (backend *DockerKurtosisBackend) CreateEnclave(ctx context.Context, enclave

// TODO: return production mode for create enclave request as well
newEnclave := enclave.NewEnclave(enclaveUuid, enclaveName, enclave.EnclaveStatus_Empty, &creationTime, false)
// TODO the logs collector has a random private ip address in the enclave network that must be tracked
if _, err := backend.CreateLogsCollectorForEnclave(ctx, enclaveUuid, defaultTcpLogsCollectorPortNum, defaultHttpLogsCollectorPortNum); err != nil {
return nil, stacktrace.Propagate(err, "An error occurred creating the logs collector with TCP port number '%v' and HTTP port number '%v'", defaultTcpLogsCollectorPortNum, defaultHttpLogsCollectorPortNum)
}
shouldDeleteLogsCollector := true
defer func() {
if shouldDeleteLogsCollector {
err = backend.DestroyLogsCollectorForEnclave(ctx, enclaveUuid)
if err != nil {
logrus.Errorf("Couldn't cleanup logs collector for enclave '%v' as the following error was thrown:\n%v", enclaveUuid, err)
}
}
}()

shouldDeleteLogsCollector = false
shouldDeleteNetwork = false
shouldDeleteVolume = false
return newEnclave, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (vector *vectorContainerConfigProvider) GetContainerArgs(

// The logs aggregator should ALWAYS be running to ensure that no logs are lost for services in enclaves
// Thus, instruct docker to restart the container if it exits with non-zero status code for whatever reason
restartPolicy := docker_manager.RestartPolicy("on-failure")
restartPolicy := docker_manager.RestartPolicy(docker_manager.RestartAlways)

createAndStartArgs := docker_manager.NewCreateAndStartContainerArgsBuilder(
containerImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ const (
type RestartPolicy string

const (
RestartAlways = "always"
RestartOnFailure = "on-failure"
NoRestart = ""
)
Expand Down Expand Up @@ -1194,7 +1195,7 @@ func (manager *DockerManager) FetchImageIfMissing(ctx context.Context, dockerIma
dockerImage = dockerImage + dockerTagSeparatorChar + dockerDefaultTag
}
logrus.Tracef("Checking if image '%v' is available locally...", dockerImage)
doesImageExistLocally, err := manager.isImageAvailableLocally(ctx, dockerImage)
doesImageExistLocally, err := manager.isImageAvailableLocally(dockerImage)
if err != nil {
return false, stacktrace.Propagate(err, "An error occurred checking for local availability of Docker image '%v'", dockerImage)
}
Expand Down Expand Up @@ -1223,7 +1224,7 @@ func (manager *DockerManager) FetchLatestImage(ctx context.Context, dockerImage
dockerImage = dockerImage + dockerTagSeparatorChar + dockerDefaultTag
}
logrus.Tracef("Checking if image '%v' is available locally...", dockerImage)
doesImageExistLocally, err := manager.isImageAvailableLocally(ctx, dockerImage)
doesImageExistLocally, err := manager.isImageAvailableLocally(dockerImage)
if err != nil {
return stacktrace.Propagate(err, "An error occurred checking for local availability of Docker image '%v'", dockerImage)
}
Expand Down Expand Up @@ -1344,11 +1345,14 @@ func (manager *DockerManager) GetAvailableCPUAndMemory(ctx context.Context) (com
// INSTANCE HELPER FUNCTIONS
//
// =================================================================================================================
func (manager *DockerManager) isImageAvailableLocally(ctx context.Context, imageName string) (bool, error) {
func (manager *DockerManager) isImageAvailableLocally(imageName string) (bool, error) {
// Own context for checking if the image is locally available because we do not want to cancel this works in case the main context in the request is cancelled
// if the first request fails the image will be ready for following request making the process faster
checkImageAvailabilityCtx := context.Background()
referenceArg := filters.Arg("reference", imageName)
filterArgs := filters.NewArgs(referenceArg)
images, err := manager.dockerClient.ImageList(
ctx,
checkImageAvailabilityCtx,
types.ImageListOptions{
All: true,
Filters: filterArgs,
Expand Down Expand Up @@ -1378,7 +1382,7 @@ func (manager *DockerManager) pullImage(context context.Context, imageName strin
return stacktrace.Propagate(err, "An error occurred communicating with docker engine")
}
logrus.Infof("Pulling image '%s'", imageName)
err, retryWithLinuxAmd64 := pullImage(context, manager.dockerClientNoTimeout, imageName, defaultPlatform)
err, retryWithLinuxAmd64 := pullImage(manager.dockerClientNoTimeout, imageName, defaultPlatform)
if err == nil {
return nil
}
Expand All @@ -1387,7 +1391,7 @@ func (manager *DockerManager) pullImage(context context.Context, imageName strin
}
// we retry with linux/amd64
logrus.Debugf("Retrying pulling image '%s' for '%s'", imageName, linuxAmd64)
err, _ = pullImage(context, manager.dockerClientNoTimeout, imageName, linuxAmd64)
err, _ = pullImage(manager.dockerClientNoTimeout, imageName, linuxAmd64)
if err != nil {
return stacktrace.Propagate(err, "Had previously failed with a manifest error so tried pulling image '%v' for platform '%v' but failed", imageName, linuxAmd64)
}
Expand Down Expand Up @@ -1994,9 +1998,12 @@ func getEndpointSettingsForIpAddress(ipAddress string, alias string) *network.En
return config
}

func pullImage(ctx context.Context, dockerClient *client.Client, imageName string, platform string) (error, bool) {
func pullImage(dockerClient *client.Client, imageName string, platform string) (error, bool) {
// Own context for pulling images because we do not want to cancel this works in case the main context in the request is cancelled
// if the fist request fails the image will be ready for following request making the process faster
pullImageCtx := context.Background()
logrus.Tracef("Starting pulling '%s' for platform '%s'", imageName, platform)
out, err := dockerClient.ImagePull(ctx, imageName, types.ImagePullOptions{
out, err := dockerClient.ImagePull(pullImageCtx, imageName, types.ImagePullOptions{
All: false,
RegistryAuth: "",
PrivilegeFunc: nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ func ValidateUserCustomLabelKey(str string) error {
return nil
}

// CreateNewDockerUserCustomLabelKey creates a Traefik Docker label with the Traefik label key prefix
func CreateNewDockerTraefikLabelKey(str string) (*DockerLabelKey, error) {
labelKeyStr := traefikLabelKeyPrefixStr + str
return createNewDockerLabelKey(labelKeyStr)
}

func createNewDockerLabelKey(str string) (*DockerLabelKey, error) {
if err := validate(str); err != nil {
return nil, stacktrace.NewError("Label key string '%v' is not valid", str)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const (
logsServiceUuidDockerLabelKey = "service_uuid"
logsServiceShortUuidDockerLabelKey = "service_short_uuid"
logsServiceNameDockerLabelKey = "service_name"

// Traefik label keys
traefikLabelKeyPrefixStr = "traefik."
)

// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DO NOT CHANGE THESE VALUES !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down
Loading

0 comments on commit f02bd9e

Please sign in to comment.