-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
42 lines (32 loc) · 983 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import asyncio
import dotenv
import os
import streamlit as st
from streamlit.errors import StreamlitAPIException
from assets import Assets, init_assets
from utils.otel import init_opentelemetry
import widgets.main
async def main() -> None:
# Environment Variable Configuration
dotenv.load_dotenv()
# Page Configuration
try:
st.set_page_config(
initial_sidebar_state='collapsed',
layout='wide',
page_icon=Assets.load_image('logo.png'),
page_title='OpenARK | Dashboard',
)
except StreamlitAPIException:
pass
# OpenTelemetry Configuration
init_opentelemetry()
# Assets Configuration
assets = init_assets(
debug=os.environ.get('OPENARK_DEBUG', 'true').lower() == 'true' or
not os.path.exists('/run/secrets/kubernetes.io/serviceaccount'),
)
# Render a Page
await widgets.main.render(assets)
if __name__ == '__main__':
asyncio.run(main())