Skip to content

Commit e9d8df7

Browse files
authored
Merge pull request #28 from Materials-Data-Science-and-Informatics/fix/script-for-production
Fixes for latest production deployment based on testing
2 parents 83bbd1e + a293bf0 commit e9d8df7

8 files changed

Lines changed: 157 additions & 122 deletions

File tree

.env.example

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ NGINX_PORT=
3636
# - acme-companion: Requests SSL certificate for this domain from Let's Encrypt
3737
HOST=
3838

39-
# Path on the domain where the dashboard is accessible
40-
# If set, the dashboard will ONLY be accessible at this specific path
41-
# Examples:
42-
# - VIRTUAL_PATH=/survey-dashboard → https://your-domain.com/survey-dashboard
43-
# - VIRTUAL_PATH=/dashboard → https://your-domain.com/dashboard
44-
# - Leave empty for root path → https://your-domain.com/
45-
# IMPORTANT: Must start with / (forward slash)
46-
# All other paths on this domain will return 404
47-
VIRTUAL_PATH=
48-
4939
# ============================================================================
5040
# SSL/HTTPS Configuration (Let's Encrypt)
5141
# ============================================================================

.env.local.example

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ NGINX_PORT=80
3333
# You can only test HTTP locally
3434
HOST=localhost
3535

36-
# Path on the domain where the dashboard is accessible
37-
# Test the same path you'll use in production
38-
# Example: VIRTUAL_PATH=/2021community
39-
# Leave empty to serve from root: http://localhost/
40-
VIRTUAL_PATH=/2021community
41-
4236
# ============================================================================
4337
# SSL/HTTPS Configuration (Let's Encrypt)
4438
# ============================================================================

.github/workflows/ci.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 45 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,54 @@
1-
# This workflow will create a github release and upload a Python Package to pypi
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3-
name: Release
4-
# Release a new version to different targets in suitable ways
1+
name: Build and Deploy to GitHub Container Registry
52

63
on:
7-
workflow_call: # called from ci.yml
8-
inputs:
9-
to_github:
10-
description: "Create a Github Release (repository snapshot)"
11-
type: boolean
12-
default: true
13-
14-
to_test_pypi:
15-
description: "Publish to Test PyPI."
16-
type: boolean
17-
default: false
18-
19-
to_pypi:
20-
description: "Publish to PyPI."
21-
type: boolean
22-
default: false
4+
release:
5+
types: [ published ]
6+
push:
7+
tags:
8+
- '*'
9+
workflow_dispatch:
2310

11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
2414

2515
jobs:
26-
27-
github:
28-
if: inputs.to_github
29-
name: Create a Github Release (repository snapshot)
16+
build-and-push:
3017
runs-on: ubuntu-latest
3118
permissions:
32-
contents: write # needed for creating a GH Release
33-
steps:
34-
- uses: actions/checkout@v3
35-
- uses: softprops/action-gh-release@v1
19+
contents: read
20+
packages: write
3621

37-
pypi:
38-
if: inputs.to_pypi || inputs.to_test_pypi
39-
name: Publish to PyPI (and/or compatible repositories)
40-
runs-on: ubuntu-latest
41-
permissions:
42-
id-token: write # needed for "trusted publishing" protocol
4322
steps:
44-
- uses: actions/checkout@v3
45-
46-
- name: Install poetry
47-
run: pipx install poetry
48-
49-
- uses: actions/setup-python@v4
50-
with:
51-
python-version: "3.10"
52-
cache: "poetry"
53-
54-
- name: Build the distribution package
55-
run: poetry build
56-
57-
- name: Publish package to TestPyPI
58-
if: inputs.to_test_pypi
59-
uses: pypa/gh-action-pypi-publish@release/v1
60-
with:
61-
repository-url: https://test.pypi.org/legacy/
62-
63-
- name: Publish package to PyPI
64-
if: inputs.to_pypi
65-
uses: pypa/gh-action-pypi-publish@release/v1
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log in to the Container registry
30+
if: github.event_name != 'pull_request'
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Extract metadata (tags, labels)
38+
id: meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
42+
tags: |
43+
type=ref,event=tag
44+
type=semver,pattern={{version}}
45+
type=semver,pattern={{major}}.{{minor}}
46+
type=raw,value=latest,enable={{is_default_branch}}
47+
48+
- name: Build and push Docker image
49+
uses: docker/build-push-action@v5
50+
with:
51+
context: .
52+
push: true
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[project]
22
name = "survey-dashboard"
3-
version = "0.1.0"
3+
version = "2.0.0"
44
description = "A Dashboard displaying survey data in an interactive way and allow for interactive exploration."
5-
authors = [{name = "Jens Broeder", email = "j.broeder@fz-juelich.de"},
5+
authors = [{name = "Jens Broeder", email = "j.broeder@fz-juelich.de"},
66
{name = "Silke Christine Gerlich", email = "s.gerlich@fz-juelich.de"},
77
{name = "Volker Hofmann", email = "v.hofmann@fz-juelich.de"}]
88
readme = "README.md"
@@ -28,7 +28,7 @@ classifiers = [
2828
"Topic :: Scientific/Engineering :: Visualization",
2929

3030
]
31-
keywords = ["dashboard", "data visualization", "survey data", "categorical data",
31+
keywords = ["dashboard", "data visualization", "survey data", "categorical data",
3232
"interactive visualization", "bokeh", "panel"]
3333

3434
[project.scripts]

survey_dashboard/hmc_layout/hmc_custom_layout.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,38 @@
11
hmc_custom_css_accordion ='''
2+
/* Apply HIFIS DIN font to all panel components */
3+
.bk-root,
4+
.bk-panel-models-accordion,
5+
.bk-panel-models-card,
6+
.bk-panel-models-card-header,
7+
.bk-panel-models-card-button,
8+
.bk-panel-models-card-title,
9+
.bk-panel-models-card-content,
10+
.bk-panel-models-markup,
11+
.bk-panel-models-markup-html,
12+
.bk-panel-models-layout-Column,
13+
.bk-panel-models-layout-row,
14+
.bk-input,
15+
.bk-btn,
16+
.bk.card,
17+
.bk.accordion,
18+
.bk.card-header,
19+
.bk.accordion-header,
20+
.bk.card-button,
21+
.bk.card-title,
22+
select,
23+
option,
24+
input,
25+
textarea,
26+
.bk-input-group,
27+
.bk-input select,
28+
.bk-input option,
29+
.choices,
30+
.choices__inner,
31+
.choices__list,
32+
.choices__item {
33+
font-family: 'HIFIS DIN', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
34+
}
35+
236
.bk.card {
337
border: 1px solid rgba(0,0,0,.125);
438
border-radius: 0.25rem;

survey_dashboard/plots.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,17 @@ def add_legend_at(fig, position='right'):
7575
"x_range.range_padding": 0.1,
7676
"xgrid.grid_line_color": None,
7777
"xaxis.major_label_orientation": 1,
78+
"title.text_font": 'HIFIS DIN',
7879
"title.text_font_size": '18px',
80+
"yaxis.axis_label_text_font": 'HIFIS DIN',
7981
"yaxis.axis_label_text_font_size": '18px',
82+
"xaxis.axis_label_text_font": 'HIFIS DIN',
8083
"xaxis.axis_label_text_font_size": '18px',
84+
"xaxis.major_label_text_font": 'HIFIS DIN',
8185
"xaxis.major_label_text_font_size": '16px',
86+
"yaxis.major_label_text_font": 'HIFIS DIN',
8287
"yaxis.major_label_text_font_size": '16px',
88+
"legend.label_text_font": 'HIFIS DIN',
8389
"toolbar.logo": None,
8490
"toolbar_location": "right",
8591
"legend.location": "top_right",
@@ -95,11 +101,17 @@ def add_legend_at(fig, position='right'):
95101
"x_range.range_padding": 0.1,
96102
#"xgrid.grid_line_color": None,
97103
"xaxis.major_label_orientation": 1,
104+
"title.text_font": 'HIFIS DIN',
98105
"title.text_font_size": '18px',
106+
"yaxis.axis_label_text_font": 'HIFIS DIN',
99107
"yaxis.axis_label_text_font_size": '18px',
108+
"xaxis.axis_label_text_font": 'HIFIS DIN',
100109
"xaxis.axis_label_text_font_size": '18px',
110+
"xaxis.major_label_text_font": 'HIFIS DIN',
101111
"xaxis.major_label_text_font_size": '16px',
112+
"yaxis.major_label_text_font": 'HIFIS DIN',
102113
"yaxis.major_label_text_font_size": '16px',
114+
"legend.label_text_font": 'HIFIS DIN',
103115
"toolbar.logo": None,
104116
"toolbar_location": "right",
105117
"legend.location": "top_right",
@@ -115,11 +127,17 @@ def add_legend_at(fig, position='right'):
115127
# Note: No x_range.range_padding for pie charts as they use numeric ranges
116128
"xgrid.grid_line_color": None,
117129
"xaxis.major_label_orientation": 1,
130+
"title.text_font": 'HIFIS DIN',
118131
"title.text_font_size": '18px',
132+
"yaxis.axis_label_text_font": 'HIFIS DIN',
119133
"yaxis.axis_label_text_font_size": '18px',
134+
"xaxis.axis_label_text_font": 'HIFIS DIN',
120135
"xaxis.axis_label_text_font_size": '18px',
136+
"xaxis.major_label_text_font": 'HIFIS DIN',
121137
"xaxis.major_label_text_font_size": '16px',
138+
"yaxis.major_label_text_font": 'HIFIS DIN',
122139
"yaxis.major_label_text_font_size": '16px',
140+
"legend.label_text_font": 'HIFIS DIN',
123141
"toolbar.logo": None,
124142
"toolbar_location": "right",
125143
"legend.location": "top_right",
@@ -136,11 +154,17 @@ def add_legend_at(fig, position='right'):
136154
# Note: No x_range.range_padding for horizontal bars as x_range is numeric
137155
"xgrid.grid_line_color": None,
138156
"xaxis.major_label_orientation": 1,
157+
"title.text_font": 'HIFIS DIN',
139158
"title.text_font_size": '18px',
159+
"yaxis.axis_label_text_font": 'HIFIS DIN',
140160
"yaxis.axis_label_text_font_size": '18px',
161+
"xaxis.axis_label_text_font": 'HIFIS DIN',
141162
"xaxis.axis_label_text_font_size": '18px',
163+
"xaxis.major_label_text_font": 'HIFIS DIN',
142164
"xaxis.major_label_text_font_size": '16px',
165+
"yaxis.major_label_text_font": 'HIFIS DIN',
143166
"yaxis.major_label_text_font_size": '16px',
167+
"legend.label_text_font": 'HIFIS DIN',
144168
"toolbar.logo": None,
145169
"toolbar_location": "right",
146170
"legend.location": "top_right",
@@ -966,8 +990,8 @@ def interactive_wordcloud(wordcloud, **kwargs):
966990
x_axis_type= None, y_axis_type=None,#,
967991
tooltips=tooltips
968992
)
969-
glyph = Text(x="x", y="y", text="text", angle='angle', angle_units='deg',
970-
text_color="color", text_font_size='font_size', text_font={'value': font_family}, **kwargs)
993+
glyph = Text(x="x", y="y", text="text", angle='angle', angle_units='deg',
994+
text_color="color", text_font_size='font_size', text_font={'value': 'HIFIS DIN'}, **kwargs)
971995
fig.add_glyph(source, glyph)
972996

973997
fig.background_fill_color = '#00000000' #F7F7F7', #transparent

0 commit comments

Comments
 (0)