Skip to content

Commit 4fa3ec5

Browse files
committed
Remove mpl and radio button warnings, add local/prod build steps and fix token var
1 parent fe7078a commit 4fa3ec5

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ RUN --mount=type=cache,mode=0777,target=/root/.cache/pip \
2020
COPY tests/data /app/tests/data
2121
COPY src/simdec /app/src/simdec
2222
COPY app.py /app/app.py
23+
# matplotlib cache
24+
RUN mkdir -p /app/.config/matplotlib
2325

2426
# Step 3/3: Image
2527
FROM base as panel
@@ -42,4 +44,4 @@ WORKDIR /app
4244
RUN useradd app && usermod -a -G app app
4345
USER app
4446
# Run the web service on container startup.
45-
CMD panel serve app.py --address 0.0.0.0 --port 8080 --allow-websocket-origin="*" --basic-auth PANEL_TOKEN --num-procs 2 --cookie-secret my_super_safe_cookie_secret
47+
CMD panel serve app.py --address 0.0.0.0 --port $PORT --allow-websocket-origin="*" --basic-auth=$PANEL_TOKEN --num-procs 2 --cookie-secret my_super_safe_cookie_secret

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@ serve-dev: ## Serve Panel dashboard - Dev mode
4444
serve: ## Serve Panel dashboard - Prod mode
4545
panel serve app.py
4646

47+
build-local:
48+
docker build -f ./Dockerfile \
49+
--build-arg PANEL_TOKEN=$(PANEL_TOKEN) \
50+
--tag simdec-panel:$(version) \
51+
--pull \
52+
./.
53+
54+
run-local: build-local
55+
docker run --rm -it \
56+
--name=simdec-panel \
57+
--memory=1g \
58+
--cpuset-cpus=0 \
59+
-e ENV=development \
60+
-p "8080:8080" \
61+
simdec-panel:$(version)
62+
4763
build:
4864
docker build -f ./Dockerfile \
4965
--platform linux/amd64 \
@@ -54,6 +70,7 @@ build:
5470

5571
run: build
5672
docker run --rm -it \
73+
--name=simdec-panel \
5774
--memory=1g \
5875
--cpuset-cpus=0 \
5976
-e ENV=development \
@@ -73,6 +90,6 @@ production: publish-production
7390
--port=8080 \
7491
--set-env-vars ENV=production \
7592
--allow-unauthenticated \
76-
--timeout=10 \
93+
--timeout=600 \
7794
--image=$(region)-docker.pkg.dev/$(project)/simdec-panel/simdec-panel:$(version) \
7895
--memory 1Gi

app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
# panel app
1515
pn.extension(template="material")
1616
pn.extension("tabulator")
17-
pn.config.sizing_mode = "stretch_width"
18-
1917

18+
pn.config.sizing_mode = "stretch_width"
2019
pn.config.throttled = True
2120
font_size = "12pt"
2221

@@ -258,7 +257,6 @@ def tableau_states(res, states):
258257
switch_histogram_boxplot = pn.widgets.RadioButtonGroup(
259258
name="Switch histogram - boxplot",
260259
options=["Stacked histogram", "Boxplot"],
261-
inline=False,
262260
)
263261

264262
interactive_n_bins_auto = pn.bind(n_bins_auto, interactive_decomposition)

0 commit comments

Comments
 (0)