Skip to content

Commit

Permalink
Merge branch 'main' into tedi/dependencylist
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 authored Nov 14, 2024
2 parents 09e90ee + dbb2193 commit 070fa60
Show file tree
Hide file tree
Showing 35 changed files with 690 additions and 99 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,9 @@ jobs:
false
fi
- run:
name: "Verify Kurtosis cleaned up all its volumes (except for the log storage and github auth storage volumes)"
name: "Verify Kurtosis cleaned up all its volumes (except for the log storage, github auth storage, docker auth config volumes)"
command: |
if ! [ $(docker volume ls | grep -v kurtosis-logs-collector-vol | grep -v kurtosis-logs-db-vol | tail -n+2 | wc -l ) -eq 2 ]; then
if ! [ $(docker volume ls | grep -v kurtosis-logs-collector-vol | grep -v kurtosis-logs-db-vol | tail -n+2 | wc -l ) -eq 3 ]; then
docker volume ls
false
fi
Expand Down Expand Up @@ -1004,9 +1004,9 @@ jobs:
false
fi
- run:
name: "Verify Kurtosis cleaned up all its volumes (except for the log storage and github auth storage volumes)"
name: "Verify Kurtosis cleaned up all its volumes (except for the log storage, github auth storage, docker auth config volumes)"
command: |
if ! [ $(docker volume ls | grep -v kurtosis-logs-collector-vol | grep -v kurtosis-logs-db-vol | tail -n+2 | wc -l) -eq 2 ]; then
if ! [ $(docker volume ls | grep -v kurtosis-logs-collector-vol | grep -v kurtosis-logs-db-vol | tail -n+2 | wc -l) -eq 3 ]; then
docker volume ls
false
fi
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'kurtosis-tech/kurtosis'
steps:
- uses: google-github-actions/release-please-action@v3
- uses: googleapis/release-please-action@d1a8f221d7723166f48a584aebba00ef3f6febec
with:
# We use the RELEASER_TOKEN so that the GitHub Actions
# can run on the PR created
# https://github.com/kurtosis-tech/kurtosis/issues/688
token: "${{ secrets.RELEASER_TOKEN }}"
release-type: simple
package-name: kurtosis
bump-minor-pre-major: false
bump-patch-for-minor-pre-major: false
# Our CI, Docker Images, Kurtosis-SDK bumps all depend on
# non v tags
include-v-in-tag: false
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.4.1"
}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## [1.4.1](https://github.com/kurtosis-tech/kurtosis/compare/1.4.0...v1.4.1) (2024-11-01)


### Bug Fixes

* add rafael as maintainer ([#2583](https://github.com/kurtosis-tech/kurtosis/issues/2583)) ([ab5eb9e](https://github.com/kurtosis-tech/kurtosis/commit/ab5eb9efdbccfae28ee56ee96350daef7412c6ae))
* docker auth panic ([b36ddc9](https://github.com/kurtosis-tech/kurtosis/commit/b36ddc9d6c3b2baa8fe03a3f27ec5f3cae68c043))

## [1.4.0](https://github.com/kurtosis-tech/kurtosis/compare/1.3.1...1.4.0) (2024-10-29)


### Features

* support auth from docker config ([#2560](https://github.com/kurtosis-tech/kurtosis/issues/2560)) ([dab4470](https://github.com/kurtosis-tech/kurtosis/commit/dab4470ec18f7324b22b780de8d923ceef965428))

## [1.3.1](https://github.com/kurtosis-tech/kurtosis/compare/1.3.0...1.3.1) (2024-10-15)


Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This document lists the individuals who are responsible for maintaining and cont
- [Dan Park](https://github.com/chunha-park) - BD/Product Marketing @KurtosisTech
- [Barnabas Busa](https://github.com/barnabasbusa) - Dev Ops @Ethereum Foundation
- [Parithosh Jayanthi](https://github.com/parithosh) - Dev Ops @Ethereum Foundation
- [Rafael Matias](https://github.com/skylenet) - Dev Ops @Ethereum Foundation
- [John Hilliard](https://github.com/praetoriansentry) - Dev Tools @Polygon Labs
- [Léo Vincent](https://github.com/leovct) - Dev Tools @Polygon Labs
- [Kevin Today](https://github.com/mieubrisse) - Original Contributor
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 = "1.3.1"
KurtosisVersion = "1.4.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 = "1.3.1"
version = "1.4.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": "1.3.1",
"version": "1.4.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 = "1.3.1"
export const KURTOSIS_VERSION: string = "1.4.1"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
6 changes: 2 additions & 4 deletions cli/cli/commands/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"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/helpers/multi_os_command_executor"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/user_support_constants"
"github.com/kurtosis-tech/kurtosis/contexts-config-store/store"
"github.com/kurtosis-tech/stacktrace"
"github.com/sirupsen/logrus"
)

var WebCmd = &lowlevel.LowlevelKurtosisCommand{
Expand All @@ -35,9 +35,7 @@ func run(_ context.Context, _ *flags.ParsedFlags, _ *args.ParsedArgs) error {
return stacktrace.Propagate(err, "tried fetching the current Kurtosis context but failed, we can't switch clusters without this information. This is a bug in Kurtosis")
}
if store.IsRemote(currentKurtosisContext) {
if err := multi_os_command_executor.OpenFile(user_support_constants.KurtosisCloudLink); err != nil {
return stacktrace.Propagate(err, "An error occurred while opening the Kurtosis Cloud Web UI")
}
logrus.Warn("Kurtosis Cloud has been deprecated. Switch to a local kurtosis context to use the local Kurtosis web UI instead.")
}

if err := multi_os_command_executor.OpenFile(webUILink); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package backend_creator
import (
"context"
"fmt"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/database_accessors/enclave_db"
"net"
"os"
"path"

"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/database_accessors/enclave_db"

"github.com/docker/docker/client"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/logs_collector_functions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const (
NameOfNetworkToStartEngineAndLogServiceContainersIn = "bridge"
HttpApplicationProtocol = "http"

GitHubAuthStorageDirPath = "/kurtosis-data/github-auth/"
GitHubAuthStorageDirPath = "/kurtosis-data/github-auth/"
DockerConfigStorageDirPath = "/root/.docker/"

EmptyApplicationURL = ""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,3 +618,22 @@ func (backend *DockerKurtosisBackend) getGitHubAuthStorageVolume(ctx context.Con
volume := foundVolumes[0]
return volume.Name, nil
}

// Guaranteed to either return a Docker config storage volume name or throw an error
func (backend *DockerKurtosisBackend) getDockerConfigStorageVolume(ctx context.Context) (string, error) {
volumeSearchLabels := map[string]string{
docker_label_key.VolumeTypeDockerLabelKey.GetString(): label_value_consts.DockerConfigStorageVolumeTypeDockerLabelValue.GetString(),
}
foundVolumes, err := backend.dockerManager.GetVolumesByLabels(ctx, volumeSearchLabels)
if err != nil {
return "", stacktrace.Propagate(err, "An error occurred getting Docker config storage volumes matching labels '%+v'", volumeSearchLabels)
}
if len(foundVolumes) > 1 {
return "", stacktrace.NewError("Found multiple Docker config storage volumes. This should never happen")
}
if len(foundVolumes) == 0 {
return "", stacktrace.NewError("No Docker config storage volume found.")
}
volume := foundVolumes[0]
return volume.Name, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package docker_kurtosis_backend
import (
"context"
"encoding/json"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/image_registry_spec"
"net"
"time"

"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_impls/docker/object_attributes_provider/docker_label_key"

"github.com/docker/go-connections/nat"
Expand Down Expand Up @@ -81,6 +82,11 @@ func (backend *DockerKurtosisBackend) CreateAPIContainer(
return nil, stacktrace.Propagate(err, "An error occurred getting the GitHub auth storage volume name.")
}

dockerConfigStorageVolumeName, err := backend.getDockerConfigStorageVolume(ctx)
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred getting the Docker config storage volume name.")
}

// Get the Docker network ID where we'll start the new API container
enclaveNetwork, err := backend.getEnclaveNetworkByEnclaveUuid(ctx, enclaveUuid)
if err != nil {
Expand Down Expand Up @@ -191,8 +197,9 @@ func (backend *DockerKurtosisBackend) CreateAPIContainer(
}

volumeMounts := map[string]string{
enclaveDataVolumeName: enclaveDataVolumeDirpath,
githubAuthStorageVolumeName: consts.GitHubAuthStorageDirPath,
enclaveDataVolumeName: enclaveDataVolumeDirpath,
githubAuthStorageVolumeName: consts.GitHubAuthStorageDirPath,
dockerConfigStorageVolumeName: consts.DockerConfigStorageDirPath,
}

labelStrs := map[string]string{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package engine_functions
import (
"context"
"fmt"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/github_auth_storage_creator"
"time"

"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/docker_config_storage_creator"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/engine_functions/github_auth_storage_creator"

"github.com/docker/go-connections/nat"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/consts"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/logs_aggregator_functions"
Expand Down Expand Up @@ -249,14 +251,34 @@ func CreateEngine(
return nil, stacktrace.Propagate(err, "An error occurred creating GitHub auth storage.")
}

// Configure Docker Config by writing the provided config files to a volume that's accessible by the engine
dockerConfigStorageVolObjAttrs, err := objAttrsProvider.ForDockerConfigStorageVolume()
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred retrieving object attributes for GitHub auth storage.")
}
dockerConfigStorageVolNameStr := dockerConfigStorageVolObjAttrs.GetName().GetString()
dockerConfigStorageVolLabelStrs := map[string]string{}
for labelKey, labelValue := range dockerConfigStorageVolObjAttrs.GetLabels() {
dockerConfigStorageVolLabelStrs[labelKey.GetString()] = labelValue.GetString()
}
// This volume is created idempotently (like logs storage volume) and just write the token to the file everytime the engine starts
if err = dockerManager.CreateVolume(ctx, dockerConfigStorageVolNameStr, dockerConfigStorageVolLabelStrs); err != nil {
return nil, stacktrace.Propagate(err, "An error occurred creating Docker config storage volume.")
}
err = docker_config_storage_creator.CreateDockerConfigStorage(ctx, targetNetworkId, dockerConfigStorageVolNameStr, consts.DockerConfigStorageDirPath, dockerManager)
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred creating Docker config storage.")
}

bindMounts := map[string]string{
// Necessary so that the engine server can interact with the Docker engine
consts.DockerSocketFilepath: consts.DockerSocketFilepath,
}

volumeMounts := map[string]string{
logsStorageVolNameStr: logsStorageDirPath,
githubAuthStorageVolNameStr: consts.GitHubAuthStorageDirPath,
logsStorageVolNameStr: logsStorageDirPath,
githubAuthStorageVolNameStr: consts.GitHubAuthStorageDirPath,
dockerConfigStorageVolNameStr: consts.DockerConfigStorageDirPath,
}

if serverArgs.OnBastionHost {
Expand Down
Loading

0 comments on commit 070fa60

Please sign in to comment.