Skip to content

Commit

Permalink
fixup python dependency / cleanup (#199)
Browse files Browse the repository at this point in the history
* fixup python dependencies, better cleanup

* use stop_service if service isn't needed
  • Loading branch information
wiedehopf authored Sep 13, 2024
1 parent 955fed2 commit 8c8ff78
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ RUN set -x && \
TEMP_PACKAGES+=(libfftw3-dev) && \
# mlat-client dependencies
KEPT_PACKAGES+=(python3-minimal) && \
KEPT_PACKAGES+=(python3-distutils) && \
KEPT_PACKAGES+=(python3-pkg-resources) && \
TEMP_PACKAGES+=(python3-distutils) && \
TEMP_PACKAGES+=(python3-dev) && \
TEMP_PACKAGES+=(python3-setuptools) && \
# piaware dependencies
KEPT_PACKAGES+=(itcl3) && \
KEPT_PACKAGES+=(tcllib) && \
Expand Down Expand Up @@ -203,10 +205,11 @@ RUN set -x && \
curl -L -o "$BLADERF_RBF_PATH/adsbx115.rbf" https://www.nuand.com/fpga/adsbx115.rbf && \
# Clean up
apt-get remove -y ${TEMP_PACKAGES[@]} && \
apt-get autoremove -y && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
apt-get clean -y && \
rm -rf /src /tmp/* /var/lib/apt/lists/* && \
find /var/log -type f -iname "*log" -exec truncate --size 0 {} \; && \
# remove pycache
find /usr | grep -E "/__pycache__$" | xargs rm -rf || true && \
rm -rf /src /tmp/* /var/lib/apt/lists/* /var/log/* /var/cache/* && \
# Store container version
grep piaware /VERSIONS | cut -d " " -f 2 > /IMAGE_VERSION

Expand Down
5 changes: 3 additions & 2 deletions rootfs/etc/s6-overlay/scripts/978raw-splitter
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# shellcheck shell=bash
set -eo pipefail

source /scripts/common

# Don't continue if UAT_RECEIVER_HOST isn't set
if [[ -z "$UAT_RECEIVER_HOST" ]]; then
sleep 86400
exit 0
stop_service
fi

# shellcheck disable=SC2016
Expand Down
5 changes: 3 additions & 2 deletions rootfs/etc/s6-overlay/scripts/beast-splitter
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# shellcheck shell=bash
set -eo pipefail

source /scripts/common

# Don't continue if BEASTHOST isn't set
if [[ -z "$BEASTHOST" ]]; then
sleep 86400
exit 0
stop_service
fi

# Prepare beast-splitter command line
Expand Down
5 changes: 3 additions & 2 deletions rootfs/etc/s6-overlay/scripts/dump1090
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# shellcheck shell=bash
set -eo pipefail

source /scripts/common

# Don't continue if ADSB not used
if [[ -n "$BEASTHOST" ]]; then
RUN_DUMP1090="true"
Expand All @@ -13,8 +15,7 @@ if [[ -n "$RECEIVER_TYPE" ]]; then
RUN_DUMP1090="true"
fi
if [[ -z "$RUN_DUMP1090" ]]; then
sleep 86400
exit 0
stop_service
fi

mkdir -p /run/dump1090-fa
Expand Down
5 changes: 3 additions & 2 deletions rootfs/etc/s6-overlay/scripts/dump978
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/command/with-contenv bash
#shellcheck shell=bash

source /scripts/common

# Don't continue if UAT not used
if [[ -n "$UAT_RECEIVER_TYPE" ]]; then
if [[ "$UAT_RECEIVER_TYPE" != "none" ]]; then
Expand All @@ -11,8 +13,7 @@ if [[ -n "$UAT_RECEIVER_TYPE" ]]; then
fi

if [[ -z "$RUN_DUMP978" ]]; then
sleep 86400
exit 0
stop_service
fi


Expand Down
5 changes: 3 additions & 2 deletions rootfs/etc/s6-overlay/scripts/skyaware978
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/command/with-contenv bash
#shellcheck shell=bash

source /scripts/common

# Don't continue if UAT not used
if [[ -n "$UAT_RECEIVER_HOST" ]]; then
RUN_SKYAWARE978="true"
Expand All @@ -13,8 +15,7 @@ if [[ -n "$UAT_RECEIVER_TYPE" ]]; then
fi

if [[ -z "$RUN_SKYAWARE978" ]]; then
sleep 86400
exit 0
stop_service
fi

mkdir -p /run/skyaware978
Expand Down

0 comments on commit 8c8ff78

Please sign in to comment.