Skip to content

Commit 680c473

Browse files
committed
Add initial treasury dashboard HUD
1 parent b69948d commit 680c473

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+515
-21
lines changed

.github/workflows/deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ jobs:
8787
DIGITALOCEAN_APP_NAME: ${{ secrets.DIGITALOCEAN_APP_NAME }}
8888
DIGITALOCEAN_APP_DOMAIN: ${{ secrets.DIGITALOCEAN_APP_DOMAIN }}
8989
DIGITALOCEAN_APP_DOMAIN_ALIAS: ${{ vars.DIGITALOCEAN_APP_DOMAIN_ALIAS }}
90-
DIGITALOCEAN_SIZE_SLUG: ${{ secrets.DIGITALOCEAN_SIZE_SLUG }}
90+
DIGITALOCEAN_SIZE_SLUG: ${{ vars.DIGITALOCEAN_SIZE_SLUG }}
9191
PREFECT_API_KEY: ${{ secrets.PREFECT_API_KEY }}
9292
PREFECT_API_URL: ${{ secrets.PREFECT_API_URL }}
9393
ENV: ${{ secrets.ENV }}
94-
GUNICORN_TIMEOUT: ${{ secrets.GUNICORN_TIMEOUT }}
94+
GUNICORN_TIMEOUT: ${{ vars.GUNICORN_TIMEOUT }}
9595
steps:
9696
- name: Check out source repository
9797
uses: actions/checkout@v2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,5 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
file_system_store/

app-spec.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ envs:
3030
name: ${DIGITALOCEAN_APP_NAME}
3131
region: nyc
3232
services:
33+
- environment_slug: python
34+
image:
35+
registry_type: DOCR
36+
repository: dash-apps
37+
tag: ${GITHUB_SHA}
38+
health_check:
39+
http_path: /
40+
initial_delay_seconds: 60
41+
timeout_seconds: 1200
42+
period_seconds: 20
43+
success_threshold: 1
44+
failure_threshold: 20
45+
http_port: 8050
46+
routes:
47+
- path: /
48+
instance_count: 1
49+
instance_size_slug: ${DIGITALOCEAN_SIZE_SLUG}
50+
name: treasury-dashboard
51+
run_command: gunicorn --worker-tmp-dir /dev/shm --timeout ${GUNICORN_TIMEOUT} src.apps.treasury.app:server
52+
source_dir: /
3353
- environment_slug: python
3454
image:
3555
registry_type: DOCR

docker-compose.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
version: "3.5"
22

33
services:
4-
tco2-dashboard:
5-
image: dash-apps
4+
treasury:
5+
# image: dash-apps
66
build:
77
context: ./
88
working_dir: /src
99
env_file: .env
1010
entrypoint: python
11-
command: ["-m", "src.apps.tco2_dashboard.app"]
11+
command: ["-m", "src.apps.treasury.index"]
1212
ports:
1313
- 8050:8050
1414
volumes:
1515
- ./:/src
1616

17-
api:
18-
image: dash-apps
19-
working_dir: /src
20-
env_file: .env
21-
entrypoint: python
22-
command: ["-m", "src.apps.api.app"]
23-
ports:
24-
- 8051:8050
25-
volumes:
26-
- ./:/src
17+
# api:
18+
# image: dash-apps
19+
# working_dir: /src
20+
# env_file: .env
21+
# entrypoint: python
22+
# command: ["-m", "src.apps.api.app"]
23+
# ports:
24+
# - 8051:8050
25+
# volumes:
26+
# - ./:/src

requirements1.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
dash-bootstrap-components==1.0.3
2+
dash-extensions==0.1.1
23
Flask_Caching==1.10.1
34
gunicorn
45
millify
56
orjson
67
pycountry==22.1.10
78
pytest
8-
pandas<2.0.0
9+
pandas<3.0
10+
subgrounds<1.7
911
werkzeug<2.1.0
1012
circlify==0.14.0
1113
matplotlib==3.5.2
1214
plotly==5.7.0
1315
kaleido==0.2.1
14-
dash==2.8.1
16+
dash==2.14.2
1517

requirements2.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
prefect==2.12.0
22
prefect-aws==0.3.7
3-
pydantic==1.10.9
43
pyarrow==12.0.0
54
Flask-RESTful==0.3.10

scripts/smoketest.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
FAILING=0
44

5-
ENTRIES=(src/apps/api/app.py:/api/v1)
5+
ENTRIES=(src/apps/api/app.py:/api/v1 src/apps/treasury/index.py:/)
66

77
for ENTRY in ${ENTRIES[@]}; do
88
ITEMS=(`echo $ENTRY | tr ":" " "`)
99
APP=${ITEMS[0]}
1010
SUBPATH=${ITEMS[1]}
1111
URL=http://127.0.0.1:8050$SUBPATH
12-
echo $APP : Starting
12+
echo $APP : Starting
1313
module="${APP////.}"
1414
nohup python -m ${module%.py} > /tmp/nohup.out 2>&1 &
1515
DASH_PID=$!
@@ -18,7 +18,7 @@ for ENTRY in ${ENTRIES[@]}; do
1818
echo $APP : Pinging $URL
1919
RESP_CODE=$(curl --head --location --write-out %{http_code} --silent --output response.txt $URL)
2020
echo $APP : Response code: $RESP_CODE
21-
kill $DASH_PID
21+
kill $DASH_PID
2222
# kill `lsof -w -n -i tcp:8050 | awk '$2!="PID" {print $2;}'` | head -n 1
2323
if [ "$RESP_CODE" != "200" ];
2424
then

src/apps/treasury/__init__.py

Whitespace-only changes.

src/apps/treasury/app.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import dash_bootstrap_components as dbc
2+
from dash import Dash
3+
4+
app = Dash(
5+
__name__,
6+
external_stylesheets=[dbc.themes.DARKLY],
7+
suppress_callback_exceptions=True,
8+
title="KlimaDAO Treasury Dashboard",
9+
use_pages=True,
10+
meta_tags=[
11+
{
12+
'name': 'viewport',
13+
'content':
14+
'width=device-width, initial-scale=1.0, maximum-scale=1.2, minimum-scale=0.5,'
15+
},
16+
{"property": "og:type", "content": "website"},
17+
{"property": "og:site_name", "content": "KlimaDAO Treasury Dashboard"},
18+
{"property": "og:title", "content": "Overview of KlimaDAO treasury composition and Green Ratio status"},
19+
{
20+
"property": "og:description",
21+
"content":
22+
"Overview of the inner workings of "
23+
"KlimaDAO's carbon-backed reserve currency protocol."
24+
},
25+
{
26+
"property": "og:image",
27+
"content": "https://static.wixstatic.com/media/5f17af_bfd51fccab89436e82f2cc2911097544~mv2.png/v1/fill/w_1306,h_734,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/5f17af_bfd51fccab89436e82f2cc2911097544~mv2.png" # noqa: E501
28+
},
29+
{"name": "twitter:card", "content": "summary_large_image"},
30+
{"name": "twitter:site", "content": "@discord"},
31+
{"name": "twitter:creator", "content": "@KlimaDAO"}
32+
]
33+
)
75.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)