-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SYS-623 re-implement weewx installation for version 5.x (#165)
SYS-623 re-implement weewx image for version 5.x
- Loading branch information
1 parent
1422ce2
commit e6904cc
Showing
11 changed files
with
75 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM alpine:3.19 | ||
FROM alpine:3.20 | ||
MAINTAINER Rich Braun "[email protected]" | ||
ARG BUILD_DATE | ||
ARG VCS_REF | ||
|
@@ -43,52 +43,47 @@ ENV AIRLINK_HOST= \ | |
TZ_CODE=10 \ | ||
WEBCAM_URL=https://www.wunderground.com/wundermap?lat=37.761&lon=-122.435&zoom=5&radar=1&cam=1 \ | ||
WEEK_START=6 \ | ||
WX_USER=weewx \ | ||
XTIDE_LOCATION=unset | ||
WX_ROOT=/home/weewx/weewx-data \ | ||
WX_USER=weewx | ||
|
||
ARG WEEWX_VERSION=5.0.2 | ||
ARG WEEWX_SHA=3e55fdf359b9aa3388a1826f0bfad6665a1a865ddfa521286449bcad036c4262 | ||
ARG WEEWX_VERSION=5.1.0 | ||
ARG WEEGREEN_VERSION=v0.12 | ||
ARG AIRLINK_VERSION=1.4 | ||
ARG WX_GROUP=dialout | ||
ARG WX_UID=2071 | ||
ARG XTIDE_SHA=e5c4afbb17269fdde296e853f2cb84845ed1c1bb1932f780047ad71d623bc681 | ||
ARG AIRLINK_SHA=6392ee1d8e96a543306f16430ec9095b79dd7d0aacf8078171aa61b060a49745 | ||
|
||
COPY install-input.txt requirements.txt /root/ | ||
RUN apk add --no-cache --update \ | ||
curl freetype libjpeg libstdc++ openssh openssl python3 py3-cheetah \ | ||
py3-configobj py3-mysqlclient py3-pillow py3-requests py3-six py3-usb \ | ||
py3-configobj py3-mysqlclient py3-pillow py3-pymysql py3-pyserial \ | ||
py3-requests py3-six py3-usb \ | ||
rsync rsyslog tzdata && \ | ||
adduser -u $WX_UID -s /bin/sh -G $WX_GROUP -D $WX_USER && \ | ||
mkdir build && cd build && \ | ||
curl -sLo weewx.tgz \ | ||
http://www.weewx.com/downloads/released_versions/weewx-$WEEWX_VERSION.tgz && \ | ||
echo "$WEEWX_SHA weewx.tgz" >> /build/checksums && \ | ||
sha256sum -c /build/checksums && \ | ||
apk add --no-cache --virtual .fetch-deps \ | ||
file freetype-dev g++ gawk gcc git jpeg-dev libpng-dev make musl-dev \ | ||
py3-pip py3-wheel python3-dev zlib-dev && \ | ||
# | ||
# Lots of breaking changes since 4.x, alas: ticket is SYS-623. | ||
# See https://github.com/weewx/weewx/wiki/v5-upgrade | ||
# The setup.py procedure found in 4.x went missing in 5.0 | ||
# | ||
# TODO deal with break-system-packages, no idea what broke | ||
pip install -r /root/requirements.txt --break-system-packages && \ | ||
tar xf weewx.tgz --strip-components=1 && \ | ||
### TODO 5/20/2024 version 5.0 no longer has setup.py. Build is broken. | ||
cd /build && \ | ||
./setup.py build && ./setup.py install < /root/install-input.txt && \ | ||
apk add --no-cache --virtual .fetch-deps git && \ | ||
git clone -b $WEEGREEN_VERSION --depth 1 \ | ||
https://github.com/instantlinux/weewx-WeeGreen.git \ | ||
/home/$WX_USER/skins/WeeGreen && \ | ||
curl -sLo /tmp/weewx-airlink.zip \ | ||
https://github.com/chaunceygardiner/weewx-airlink/archive/master.zip && \ | ||
/home/$WX_USER/bin/wee_extension --install /tmp/weewx-airlink.zip && \ | ||
$WX_ROOT/skins/WeeGreen && \ | ||
apk del .fetch-deps && \ | ||
rm -fr /build /home/$WX_USER/weewx.conf.2* /home/$WX_USER/docs \ | ||
/home/$WX_USER/skins/WeeGreen/.git \ | ||
/root/.cache /var/cache/apk/* /var/log/* /tmp/* && \ | ||
find /home/$WX_USER/bin -name '*.pyc' -exec rm '{}' +; | ||
chown $WX_USER $WX_ROOT && \ | ||
chown -R $WX_USER $WX_ROOT/skins && \ | ||
rm -fr $WX_ROOT/skins/WeeGreen/.git && \ | ||
find /usr/lib/python3* -name __pycache__ -exec rm -r '{}' +; | ||
|
||
COPY install-input.txt entrypoint.sh log.conf /home/$WX_USER | ||
USER $WX_USER | ||
RUN VENV=/home/$WX_USER/weewx-venv && \ | ||
python3 -m venv $VENV --system-site-packages && \ | ||
source $VENV/bin/activate && \ | ||
python3 -m pip install weewx && \ | ||
$VENV/bin/weectl station create < /home/$WX_USER/install-input.txt && \ | ||
cat /home/$WX_USER/log.conf >> $WX_ROOT/weewx.conf && \ | ||
curl -sLo /tmp/weewx-airlink.zip \ | ||
https://github.com/chaunceygardiner/weewx-airlink/releases/download/v$AIRLINK_VERSION/weewx-airlink-$AIRLINK_VERSION.zip && \ | ||
echo "$AIRLINK_SHA /tmp/weewx-airlink.zip" >> /tmp/checksums && \ | ||
sha256sum -c /tmp/checksums && \ | ||
$VENV/bin/weectl extension install /tmp/weewx-airlink.zip --yes && \ | ||
rm -fr /home/$WX_USER/.cache && \ | ||
find $VENV -name __pycache__ -exec rm -r '{}' +; | ||
|
||
COPY entrypoint.sh /usr/local/bin | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
USER root | ||
ENTRYPOINT ["/home/weewx/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ DESC | |
90.0 | ||
n | ||
us | ||
5 | ||
6 | ||
serial | ||
/dev/ttyUSB0 | ||
n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Section added by Dockerfile | ||
[Logging] | ||
[[root]] | ||
handlers = console, |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters