Skip to content

Commit

Permalink
Merge branch 'main' into laurent/traefik-container
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentluce committed Dec 6, 2023
2 parents e4d36d9 + 9bdf0d0 commit 62163f3
Show file tree
Hide file tree
Showing 33 changed files with 273 additions and 100 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# 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)


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.40
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,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-12-02
Change Date: 2027-12-05

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.85.40"
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.40"
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.40",
"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.40"
export const KURTOSIS_VERSION: string = "0.85.42"
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
5 changes: 3 additions & 2 deletions enclave-manager/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"react-icons": "^4.11.0",
"react-markdown": "^9.0.0",
"react-router-dom": "^6.17.0",
"react-scripts": "5.0.1",
"react-virtuoso": "^4.6.2",
"streamsaver": "^2.0.6",
"true-myth": "^7.1.0"
"true-myth": "^7.1.0",
"yaml": "^2.3.4"
},
"devDependencies": {
"@types/js-cookie": "^3.0.6",
Expand All @@ -41,6 +41,7 @@
"monaco-editor": "^0.44.0",
"prettier": "3.0.3",
"prettier-plugin-organize-imports": "^3.2.3",
"react-scripts": "5.0.1",
"serve": "^14.2.1",
"source-map-explorer": "^2.5.3",
"typescript": "^4.4.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const KurtosisClientProvider = ({ children }: PropsWithChildren) => {
throw Error(`Port ${port} is not a number.`);
}

const jwtToken = Cookies.get("kurtosis");
const jwtToken = Cookies.get("_kurtosis_jwt_token");

if (isDefined(jwtToken)) {
newClient = new AuthenticatedKurtosisClient(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v1.4.0 with parameter "target=ts"
// @generated by protoc-gen-es v1.4.1 with parameter "target=ts"
// @generated from file kurtosis_package_indexer.proto (package kurtosis_package_indexer, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down Expand Up @@ -222,6 +222,11 @@ export class KurtosisPackage extends Message<KurtosisPackage> {
*/
version = "";

/**
* @generated from field: string icon_url = 12;
*/
iconUrl = "";

constructor(data?: PartialMessage<KurtosisPackage>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -241,6 +246,7 @@ export class KurtosisPackage extends Message<KurtosisPackage> {
{ no: 9, name: "parsing_result", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 10, name: "parsing_time", kind: "message", T: Timestamp },
{ no: 11, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 12, name: "icon_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): KurtosisPackage {
Expand Down Expand Up @@ -394,6 +400,16 @@ export class PackageRepository extends Message<PackageRepository> {
*/
rootPath = "";

/**
* @generated from field: google.protobuf.Timestamp last_commit_time = 5;
*/
lastCommitTime?: Timestamp;

/**
* @generated from field: string default_branch = 6;
*/
defaultBranch = "";

constructor(data?: PartialMessage<PackageRepository>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -406,6 +422,8 @@ export class PackageRepository extends Message<PackageRepository> {
{ no: 2, name: "owner", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 3, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 4, name: "root_path", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 5, name: "last_commit_time", kind: "message", T: Timestamp },
{ no: 6, name: "default_branch", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PackageRepository {
Expand Down
87 changes: 61 additions & 26 deletions enclave-manager/web/src/components/CodeEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Box } from "@chakra-ui/react";
import { Editor, OnChange, OnMount } from "@monaco-editor/react";
import { editor as monacoEditor } from "monaco-editor";
import { Editor, Monaco, OnChange, OnMount } from "@monaco-editor/react";
import { type editor as monacoEditor } from "monaco-editor";
import { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from "react";
import { assertDefined, isDefined } from "../utils";
import YAML from "yaml";
import { assertDefined, isDefined, stringifyError } from "../utils";

const MONACO_READ_ONLY_CHANGE_EVENT_ID = 89;

type CodeEditorProps = {
text: string;
Expand All @@ -13,11 +16,14 @@ type CodeEditorProps = {

export type CodeEditorImperativeAttributes = {
formatCode: () => Promise<void>;
setText: (text: string) => void;
setLanguage: (language: string) => void;
};

export const CodeEditor = forwardRef<CodeEditorImperativeAttributes, CodeEditorProps>(
({ text, fileName, onTextChange, showLineNumbers }, ref) => {
const isReadOnly = !isDefined(onTextChange);
const [monaco, setMonaco] = useState<Monaco>();
const [editor, setEditor] = useState<monacoEditor.IStandaloneCodeEditor>();

const resizeEditorBasedOnContent = useCallback(() => {
Expand All @@ -32,6 +38,7 @@ export const CodeEditor = forwardRef<CodeEditorImperativeAttributes, CodeEditorP
}, [editor]);

const handleMount: OnMount = (editor, monaco) => {
setMonaco(monaco);
setEditor(editor);
const colors: monacoEditor.IColors = {};
if (isReadOnly) {
Expand All @@ -57,37 +64,65 @@ export const CodeEditor = forwardRef<CodeEditorImperativeAttributes, CodeEditorP
ref,
() => ({
formatCode: async () => {
console.log("formatting");
if (!isDefined(editor)) {
// do nothing
console.log("no editor");
return;
}
return new Promise((resolve) => {
const listenerDisposer = editor.onDidChangeConfiguration((event) => {
console.log("listener called", event);
if (event.hasChanged(89 /* ID of the readonly option */)) {
console.log("running format");
const formatAction = editor.getAction("editor.action.formatDocument");
assertDefined(formatAction, `Format action is not defined`);
formatAction.run().then(() => {
listenerDisposer.dispose();
editor.updateOptions({
readOnly: isReadOnly,
});
resizeEditorBasedOnContent();
resolve();
});
const doFormat = async () => {
if (editor.getModel()?.getLanguageId() === "yaml") {
try {
const formattedText = YAML.stringify(YAML.parse(editor.getValue()));
editor.setValue(formattedText);
} catch (e: any) {
console.error(stringifyError(e));
}
} else {
const formatAction = editor.getAction("editor.action.formatDocument");
assertDefined(formatAction, `Format action is not defined`);
await formatAction.run();
}
};

if (isReadOnly) {
return new Promise((resolve) => {
const listenerDisposer = editor.onDidChangeConfiguration((event) => {
if (event.hasChanged(MONACO_READ_ONLY_CHANGE_EVENT_ID)) {
doFormat().then(() => {
listenerDisposer.dispose();
editor.updateOptions({
readOnly: isReadOnly,
});
resizeEditorBasedOnContent();
resolve();
});
}
});
editor.updateOptions({
readOnly: false,
});
});
console.log("disablin read only");
editor.updateOptions({
readOnly: false,
});
});
} else {
return doFormat();
}
},
setText: (text: string) => {
if (!isDefined(editor)) {
return;
}
editor.setValue(text);
},
setLanguage: (language: string) => {
if (!isDefined(editor) || !isDefined(monaco)) {
return;
}
const model = editor.getModel();
if (!isDefined(model)) {
return;
}
monaco.editor.setModelLanguage(model, language);
},
}),
[isReadOnly, editor, resizeEditorBasedOnContent],
[isReadOnly, editor, monaco, resizeEditorBasedOnContent],
);

useEffect(() => {
Expand Down
10 changes: 10 additions & 0 deletions enclave-manager/web/src/components/FormatButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Button, ButtonProps } from "@chakra-ui/react";
import { BiPaintRoll } from "react-icons/bi";

export const FormatButton = ({ ...buttonProps }: ButtonProps) => {
return (
<Button leftIcon={<BiPaintRoll />} size={"sm"} colorScheme={"darkBlue"} loadingText={"Format"} {...buttonProps}>
Format
</Button>
);
};
4 changes: 2 additions & 2 deletions enclave-manager/web/src/components/KeyboardCommands.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Text, TextProps } from "@chakra-ui/react";

export const FindCommand = (props: TextProps) => {
let text = "^F";
let text = "Ctrl + F";

if (navigator.userAgent.indexOf("Mac") > -1) {
text = "⌘F";
Expand All @@ -15,7 +15,7 @@ export const FindCommand = (props: TextProps) => {
};

export const OmniboxCommand = (props: TextProps) => {
let text = "^K";
let text = "Ctrl + K";

if (navigator.userAgent.indexOf("Mac") > -1) {
text = "⌘K";
Expand Down
14 changes: 5 additions & 9 deletions enclave-manager/web/src/components/KurtosisBreadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,11 @@ type KurtosisBreadcrumbItemProps = KurtosisBreadcrumb & {
};

const KurtosisBreadcrumbItem = ({ name, destination, alternatives, isLastItem }: KurtosisBreadcrumbItemProps) => {
if (isLastItem) {
return (
<Text fontSize={"xs"} fontWeight={"semibold"} p={"2px 8px"} borderRadius={"6px"} bg={"gray.650"}>
{name}
</Text>
);
}

const baseLink = (
const baseLink = isLastItem ? (
<Text fontSize={"xs"} fontWeight={"semibold"} p={"2px 8px"} borderRadius={"6px"} bg={"gray.650"}>
{name}
</Text>
) : (
<BreadcrumbLink as={Link} to={destination}>
<Button variant={"breadcrumb"} size={"xs"}>
{name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ const theme = extendTheme({
variants: {
valueCard: {
container: {
bg: "gray.800",
bg: "gray.850",
borderRadius: "8px",
padding: "16px",
gap: "16px",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export const KurtosisPackageCard = ({ kurtosisPackage }: KurtosisPackageCardProp
<Image
h={"80px"}
w={"80px"}
bg={"black"}
// TODO: Use package image when supported
src={`${client.getBaseApplicationUrl()}/logo.png`}
bg={kurtosisPackage.iconUrl !== "" ? "white" : "black"}
src={kurtosisPackage.iconUrl || `${client.getBaseApplicationUrl()}/logo.png`}
fallbackSrc={`${client.getBaseApplicationUrl()}/logo.png`}
borderRadius={"6px"}
/>
<Flex flexDirection={"column"} flex={"1"} justifyContent={"space-between"}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CSSProperties, forwardRef, PropsWithChildren, useImperativeHandle } from "react";
import { FormProvider, SubmitHandler, useForm, useFormContext } from "react-hook-form";
import YAML from "yaml";
import {
ArgumentValueType,
KurtosisPackage,
Expand Down Expand Up @@ -65,7 +66,7 @@ export const EnclaveConfigurationForm = forwardRef<
case ArgumentValueType.STRING:
return value;
case ArgumentValueType.JSON:
return JSON.parse(value);
return YAML.parse(value);
default:
return value;
}
Expand Down
Loading

0 comments on commit 62163f3

Please sign in to comment.