mirror of
https://codeberg.org/langfingaz/bbb-status
synced 2024-12-02 22:05:03 +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
|
||||
/data/*.xml
|
||||
/src/__pycache__/
|
||||
/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/
|
||||
|
||||
# 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 && \
|
||||
apk add \
|
||||
tzdata \
|
||||
@ -14,13 +18,7 @@ RUN apk update && \
|
||||
ENV TZ=Europe/Berlin
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
# TODO
|
||||
#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
|
||||
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
||||
|
||||
# LDFLAGS required for "pip install pillow"
|
||||
# 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
|
||||
ENV LDFLAGS=-L/usr/lib/x86_64-linux-gnu/
|
||||
|
||||
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
||||
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 requirements.txt ./
|
||||
RUN python3 -m pip install --no-cache-dir --upgrade -r requirements.txt
|
||||
#
|
||||
# if the above fails, try using the below instead
|
||||
#
|
||||
#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/ ./
|
||||
RUN chmod +x ./langfingaz/main.py
|
||||
COPY src/ ./
|
||||
RUN chmod +x langfingaz/main.py
|
||||
|
||||
# unbuffered output option otherwise script sleeps before any output appears
|
||||
# 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
|
||||
|
||||
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)
|
||||
|
||||
# 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, videos, label='video') # Plot more data on the axes...
|
||||
ax.plot(time, voices, label='voice') # ... and some more.
|
||||
|
Loading…
Reference in New Issue
Block a user