Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: emui build #1826

Merged
merged 10 commits into from Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
100 changes: 67 additions & 33 deletions .circleci/config.yml
Expand Up @@ -8,6 +8,13 @@ filters_ignore_main: &filters_ignore_main
ignore:
- main

# Don't run on tags
filters_ignore_tags: &filters_ignore_tags
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/

# cli cluster param used to run test suites against docker/kubernetes tests
param_cli_cluster_backend: &param_cli_cluster_backend
Expand Down Expand Up @@ -92,7 +99,7 @@ run_prepare_testing_docker: &run_prepare_testing_docker
# Steps to prepare a job for Docker testing
steps_prepare_testing_docker: &steps_prepare_testing_docker
steps:
- <<: *run_prepare_testing_docker
- <<: *run_prepare_testing_docker

# Run steps to dump kurtosis enclaves from docker
run_dump_kurtosis_enclaves: &run_dump_kurtosis_enclaves
Expand Down Expand Up @@ -204,6 +211,9 @@ 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 @@ -418,6 +428,33 @@ 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 @@ -440,6 +477,11 @@ 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 @@ -936,7 +978,7 @@ jobs:
- checkout

- <<: *abort_job_if_only_docs_changes

# Set up Kurtosis
- attach_workspace:
at: "<< pipeline.parameters.workspace-with-cli-binary-and-images-mountpoint >>"
Expand Down Expand Up @@ -980,7 +1022,7 @@ jobs:
condition:
equal: [ "docker", << parameters.cli-cluster-backend >> ]
steps:
# Restart the engine and make sure Traefik restarted and reconfigured properly
# Restart the engine and make sure Traefik restarted and reconfigured properly
- run: |
${KURTOSIS_BINPATH} engine restart
enclave_uuid=$(${KURTOSIS_BINPATH} enclave inspect test-enclave | grep "^UUID:" | awk '{print $2}')
Expand Down Expand Up @@ -1178,6 +1220,10 @@ jobs:
version="$(cat version.txt)"
"<<pipeline.parameters.generate-kurtosis-version-script-path>>" $version

- 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

- setup_remote_docker:
version: "<< pipeline.parameters.docker-engine-version>>"
Expand Down Expand Up @@ -1353,6 +1399,9 @@ workflows:
ignore:
- main

- build_enclave_manager_webapp:
<<: *filters_ignore_main

- build_engine_launcher:
filters:
branches:
Expand All @@ -1361,6 +1410,8 @@ workflows:
- build_engine_server:
context:
- docker-user
requires:
- build_enclave_manager_webapp
filters:
branches:
ignore:
Expand Down Expand Up @@ -1486,16 +1537,14 @@ workflows:
- build_files_artifacts_expander
<<: *filters_ignore_main

publish:
jobs:
# -- Artifact-publishing jobs --------------------------------
- publish_kurtosis_sdk_rust:
context:
- crates-publisher
- slack-secrets
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
<<: *filters_ignore_tags

- publish_kurtosis_api_typescript:
context:
Expand All @@ -1510,39 +1559,28 @@ workflows:
context:
- npmjs-user
- slack-secrets
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
<<: *filters_ignore_tags
- publish_files_artifacts_expander_image:
context:
- docker-user
- slack-secrets
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
<<: *filters_ignore_tags
- publish_api_container_server_image:
context:
- docker-user
- slack-secrets
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
<<: *filters_ignore_tags

- build_enclave_manager_webapp:
<<: *filters_ignore_tags

- publish_engine_server_image:
context:
- docker-user
- slack-secrets
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
requires:
- build_enclave_manager_webapp
<<: *filters_ignore_tags

- push_cli_artifacts:
context:
Expand All @@ -1555,10 +1593,6 @@ workflows:
- publish_api_container_server_image
- publish_engine_server_image
- publish_files_artifacts_expander_image
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
<<: *filters_ignore_tags

# -- End artifact-publishing jobs ----------------------------
28 changes: 28 additions & 0 deletions enclave-manager/scripts/build.sh
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template

set -euo pipefail # Bash "strict mode"
script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
root_dirpath="$(dirname "${script_dirpath}")"



# ==================================================================================================
# Constants
# ==================================================================================================
BUILD_SCRIPT_RELATIVE_FILEPATHS=(
"api/scripts/build.sh"
"web/scripts/build.sh"
)


# ==================================================================================================
# Main Logic
# ==================================================================================================
for build_script_rel_filepath in "${BUILD_SCRIPT_RELATIVE_FILEPATHS[@]}"; do
build_script_abs_filepath="${root_dirpath}/${build_script_rel_filepath}"
if ! bash "${build_script_abs_filepath}"; then
echo "Error: Build script '${build_script_abs_filepath}' failed" >&2
exit 1
fi
done
12 changes: 12 additions & 0 deletions enclave-manager/web/README.md
Expand Up @@ -46,6 +46,18 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d

Serve your local build on port 4000.

### `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
4 changes: 1 addition & 3 deletions enclave-manager/web/lerna.json
@@ -1,7 +1,5 @@
{
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"version": "0.86.2",
"npmClient": "yarn",
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
Expand Down
10 changes: 6 additions & 4 deletions enclave-manager/web/packages/app/tsconfig.json
@@ -1,10 +1,12 @@
{
"extends": "../../tsconfig.json",
"include": ["src"],
"references": [{
"path": "../components"
}],
"references": [
{
"path": "../components"
}
],
"compilerOptions": {
"noEmit": true
}
}
}
4 changes: 2 additions & 2 deletions enclave-manager/web/packages/components/README.md
@@ -1,7 +1,7 @@
# Kurtosis UI Components

This guide provides instructions and code snippets to help you get started with the Kurtosis UI Components. This library
can be used to create
can be used to create

## Setting Up

Expand All @@ -13,4 +13,4 @@ $ yarn add kurtosis-ui-components

## Usage

Instructions to follow.
Instructions to follow.
2 changes: 1 addition & 1 deletion enclave-manager/web/packages/components/tsconfig.json
Expand Up @@ -5,4 +5,4 @@
"outDir": "build",
"declaration": true
}
}
}
1 change: 1 addition & 0 deletions enclave-manager/web/scripts/build.sh
Expand Up @@ -11,6 +11,7 @@ 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
2 changes: 1 addition & 1 deletion enclave-manager/web/tsconfig.json
Expand Up @@ -14,5 +14,5 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx"
},
}
}
2 changes: 2 additions & 0 deletions engine/server/.gitignore
@@ -0,0 +1,2 @@
# The webapp is generated by the enclave-manager/web build process
webapp/
10 changes: 0 additions & 10 deletions engine/server/webapp/asset-manifest.json

This file was deleted.

Binary file removed engine/server/webapp/favicon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion engine/server/webapp/index.html

This file was deleted.

Binary file removed engine/server/webapp/logo.png
Binary file not shown.
Binary file removed engine/server/webapp/noLogo.png
Binary file not shown.
3 changes: 0 additions & 3 deletions engine/server/webapp/static/js/main.744424a2.js

This file was deleted.