Skip to content

Commit

Permalink
Merge branch 'main' into omar/chisel-in-apic
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar committed Nov 27, 2023
2 parents dbc851e + 71bdab5 commit 7035af3
Show file tree
Hide file tree
Showing 62 changed files with 646 additions and 1,344 deletions.
26 changes: 17 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ executors:
machine:
# This custom CircleCi Ubuntu image has a pre-installed Docker, so we are not using the CircleCI remote Docker when we
# initiate this machine. More here: https://discuss.circleci.com/t/linux-machine-executor-images-2022-january-q1-update/42831
image: ubuntu-2004:2023.07.1
image: ubuntu-2004:2023.10.1

parameters:
go-version:
Expand Down Expand Up @@ -513,7 +513,7 @@ jobs:
- when:
condition:
and:
- equal: [ "kubernetes", << parameters.cli-cluster-backend >> ]
- equal: [ "kubernetes", << parameters.cli-cluster-backend >> ]
<<: *steps_prepare_testing_k8s_k3s

- when:
Expand Down Expand Up @@ -790,13 +790,18 @@ jobs:
# Execute port print
- run: "${KURTOSIS_BINPATH} port print test-datastore datastore-0 grpc"

# Execute docker compose import
- run: "${KURTOSIS_BINPATH} import --enclave test-import --env << pipeline.parameters.dockerimport-cli-dotenv-relative-path >> << pipeline.parameters.dockerimport-cli-dockerfile-relative-path >>"

# Stop test-datastore enclave
- run: "${KURTOSIS_BINPATH} enclave stop test-datastore"

# Ensure we can still inspect stopped enclaves
- run: "${KURTOSIS_BINPATH} enclave stop test-enclave"
- run: "${KURTOSIS_BINPATH} enclave stop test-datastore"
- run: "${KURTOSIS_BINPATH} enclave inspect test-enclave" # Ensure we can still inspect stopped enclaves
- run: "${KURTOSIS_BINPATH} enclave inspect test-enclave"

# Clean all before compose import to free resources
- run: "${KURTOSIS_BINPATH} clean -a"

# Execute docker compose import
- run: "${KURTOSIS_BINPATH} import --enclave test-import --env << pipeline.parameters.dockerimport-cli-dotenv-relative-path >> << pipeline.parameters.dockerimport-cli-dockerfile-relative-path >>"

# Execute engine functions
- run: "${KURTOSIS_BINPATH} engine stop"
Expand Down Expand Up @@ -824,7 +829,7 @@ jobs:
docker container restart $(echo $apic_container_id)
${KURTOSIS_BINPATH} service rm test-apic-restart service-test
# Test APIC idempotent runs restart
# Test APIC idempotent runs restart
- when:
condition:
equal: [ "docker", << parameters.cli-cluster-backend >> ]
Expand Down Expand Up @@ -1162,7 +1167,10 @@ workflows:
"pattern": "https://twitter.com/.*"
},
{
"pattern": "http://localhost:3000"
"pattern": "http://localhost:.*"
},
{
"pattern": "http://localhost/.*"
}
]
}
Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Changelog

## [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)


### Bug Fixes

* implement minor emui feedback tweaks ([#1827](https://github.com/kurtosis-tech/kurtosis/issues/1827)) ([8161a34](https://github.com/kurtosis-tech/kurtosis/commit/8161a340a9f4724c885ffecbc61b31b1af9bc3fa))

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


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.85.30
Licensed Work: Kurtosis 0.85.35
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,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: 2027-11-17
Change Date: 2027-11-22

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

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.30"
KurtosisVersion = "0.85.35"
// !!!!!!!!!!! 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.30"
version = "0.85.35"
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.30",
"version": "0.85.35",
"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.30"
export const KURTOSIS_VERSION: string = "0.85.35"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
2 changes: 1 addition & 1 deletion cli/cli/commands/service/add/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const (

portMappingSeparatorForLogs = ", "

defaultPortWaitTimeoutStr = "15s"
defaultPortWaitTimeoutStr = "30s"
)

var (
Expand Down
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 @@ -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
2 changes: 1 addition & 1 deletion core/server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.4
google.golang.org/grpc v1.56.2
google.golang.org/grpc v1.56.3
google.golang.org/protobuf v1.31.0
)

Expand Down
4 changes: 2 additions & 2 deletions core/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI=
google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
5 changes: 5 additions & 0 deletions enclave-manager/web/.env.cloudDevelopment
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
REACT_APP_KURTOSIS_DEFAULT_HOST=localhost
REACT_APP_KURTOSIS_DEFAULT_EM_API_PORT=8081

REACT_APP_KURTOSIS_CLOUD_UI_URL=http://localhost:3000
REACT_APP_KURTOSIS_PACKAGE_INDEXER_URL=https://cloud.kurtosis.com:9770
6 changes: 5 additions & 1 deletion enclave-manager/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Removes the build output if present.
### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Open [http://localhost:4000](http://localhost:4000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.
Expand All @@ -42,6 +42,10 @@ Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn start:prod`

Serve your local build on port 4000.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
Expand Down
6 changes: 4 additions & 2 deletions enclave-manager/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"framer-motion": "^10.16.4",
"has-ansi": "^5.0.1",
"html-react-parser": "^4.2.2",
"js-cookie": "^3.0.5",
"lodash": "^4.17.21",
"luxon": "^3.4.3",
"react": "^18.2.0",
Expand All @@ -31,6 +32,7 @@
"true-myth": "^7.1.0"
},
"devDependencies": {
"@types/js-cookie": "^3.0.6",
"@types/luxon": "^3.3.3",
"@types/node": "^16.7.13",
"@types/react": "^18.0.0",
Expand All @@ -48,9 +50,9 @@
"prebuild": "rm -rf ../../engine/server/webapp",
"clean": "rm -rf build",
"cleanInstall": "rm -rf node_modules; yarn install",
"start": "react-scripts start",
"start": "REACT_APP_VERSION=$(git fetch origin --tags -q && git describe --dirty --match '[0-9]*' --tags)-development react-scripts start",
"start:prod": "serve -s build",
"build": "react-scripts build",
"build": "REACT_APP_VERSION=$(git fetch origin --tags -q && git describe --dirty --match '[0-9]*' --tags) react-scripts build",
"postbuild": "cp -r build/ ../../engine/server/webapp",
"prettier": "prettier . --check",
"prettier:fix": "prettier . --write",
Expand Down
Binary file not shown.
4 changes: 3 additions & 1 deletion enclave-manager/web/src/client/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { isDefined } from "../utils";
export const KURTOSIS_CLOUD_PROTOCOL = "https";
export const KURTOSIS_CLOUD_HOST = "cloud.kurtosis.com";
export const KURTOSIS_CLOUD_CONNECT_PAGE = "connect";
export const KURTOSIS_CLOUD_EM_PAGE = "enclave-manager";

// Cloud
export const KURTOSIS_CLOUD_UI_URL =
process.env.REACT_APP_KURTOSIS_CLOUD_UI_URL || `${KURTOSIS_CLOUD_PROTOCOL}://${KURTOSIS_CLOUD_HOST}`;
export const KURTOSIS_CLOUD_CONNECT_URL = `${KURTOSIS_CLOUD_PROTOCOL}://${KURTOSIS_CLOUD_HOST}/${KURTOSIS_CLOUD_CONNECT_PAGE}`;
export const KURTOSIS_CLOUD_CONNECT_URL = `${KURTOSIS_CLOUD_UI_URL}/${KURTOSIS_CLOUD_CONNECT_PAGE}`;
export const KURTOSIS_CLOUD_EM_URL = `${KURTOSIS_CLOUD_UI_URL}/${KURTOSIS_CLOUD_EM_PAGE}`;
export const KURTOSIS_PACKAGE_INDEXER_URL =
process.env.REACT_APP_KURTOSIS_PACKAGE_INDEXER_URL || `${KURTOSIS_CLOUD_PROTOCOL}://${KURTOSIS_CLOUD_HOST}:9770`;

Expand Down
Loading

0 comments on commit 7035af3

Please sign in to comment.