mirror of
https://codeberg.org/langfingaz/bbb-status
synced 2024-12-03 22:15:02 +01:00
build using requirements.txt; improve README; fix: exclude pycache;
This commit is contained in:
parent
04c29d21e5
commit
8a652852a9
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
/secret/*.txt
|
/secret/*.txt
|
||||||
/data/*.xml
|
/data/*.xml
|
||||||
/src/__pycache__/
|
|
||||||
/plot/*.png
|
/plot/*.png
|
||||||
|
|
||||||
|
__pycache__/
|
||||||
|
6
.idea/other.xml
generated
Normal file
6
.idea/other.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PySciProjectComponent">
|
||||||
|
<option name="PY_SCI_VIEW_SUGGESTED" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
32
Dockerfile
32
Dockerfile
@ -2,6 +2,10 @@ FROM python:3.8-alpine
|
|||||||
|
|
||||||
WORKDIR /usr/src/
|
WORKDIR /usr/src/
|
||||||
|
|
||||||
|
# setting the correct timezone requires "zdtata"
|
||||||
|
# numpy (dependency of matplotlib) requires "make automake gcc ..."
|
||||||
|
# source: https://stackoverflow.com/a/48349161/6334421
|
||||||
|
# pillow (dependency of matplotlib) requires "zlib-dev jpeg-dev ..."
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk add \
|
apk add \
|
||||||
tzdata \
|
tzdata \
|
||||||
@ -14,13 +18,7 @@ RUN apk update && \
|
|||||||
ENV TZ=Europe/Berlin
|
ENV TZ=Europe/Berlin
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
# TODO
|
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
||||||
#COPY requirements.txt ./
|
|
||||||
#RUN pip3 install --no-cache-dir -r requirements.txt
|
|
||||||
|
|
||||||
# numpy (dependency of matplotlib)
|
|
||||||
# requires "make automake gcc ..."
|
|
||||||
# source: https://stackoverflow.com/a/48349161/6334421
|
|
||||||
|
|
||||||
# LDFLAGS required for "pip install pillow"
|
# LDFLAGS required for "pip install pillow"
|
||||||
# otherwise this would be necessary:
|
# otherwise this would be necessary:
|
||||||
@ -29,15 +27,19 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|||||||
# source: https://github.com/python-pillow/Pillow/issues/3103#issuecomment-382634946
|
# source: https://github.com/python-pillow/Pillow/issues/3103#issuecomment-382634946
|
||||||
ENV LDFLAGS=-L/usr/lib/x86_64-linux-gnu/
|
ENV LDFLAGS=-L/usr/lib/x86_64-linux-gnu/
|
||||||
|
|
||||||
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
COPY requirements.txt ./
|
||||||
RUN python3 -m pip install --no-cache-dir --upgrade requests
|
RUN python3 -m pip install --no-cache-dir --upgrade -r requirements.txt
|
||||||
RUN python3 -m pip install --no-cache-dir --upgrade setuptools
|
#
|
||||||
RUN python3 -m pip install --no-cache-dir --upgrade numpy
|
# if the above fails, try using the below instead
|
||||||
RUN python3 -m pip install --no-cache-dir --upgrade pillow
|
#
|
||||||
RUN python3 -m pip install --no-cache-dir --upgrade matplotlib
|
#RUN python3 -m pip install --no-cache-dir --upgrade requests
|
||||||
|
#RUN python3 -m pip install --no-cache-dir --upgrade setuptools
|
||||||
|
#RUN python3 -m pip install --no-cache-dir --upgrade numpy
|
||||||
|
#RUN python3 -m pip install --no-cache-dir --upgrade pillow
|
||||||
|
#RUN python3 -m pip install --no-cache-dir --upgrade matplotlib
|
||||||
|
|
||||||
COPY ./src/ ./
|
COPY src/ ./
|
||||||
RUN chmod +x ./langfingaz/main.py
|
RUN chmod +x langfingaz/main.py
|
||||||
|
|
||||||
# unbuffered output option otherwise script sleeps before any output appears
|
# unbuffered output option otherwise script sleeps before any output appears
|
||||||
# python -u
|
# python -u
|
||||||
|
11
README.md
11
README.md
@ -16,7 +16,14 @@ Save these two values in the first line of the following files:
|
|||||||
|
|
||||||
## run
|
## run
|
||||||
|
|
||||||
|
Start logging in the background:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
docker-compose build
|
|
||||||
docker-compose up
|
Generate a new plot with the saved data:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sudo docker-compose run bbb-status plot
|
||||||
```
|
```
|
||||||
|
@ -40,7 +40,12 @@ def doPlotMeetings(bbbStati: List[BbbStatus]) -> Path:
|
|||||||
voices.append(bbbStatus.voiceParticipantCount)
|
voices.append(bbbStatus.voiceParticipantCount)
|
||||||
|
|
||||||
# Note that even in the OO-style, we use `.pyplot.figure` to create the figure.
|
# Note that even in the OO-style, we use `.pyplot.figure` to create the figure.
|
||||||
fig, ax = plt.subplots() # Create a figure and an axes.
|
_a, _b = plt.subplots() # Create a figure and an axes.
|
||||||
|
fig: plt.Figure = _a
|
||||||
|
ax = _b # of type plt.axes.Axes ??
|
||||||
|
if not (issubclass(type(fig), plt.Figure)):
|
||||||
|
raise ValueError("expected Figure")
|
||||||
|
|
||||||
ax.plot(time, participants, label='participants') # Plot some data on the axes.
|
ax.plot(time, participants, label='participants') # Plot some data on the axes.
|
||||||
ax.plot(time, videos, label='video') # Plot more data on the axes...
|
ax.plot(time, videos, label='video') # Plot more data on the axes...
|
||||||
ax.plot(time, voices, label='voice') # ... and some more.
|
ax.plot(time, voices, label='voice') # ... and some more.
|
||||||
|
Loading…
Reference in New Issue
Block a user