Skip to content

Commit

Permalink
as dict
Browse files Browse the repository at this point in the history
  • Loading branch information
cnheider committed May 27, 2024
1 parent f587644 commit 3c02f64
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions heimdallr/configuration/heimdallr_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
vision="https://travis-ci.com/aivclab/vision.svg?branch=master",
RayKarsten="https://github.com/aivclab/RayKarstenWebAsm.svg",
dmr="https://github.com/aivclab/dmr.svg",
)
).as_dict()
BUILD_STATUS_INTERVAL = "build-status-interval"

DEBUG = True

ALL_CONSTANTS = NOD(locals())
ALL_CONSTANTS = NOD(locals()).as_dict()
24 changes: 12 additions & 12 deletions heimdallr/entry_points/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Created on 19/03/2020
"""


import copy
import datetime
import json
Expand All @@ -23,6 +22,14 @@
from dash.html import Div
from draugr.writers import LogWriter, MockWriter, Writer
from flask import Response
from paho import mqtt
from paho.mqtt.client import Client
from paho.mqtt.enums import CallbackAPIVersion
from pandas import DataFrame
from waitress import serve
from warg import NOD, default_datetime_repr, ensure_existence

from heimdallr import PROJECT_APP_PATH, PROJECT_NAME
from heimdallr.configuration.heimdallr_config import ALL_CONSTANTS
from heimdallr.configuration.heimdallr_settings import (
HeimdallrSettings,
Expand All @@ -34,14 +41,6 @@
per_machine_per_device_pie_charts,
to_overall_gpu_process_df,
)
from paho import mqtt
from paho.mqtt.client import Client
from pandas import DataFrame
from waitress import serve
from warg import NOD, default_datetime_repr
from warg import ensure_existence

from heimdallr import PROJECT_APP_PATH, PROJECT_NAME

__all__ = ["main"]

Expand Down Expand Up @@ -81,7 +80,8 @@
HOSTNAME = socket.gethostname()
CLIENT_ID = HOSTNAME
MQTT_CLIENT = Client(
client_id=CLIENT_ID,
CallbackAPIVersion.VERSION1,
CLIENT_ID,
# clean_session=True
)
DASH_APP = Dash(
Expand Down Expand Up @@ -175,7 +175,7 @@ def update_graph(n: int) -> Div:
compute_machines = []
if GPU_STATS:
compute_machines.extend(
per_machine_per_device_pie_charts(copy.deepcopy(GPU_STATS), KEEP_ALIVE)
per_machine_per_device_pie_charts(GPU_STATS.as_dict(), KEEP_ALIVE.as_dict())
)
return Div(compute_machines)

Expand Down Expand Up @@ -226,7 +226,7 @@ def update_table(n: int) -> Div:
compute_machines = []

if DU_STATS:
df = to_overall_du_process_df(copy.deepcopy(DU_STATS))
df = to_overall_du_process_df(DU_STATS.as_dict())
else:
df = DataFrame(["No data"], columns=("data",))

Expand Down
3 changes: 2 additions & 1 deletion requirements/requirements_server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ PyGithub
msal
pillow>=10.0.1 # not directly required, pinned by Snyk to avoid a vulnerability
requests>=2.32.0 # not directly required, pinned by Snyk to avoid a vulnerability
wheel>=0.38.0 # not directly required, pinned by Snyk to avoid a vulnerability
wheel>=0.38.0 # not directly required, pinned by Snyk to avoid a vulnerability
waitress

0 comments on commit 3c02f64

Please sign in to comment.