dric2018 commited on
Commit
9707089
·
verified ·
1 Parent(s): cb2b40d

Upload 5 files

Browse files
Files changed (5) hide show
  1. Dockerfile +1 -1
  2. app.py +14 -3
  3. config.py +1 -1
  4. main.py +9 -0
  5. requirements.txt +3 -1
Dockerfile CHANGED
@@ -11,4 +11,4 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
12
  COPY --chown=user . /app
13
 
14
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
11
 
12
  COPY --chown=user . /app
13
 
14
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
app.py CHANGED
@@ -83,7 +83,6 @@ fig.update_geos(
83
  )
84
 
85
  # App
86
-
87
  external_stylesheets = ["https://fonts.googleapis.com/css2?family=Tahoma&display=swap"]
88
  app = dash.Dash("Africa HPC Tracker", external_stylesheets=external_stylesheets)
89
  server = app.server
@@ -96,8 +95,8 @@ app.layout = html.Div(
96
  children=[
97
  html.H1(
98
  id='header-text',
99
- children='Africa HPC Tracker',
100
- style={'color':TITLE_COLOR}
101
  ),
102
  html.Div(
103
  id='hover-info',
@@ -107,12 +106,24 @@ app.layout = html.Div(
107
  id='hpc-tracker',
108
  figure=fig
109
  ),
 
 
 
 
 
 
 
 
 
 
110
 
 
111
  ],
112
  style={
113
  'textAlign' : 'center',
114
  'font-family' : 'Arial, sans-serif',
115
  }
 
116
  )
117
 
118
  # Callbacks
 
83
  )
84
 
85
  # App
 
86
  external_stylesheets = ["https://fonts.googleapis.com/css2?family=Tahoma&display=swap"]
87
  app = dash.Dash("Africa HPC Tracker", external_stylesheets=external_stylesheets)
88
  server = app.server
 
95
  children=[
96
  html.H1(
97
  id='header-text',
98
+ children='Africa Compute Tracker',
99
+ style={'color':TITLE_COLOR, 'textAlign' : 'center'}
100
  ),
101
  html.Div(
102
  id='hover-info',
 
106
  id='hpc-tracker',
107
  figure=fig
108
  ),
109
+ html.P(
110
+ children=[
111
+ "Report your compute infrastructure: ",
112
+ html.A(
113
+ "fill out the form",
114
+ href="#",
115
+ # target="_blank"
116
+ )
117
+ ],
118
+ style={'color':DETAILS_COLOR}
119
 
120
+ )
121
  ],
122
  style={
123
  'textAlign' : 'center',
124
  'font-family' : 'Arial, sans-serif',
125
  }
126
+
127
  )
128
 
129
  # Callbacks
config.py CHANGED
@@ -3,4 +3,4 @@ class Config:
3
  data_path = "data.json"
4
  HOST = "0.0.0.0"
5
  PORT = 8050
6
- IS_DEBUG = True
 
3
  data_path = "data.json"
4
  HOST = "0.0.0.0"
5
  PORT = 8050
6
+ IS_DEBUG = False
main.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # main.py
2
+ from fastapi import FastAPI
3
+ from fastapi.middleware.wsgi import WSGIMiddleware
4
+ from app import server as dash_server
5
+
6
+ app = FastAPI()
7
+
8
+ # Mount the Dash application as a sub-application
9
+ app.mount("/", WSGIMiddleware(dash_server))
requirements.txt CHANGED
@@ -2,4 +2,6 @@ dash
2
  plotly
3
  pandas
4
  uvicorn
5
- huggingface_hub
 
 
 
2
  plotly
3
  pandas
4
  uvicorn
5
+ huggingface_hub
6
+ fastapi
7
+ python-multipart