Skip to content

Commit bd1b4eb

Browse files
authored
Debug/container frontend dev (#330)
* Devcontainer.json update for local UI development * Build war and fatJar on Docker build:
1 parent 116d7e3 commit bd1b4eb

File tree

4 files changed

+75
-15
lines changed

4 files changed

+75
-15
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ RUN .devcontainer/scripts/on_build/install_gradle.sh
2222
# Install VisualVM for profiling
2323
RUN .devcontainer/scripts/on_build/install_visualvm.sh
2424

25+
# Install third-party dependencies for the local UI server
26+
RUN cd editor/third_party && bash install_deps.sh
27+
28+
# Build WASM and fat JAR so the server is ready to run immediately
29+
RUN ./gradlew war && bash editor/war/get_from_jar.sh && ./gradlew fatJar
30+
2531
# Add josh_validator and other interactive scripts to PATH, to be able to run them from anywhere
2632
ENV PATH="/workspaces/josh/.devcontainer/scripts/interactive:${PATH}"
2733

.devcontainer/devcontainer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,12 @@
2626
"visualvm.installation.visualvmPath": "/opt/visualvm"
2727
}
2828
}
29+
},
30+
"forwardPorts": [8085],
31+
"portsAttributes": {
32+
"8085": {
33+
"label": "JoshSim Server",
34+
"onAutoForward": "notify"
35+
}
2936
}
3037
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ This will start a local web server which makes the UI available via your browser
133133
### Containerized usage
134134
Containerization through [Docker](https://www.docker.com) and [Development Containers](https://containers.dev) can help you move your work from one computer to the next with ease. Please see our `Dockerfile` and `devcontainer.json`.
135135

136+
In order to serve the local UI from inside the dev container, simply run `./gradlew war` and `./gradlew fatJar` prior to running the local server with the command above.
137+
136138
### Distributed usage
137139
Distributing workloads is easy. Simply deploy either our jar file or container to a serverless solution like [Lambda](https://aws.amazon.com/lambda/) / [CloudRun](https://cloud.google.com/run) or submit on your own cluster via [Kubernetes](https://kubernetes.io).
138140

editor/third_party/install_deps.sh

100644100755
Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,68 @@
1-
[ ! -e publicsans ] && mkdir publicsans
1+
#!/bin/bash
2+
set -e
23

3-
[ ! -e publicsans/public-sans-v2.001.zip ] && wget https://github.com/uswds/public-sans/releases/download/v2.001/public-sans-v2.001.zip -O publicsans/public-sans-v2.001.zip
4+
if [ ! -e publicsans ]; then
5+
mkdir publicsans
6+
fi
7+
8+
if [ ! -e publicsans/public-sans-v2.001.zip ]; then
9+
wget https://github.com/uswds/public-sans/releases/download/v2.001/public-sans-v2.001.zip -O publicsans/public-sans-v2.001.zip
10+
fi
411

512
if [ ! -e publicsans/fonts/otf/PublicSans-Regular.otf ]; then
613
cd publicsans
714
unzip public-sans-v2.001.zip
815
cd ..
916
fi
1017

11-
[ ! -e ace.min.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ace.min.js -O ace.min.js
12-
[ ! -e theme-textmate.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/theme-textmate.min.js -O theme-textmate.js
13-
[ ! -e theme-textmate-css.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/theme-textmate-css.min.js -O theme-textmate-css.js
14-
[ ! -e ext-searchbox.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-searchbox.js -O ext-searchbox.js
15-
[ ! -e ext-options.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-options.js -O ext-options.js
16-
[ ! -e ext-prompt.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-prompt.js -O ext-prompt.js
17-
[ ! -e ext-language_tools.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-language_tools.js -O ext-language_tools.js
18-
[ ! -e tabby-ui.min.css ] && wget https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.3/dist/css/tabby-ui.min.css -O tabby-ui.min.css
19-
[ ! -e tabby.min.js ] && wget https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.3/dist/js/tabby.min.js -O tabby.min.js
20-
[ ! -e d3.min.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.min.js -O d3.min.js
21-
[ ! -e math.min.js ] && wget https://cdnjs.cloudflare.com/ajax/libs/mathjs/14.2.1/math.min.js -O math.min.js
22-
[ ! -e popper.min.js ] && wget https://unpkg.com/@popperjs/core@2 -O popper.min.js
23-
[ ! -e tippy.min.js ] && wget https://unpkg.com/tippy.js@6 -O tippy.min.js
18+
if [ ! -e ace.min.js ]; then
19+
wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ace.min.js -O ace.min.js
20+
fi
21+
22+
if [ ! -e theme-textmate.js ]; then
23+
wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/theme-textmate.min.js -O theme-textmate.js
24+
fi
25+
26+
if [ ! -e theme-textmate-css.js ]; then
27+
wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/theme-textmate-css.min.js -O theme-textmate-css.js
28+
fi
29+
30+
if [ ! -e ext-searchbox.js ]; then
31+
wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-searchbox.js -O ext-searchbox.js
32+
fi
33+
34+
if [ ! -e ext-options.js ]; then
35+
wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-options.js -O ext-options.js
36+
fi
37+
38+
if [ ! -e ext-prompt.js ]; then
39+
wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-prompt.js -O ext-prompt.js
40+
fi
41+
42+
if [ ! -e ext-language_tools.js ]; then
43+
wget https://cdnjs.cloudflare.com/ajax/libs/ace/1.36.2/ext-language_tools.js -O ext-language_tools.js
44+
fi
45+
46+
if [ ! -e tabby-ui.min.css ]; then
47+
wget https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.3/dist/css/tabby-ui.min.css -O tabby-ui.min.css
48+
fi
49+
50+
if [ ! -e tabby.min.js ]; then
51+
wget https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.3/dist/js/tabby.min.js -O tabby.min.js
52+
fi
53+
54+
if [ ! -e d3.min.js ]; then
55+
wget https://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.min.js -O d3.min.js
56+
fi
57+
58+
if [ ! -e math.min.js ]; then
59+
wget https://cdnjs.cloudflare.com/ajax/libs/mathjs/14.2.1/math.min.js -O math.min.js
60+
fi
61+
62+
if [ ! -e popper.min.js ]; then
63+
wget https://unpkg.com/@popperjs/core@2 -O popper.min.js
64+
fi
65+
66+
if [ ! -e tippy.min.js ]; then
67+
wget https://unpkg.com/tippy.js@6 -O tippy.min.js
68+
fi

0 commit comments

Comments
 (0)