Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renewed Autogain and fixes to HealthCheck #80

Merged
merged 61 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
5f258d6
initial commit - new autogain
kx1t Oct 12, 2023
9db96df
updates
kx1t Oct 12, 2023
4e47542
updates
kx1t Oct 12, 2023
cf807cd
updates
kx1t Oct 12, 2023
aa892d6
update
kx1t Oct 12, 2023
be25756
update
kx1t Oct 12, 2023
a471049
updates
kx1t Oct 13, 2023
c63644e
bug fix
kx1t Oct 13, 2023
9971563
reset stats on dump978 restart
kx1t Oct 13, 2023
275ae78
make stats gen after restart smoother
kx1t Oct 13, 2023
3b55712
cleanup
kx1t Oct 13, 2023
c1b02e0
more changes
kx1t Oct 13, 2023
870539b
logging improvements
kx1t Oct 13, 2023
879c57a
logging change
kx1t Oct 13, 2023
7df11ef
don't increment counter if stats aren't ready
kx1t Oct 13, 2023
c230773
Avoid error traps
kx1t Oct 14, 2023
24517da
Start counting runs from 1 instead of 0
kx1t Oct 14, 2023
a0328e8
allow suspension of autogain outside certain hours
kx1t Oct 16, 2023
cfd2a6f
typo and other stuff
kx1t Oct 16, 2023
51142ab
yet another typo :(
kx1t Oct 16, 2023
4c94119
stupid errors fixed
kx1t Oct 16, 2023
bf12ed2
stupid errors fixed
kx1t Oct 16, 2023
0d01cf9
ensure directories are created
kx1t Oct 16, 2023
5f0d9ed
fix resume time
kx1t Oct 16, 2023
eb55921
fix resume time
kx1t Oct 16, 2023
1a59015
fix resume time
kx1t Oct 16, 2023
5cd9ff7
improve Dockerfile
kx1t Oct 17, 2023
a37e3ac
improve flow
kx1t Oct 17, 2023
29bad4c
readme updates
kx1t Oct 18, 2023
ffa4574
made message type (raw v accepted) and count configurable
kx1t Oct 19, 2023
2fc0297
make `DUMP978_AUTOGAIN_ADJUSTMENT_LIMITS` default true
kx1t Oct 19, 2023
0f8b771
up READSB_AUTOGAIN_HIGH_PCT to 12.0
kx1t Oct 19, 2023
27de4a5
simplify rssi data collection
kx1t Oct 19, 2023
eae1b7d
updated autogain collection mechanism
kx1t Oct 20, 2023
de0d13a
updated autogain collection mechanism
kx1t Oct 20, 2023
64e5f0d
updated autogain collection mechanism
kx1t Oct 20, 2023
84face0
updated autogain collection mechanism
kx1t Oct 20, 2023
94be389
updated autogain collection mechanism
kx1t Oct 20, 2023
d3374ee
updated autogain collection mechanism
kx1t Oct 20, 2023
5b63940
updated autogain collection mechanism
kx1t Oct 20, 2023
7d4a4ce
more stuff
kx1t Oct 20, 2023
a9e1908
more stuff
kx1t Oct 20, 2023
5440f38
more stuff
kx1t Oct 20, 2023
cd657a1
more stuff
kx1t Oct 20, 2023
72a5835
more stuff
kx1t Oct 20, 2023
e9e941b
autogain updates
kx1t Oct 24, 2023
bb54d25
Merge branch 'autogain' of https://github.com/sdr-enthusiasts/docker-…
kx1t Oct 24, 2023
b1458aa
update autogain
kx1t Oct 24, 2023
9a8d0e1
remove some debug code
kx1t Oct 24, 2023
27ec002
updates
kx1t Oct 24, 2023
b0efcb3
update to flow
kx1t Oct 24, 2023
c01b7a4
recognize `$READSB_AUTOGAIN_USE_RAW` parameter for autogain
kx1t Oct 25, 2023
b312682
always collect autogain msgs until at least READSB_AUTOGAIN_MIN_SAMPL…
kx1t Oct 25, 2023
c48d7a9
fix for RSSIs that are in the -0.9 - 0.0 range
kx1t Oct 25, 2023
06a0b30
respect `DUMP978_AUTOGAIN_INITIAL_GAIN` on startup with autogain
kx1t Oct 26, 2023
3c7b273
set agreed default values
kx1t Oct 31, 2023
c9a2a94
multiple fixes for HealthCheck
kx1t Oct 31, 2023
9a879a6
Prep for future telegraf-less container
kx1t Oct 31, 2023
c0251de
final cleanup before merging
kx1t Oct 31, 2023
f00e84b
Merge branch 'main' into autogain
kx1t Nov 1, 2023
fd0b6cf
linting "fix"
kx1t Nov 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Pull markdownlint/markdownlint:latest Image
run: docker pull markdownlint/markdownlint:latest
- name: Run markdownlint against *.md files
run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD004,~MD013,~MD033,~MD026,~MD002,~MD022 $(find . -type f -iname '*.md' | grep -v '/.git/')
run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD004,~MD013,~MD033,~MD026,~MD002,~MD022,~MD007,~MD029,~MD012,~MD034 $(find . -type f -iname '*.md' | grep -v '/.git/')
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"MD033": false
"MD033": false,
"MD013": false
}
54 changes: 2 additions & 52 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,7 @@ FROM ghcr.io/sdr-enthusiasts/docker-baseimage:dump978-full

ENV PROMETHEUSPORT=9273 \
PROMETHEUSPATH="/metrics" \
###########################################################################
##### AUTOGAIN ENVIRONMENT VARS #####
# How often the autogain.sh is run (in seconds)
AUTOGAIN_SERVICE_PERIOD=900 \
# The autogain state file (init/finetune/finish)
AUTOGAIN_STATE_FILE="/run/autogain/state" \
# The current gain figure as-set by autogain
AUTOGAIN_CURRENT_VALUE_FILE="/run/autogain/autogain_current_value" \
# The timestamp (seconds since epoch) when the current gain figure was set
AUTOGAIN_CURRENT_TIMESTAMP_FILE="/run/autogain/autogain_current_timestamp" \
# The timestamp (seconds since epoch) when the current gain figure should be reviewed
AUTOGAIN_REVIEW_TIMESTAMP_FILE="/run/autogain/autogain_review_timestamp" \
# The maximum allowable percentage of strong messages
AUTOGAIN_PERCENT_STRONG_MESSAGES_MAX=10.0 \
# The minimum allowable percentage of strong messages
AUTOGAIN_PERCENT_STRONG_MESSAGES_MIN=0.5 \
# The number of seconds that autogain "init" stage should run for, for each gain level
AUTOGAIN_INITIAL_PERIOD=7200 \
# The minimum number of local_accepted messages that autogain "init" stage should run for, for each gain level
AUTOGAIN_INITIAL_MSGS_ACCEPTED=100000 \
# The number of seconds that autogain "finetune" stage should run for, for each gain level
AUTOGAIN_FINETUNE_PERIOD=604800 \
# The minimum number of local_accepted messages that autogain "finetune" stage should run for, for each gain level
AUTOGAIN_FINETUNE_MSGS_ACCEPTED=700000 \
# How long to run once finetune stage has finished before we start the process over (1 year)
AUTOGAIN_FINISHED_PERIOD=31536000 \
# Maximum gain level that autogain should use
AUTOGAIN_MAX_GAIN_VALUE=49.6 \
# Minimum gain level that autogain should use
AUTOGAIN_MIN_GAIN_VALUE=0.0 \
# State file that will disappear when the container is rebuilt/restarted - so autogain can detect container restart/rebuild
AUTOGAIN_RUNNING_FILE="/tmp/.autogain_running" \
# maximum accepted gain value
AUTOGAIN_MAX_GAIN_VALUE_FILE="/run/autogain/autogain_max_value" \
# minimum accepted gain value
AUTOGAIN_MIN_GAIN_VALUE_FILE="/run/autogain/autogain_min_value" \
# Current gain value
GAIN_VALUE_FILE="/tmp/.gain_current"
GAIN_VALUE_FILE="/var/globe_history/autogain/gain"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down Expand Up @@ -95,17 +58,7 @@ RUN set -x && \
&& \
# grab the bias t scripts
curl -o /etc/s6-overlay/scripts/05-rtlsdr-biastee-init https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-init && \
curl -o /etc/s6-overlay/scripts/05-rtlsdr-biastee-down https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-down && \
# fix bias t init
sed -i 's/READSB_DEVICE_TYPE/DUMP978_DEVICE_TYPE/g' /etc/s6-overlay/scripts/05-rtlsdr-biastee-init && \
sed -i 's/READSB_RTLSDR_DEVICE/DUMP978_RTLSDR_DEVICE/g' /etc/s6-overlay/scripts/05-rtlsdr-biastee-init && \
sed -i 's/READSB_ENABLE_BIASTEE/DUMP978_ENABLE_BIASTEE/g' /etc/s6-overlay/scripts/05-rtlsdr-biastee-init && \
sed -i 's/09-rtlsdr-biastee/05-rtlsdr-biastee/g' /etc/s6-overlay/scripts/05-rtlsdr-biastee-init && \
# fix bias t down
sed -i 's/READSB_DEVICE_TYPE/DUMP978_DEVICE_TYPE/g' /etc/s6-overlay/scripts/05-rtlsdr-biastee-down && \
sed -i 's/READSB_RTLSDR_DEVICE/DUMP978_RTLSDR_DEVICE/g' /etc/s6-overlay/scripts/05-rtlsdr-biastee-down && \
sed -i 's/READSB_ENABLE_BIASTEE/DUMP978_ENABLE_BIASTEE/g' /etc/s6-overlay/scripts/05-rtlsdr-biastee-down && \
sed -i 's/09-rtlsdr-biastee/05-rtlsdr-biastee/g' /etc/s6-overlay/scripts/05-rtlsdr-biastee-down && \
curl -o /etc/s6-overlay/scripts/05-rtlsdr-biastee-down https://raw.githubusercontent.com/sdr-enthusiasts/sdre-bias-t-common/main/09-rtlsdr-biastee-down && \
chmod +x /etc/s6-overlay/scripts/05-rtlsdr-biastee-init && \
chmod +x /etc/s6-overlay/scripts/05-rtlsdr-biastee-down && \
git config --global advice.detachedHead false && \
Expand Down Expand Up @@ -153,6 +106,3 @@ EXPOSE 30978/tcp 30979/tcp 37981/tcp

# Add healthcheck
HEALTHCHECK --timeout=60s --start-period=7200s --interval=600s CMD /scripts/healthcheck.sh

# TODO
# - work out a way to test - maybe capture some output and parse it?
Loading