Skip to content

Commit

Permalink
Revert "feat: generate enclave manager ui in build process and check …
Browse files Browse the repository at this point in the history
…prettier (#1717)"

This reverts commit d6be248.
  • Loading branch information
Dartoxian committed Nov 16, 2023
1 parent 78289ad commit 9c845f2
Show file tree
Hide file tree
Showing 17 changed files with 138 additions and 95 deletions.
42 changes: 0 additions & 42 deletions .circleci/config.yml
Expand Up @@ -186,9 +186,6 @@ parameters:
file-artifacts-expander-image-filename:
type: string
default: "file-artifacts-expander-image.tgz"
enclave-manager-yarn-cache-key-prefix:
type: string
default: "enclave-manager_yarn"
engine-server-image-filename:
type: string
default: "engine-server-image.tgz"
Expand Down Expand Up @@ -397,33 +394,6 @@ jobs:
paths:
- "<< pipeline.parameters.core-server-image-filename >>"

build_enclave_manager_webapp:
executor: ubuntu_vm
steps:
- checkout

- <<: *abort_job_if_only_docs_changes

# Cache our dependencies
- restore_cache:
keys:
- << pipeline.parameters.enclave-manager-yarn-cache-key-prefix>>-{{ checksum "enclave-manager/api/typescript/yarn.lock" }}-{{ checksum "enclave-manager/web/yarn.lock" }}

- run: npm install -g yarn

- run: |
enclave-manager/scripts/build.sh
- save_cache:
key: << pipeline.parameters.enclave-manager-yarn-cache-key-prefix>>-{{ checksum "enclave-manager/api/typescript/yarn.lock" }}-{{ checksum "enclave-manager/web/yarn.lock" }}
paths:
- "/home/circleci/.cache/yarn"

- persist_to_workspace:
root: engine/server
paths:
- webapp

build_engine_launcher:
docker:
- image: "cimg/go:<< pipeline.parameters.go-version >>"
Expand All @@ -446,11 +416,6 @@ jobs:

- <<: *abort_job_if_only_docs_changes

- attach_workspace:
at: "<< pipeline.parameters.workspace-with-cli-binary-and-images-mountpoint >>"

- run: cp -R << pipeline.parameters.workspace-with-cli-binary-and-images-mountpoint >>/webapp engine/server/webapp

# Generate Kurtosis Version
- run: "<<pipeline.parameters.generate-kurtosis-version-script-path>>"

Expand Down Expand Up @@ -1270,11 +1235,6 @@ workflows:
ignore:
- main

- build_enclave_manager_webapp:
filters:
branches:
ignore:
- main
- build_engine_launcher:
filters:
branches:
Expand All @@ -1283,8 +1243,6 @@ workflows:
- build_engine_server:
context:
- docker-user
requires:
- build_enclave_manager_webapp
filters:
branches:
ignore:
Expand Down
28 changes: 0 additions & 28 deletions enclave-manager/scripts/build.sh

This file was deleted.

12 changes: 0 additions & 12 deletions enclave-manager/web/README.md
Expand Up @@ -42,18 +42,6 @@ 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 prettier`

Runs `prettier --check` to check that the code matches the formatting that [`prettier`](https://prettier.io/) would apply.

### `yarn prettier:fix`

Applies any formatting changes prettier wants to apply to this application. For ease of use you can use IDE integrations
to auto apply prettier changes on file save, see instructions:

- [Here](https://plugins.jetbrains.com/plugin/10456-prettier) for Intellij
- [Here](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for vscode

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
Expand Down
2 changes: 1 addition & 1 deletion enclave-manager/web/package.json
Expand Up @@ -45,11 +45,11 @@
},
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"prebuild": "rm -rf ../../engine/server/webapp",
"clean": "rm -rf build",
"cleanInstall": "rm -rf node_modules; yarn install",
"start": "react-scripts start",
"start:prod": "serve -s build",
"prebuild": "rm -rf ../../engine/server/webapp",
"build": "react-scripts build",
"postbuild": "cp -r build/ ../../engine/server/webapp",
"prettier": "prettier . --check",
Expand Down
1 change: 0 additions & 1 deletion enclave-manager/web/scripts/build.sh
Expand Up @@ -11,7 +11,6 @@ lang_root_dirpath="$(dirname "${script_dirpath}")"
# ==================================================================================================
cd "${lang_root_dirpath}"
yarn install --frozen-lockfile
yarn prettier
# There are no unit tests currently
# CGO_ENABLED=0 yarn test
yarn clean
Expand Down
5 changes: 2 additions & 3 deletions enclave-manager/web/src/components/LocationListener.tsx
Expand Up @@ -5,14 +5,13 @@ import { useKurtosisClient } from "../client/enclaveManager/KurtosisClientContex
export const LocationListener = () => {
const client = useKurtosisClient();
const navigate = useNavigate();
const cloudUrl = client.getCloudUrl();

useEffect(() => {
if (cloudUrl) {
if (client.getCloudUrl()) {
const route = client.getParentRequestedRoute();
if (route) navigate(route);
}
}, [cloudUrl, client, navigate]);
}, [client.getCloudUrl()]);

return <></>;
};
Expand Up @@ -10,8 +10,7 @@ import {
ModalHeader,
ModalOverlay,
Text,
Tooltip,
useToast,
Tooltip, useToast,
} from "@chakra-ui/react";
import { EnclaveMode } from "enclave-manager-sdk/build/engine_service_pb";
import { useMemo, useRef, useState } from "react";
Expand Down Expand Up @@ -81,6 +80,8 @@ export const ConfigureEnclaveModal = ({
return isDefined(value) ? `${value}` : "";
case ArgumentValueType.STRING:
return value || "";
case ArgumentValueType.JSON:
return isDefined(value) ? JSON.stringify(value) : "{}";
case ArgumentValueType.LIST:
assertDefined(innerType1, `Cannot parse a list argument type without knowing innerType1`);
return isDefined(value) ? value.map((v: any) => convertArgValue(innerType1, v)) : [];
Expand Down Expand Up @@ -167,9 +168,7 @@ export const ConfigureEnclaveModal = ({
}
} catch (err) {
toast({
title: `An error occurred while preparing data for running package. The package arguments were not proper JSON: ${stringifyError(
err,
)}`,
title: `An error occurred while preparing data for running package. The package arguments were not proper JSON: ${stringifyError(err)}`,
colorScheme: "red",
});
return;
Expand Down
2 changes: 0 additions & 2 deletions engine/server/.gitignore

This file was deleted.

10 changes: 10 additions & 0 deletions engine/server/webapp/asset-manifest.json
@@ -0,0 +1,10 @@
{
"files": {
"main.js": "./static/js/main.efcd178a.js",
"index.html": "./index.html",
"main.efcd178a.js.map": "./static/js/main.efcd178a.js.map"
},
"entrypoints": [
"static/js/main.efcd178a.js"
]
}
Binary file added engine/server/webapp/favicon.ico
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions engine/server/webapp/index.html
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Kurtosis Enclave Manager"/><title>Kurtosis Enclave Manager</title><script defer="defer" src="./static/js/main.efcd178a.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
Binary file added engine/server/webapp/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions engine/server/webapp/static/js/main.efcd178a.js

Large diffs are not rendered by default.

116 changes: 116 additions & 0 deletions engine/server/webapp/static/js/main.efcd178a.js.LICENSE.txt
@@ -0,0 +1,116 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/*! streamsaver. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @remix-run/router v1.10.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* React Router DOM v6.17.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* React Router v6.17.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* react-table
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
1 change: 1 addition & 0 deletions engine/server/webapp/static/js/main.efcd178a.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion scripts/build.sh
Expand Up @@ -27,7 +27,6 @@ BUILD_SCRIPT_RELATIVE_FILEPATHS=(
"api/scripts/build.sh"
"metrics-library/scripts/build.sh"
"core/scripts/build.sh"
"enclave-manager/scripts/build.sh"
"engine/scripts/build.sh"
"cli/scripts/build.sh"
)
Expand Down

0 comments on commit 9c845f2

Please sign in to comment.