Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
28080f6
save daily obsdb in the right place
markmac99 Apr 15, 2026
b02c7df
rename ec2.tf to calcserver.tf
markmac99 Apr 16, 2026
70359b8
quieten some s3 transfers
markmac99 Apr 16, 2026
4a3b726
rename ec2.tf in my acct to ukmonhelper_ec2.tf to make it clearer wha…
markmac99 Apr 16, 2026
b7badb9
update SSM params to reflect new serverid
markmac99 Apr 16, 2026
dd92ad0
bugfix in distributeCandidates - using wrong path
markmac99 Apr 16, 2026
9d3464e
add newline to getCostMetrics
markmac99 Apr 16, 2026
3d173c2
weird bug in statsToMqtt
markmac99 Apr 16, 2026
78217c4
bugfix in update_wmpl.sh for traj container
markmac99 Apr 16, 2026
2e20b0f
Script to create an AMI for the calcengine
markmac99 Apr 16, 2026
fdf117a
exclude test data when syncing from s3
markmac99 Apr 17, 2026
c834da0
writing databases and logs to the wrong target
markmac99 Apr 17, 2026
0168530
bad test on istest
markmac99 Apr 17, 2026
ad1b19b
typo in serveruserid
markmac99 Apr 17, 2026
b2ca89d
adding to server migration notes
markmac99 Apr 17, 2026
5502f23
purge old rawcsvs and fullcsvs older than 180 days
markmac99 Apr 17, 2026
d1ffcbb
improved housekeeping of old data
markmac99 Apr 17, 2026
e98ea05
make sure we scoop up data for 31/12
markmac99 Apr 17, 2026
8da5954
stop creation of an unused set of files
markmac99 Apr 17, 2026
70761a4
change default locations for container data
markmac99 Apr 21, 2026
0f861e9
put container logs in the right place
markmac99 Apr 21, 2026
b99e6ba
update dockerfile syntax
markmac99 Apr 21, 2026
b7bd066
change locations of test container data and output
markmac99 Apr 21, 2026
c9df319
remove incorrect comments
markmac99 Apr 21, 2026
41756b7
Add script to clean up deleted/duplicate trajs
markmac99 Apr 21, 2026
fc4fd1a
simplify the stats gathering and move to python
markmac99 Apr 22, 2026
0df6c0a
comment out unused files
markmac99 Apr 22, 2026
fd68a67
update reportOfLatestMatches to exclude deleted trajectories
markmac99 Apr 22, 2026
78ef3fd
add scp to requirements
markmac99 Apr 22, 2026
a40ecee
add SQL database maintenance to dataMaintenance
markmac99 Apr 22, 2026
a8c6645
incorrect default for datadir
markmac99 Apr 22, 2026
d9ec08f
update call to pymysql.connect
markmac99 Apr 22, 2026
a3e8752
ensure consolidateOutput rerunnable for prior years
markmac99 Apr 22, 2026
fd719d7
upgrading WMPL
markmac99 Apr 22, 2026
769e685
update gitignore a bit
markmac99 Apr 22, 2026
6c26cf4
bugfix to catch data from 31/12 each year
markmac99 Apr 22, 2026
f89c69c
add paramiko to dependencies for matchPickle to support wmpl upgrade
markmac99 Apr 22, 2026
b4b4f28
update getpickle to newest WMPL
markmac99 Apr 22, 2026
f90ebaa
bugfix in api tests
markmac99 Apr 22, 2026
fc7b2e1
bugfix - changes to dailydb not saved
markmac99 Apr 23, 2026
d611e56
improvements to process to cleanup deleted trajs
markmac99 Apr 23, 2026
db558a3
after merging, check and remove any duplicate trajectories from the s…
markmac99 Apr 23, 2026
784c73d
Adding version
markmac99 Apr 23, 2026
dad925b
bump version 2025.11.1 -> 2026.04.0
markmac99 Apr 23, 2026
3ba5cfb
update files containing vesion
markmac99 Apr 23, 2026
284de96
bump version 2026.04.0 -> 2026.04.1
markmac99 Apr 23, 2026
7eee632
Merge branch 'master' into markmac99
markmac99 Apr 23, 2026
a319dd2
unmangling side effets of automerge
markmac99 Apr 23, 2026
89f2aa1
correct usage message
markmac99 Apr 23, 2026
bf376f8
decommission old calcserver and add new batchserver
markmac99 Apr 23, 2026
21eb2be
add calcserver IP to ssm variables and use it
markmac99 Apr 23, 2026
9159b41
Update my branch with the latest from master (#436)
markmac99 Apr 23, 2026
8f8b4f2
changes to ansible scripts
markmac99 Apr 23, 2026
26cc096
remove irrelevant file
markmac99 Apr 23, 2026
6ca8795
Adding SSM variables for the new batchserver in the ukmda account
markmac99 Apr 23, 2026
40d76bc
attempt to add logging to consolidateDistTraj
markmac99 Apr 24, 2026
f4e9ff0
remove reference to ee account
markmac99 Apr 24, 2026
b9b1353
temporarily add mariadb deets to ssm in mjmm account
markmac99 Apr 24, 2026
a582121
bugfixes in dataMaintenance and cleanupDeletedTrajs to avoid deleting…
markmac99 Apr 24, 2026
da410f6
updating migration instructions
markmac99 Apr 24, 2026
2010c05
more work on deduplication for ukmon
markmac99 Apr 24, 2026
6424937
remove username-specific stuff
markmac99 Apr 24, 2026
db3448e
remove the old deployment scripts
markmac99 Apr 24, 2026
a926e33
update install script
markmac99 Apr 24, 2026
59292b4
updates to improve server migration process
markmac99 Apr 25, 2026
1a43eed
add bashrc to the installer
markmac99 Apr 25, 2026
efc9fbb
slight tweak to installer
markmac99 Apr 25, 2026
66801ae
add a few installer messages
markmac99 Apr 25, 2026
44b1ae6
remove an echo
markmac99 Apr 25, 2026
74923b5
be less verbose in the rsyncs
markmac99 Apr 25, 2026
8f2ab42
oops need -a for one of the rsyncs
markmac99 Apr 25, 2026
25ad585
rename requirements file for ukmda
markmac99 Apr 27, 2026
b712fb2
remove dependencies on MeteorTools
markmac99 Apr 27, 2026
6e89edc
add utils to ukmon_pylib
markmac99 Apr 27, 2026
2ea77b5
more removal of dependencies on MeteorTools
markmac99 Apr 27, 2026
9cb4867
updating how shower data is obtained
markmac99 Apr 27, 2026
646f5e7
corercting location of IMO and gmn shower data
markmac99 Apr 27, 2026
c1ed84f
bugfixes
markmac99 Apr 27, 2026
e8e2247
fixes in imoWorkinShowerlist
markmac99 Apr 27, 2026
ed8eb85
small error in install_or_update
markmac99 Apr 27, 2026
5118b18
bugfix when no data found in imo set
markmac99 Apr 27, 2026
030dbaa
retrieve IMO data after each code update
markmac99 Apr 27, 2026
772f912
fixing up getShowerDets
markmac99 Apr 27, 2026
1bd0033
improve installer
markmac99 Apr 27, 2026
127b814
fix createShowerExtracts
markmac99 Apr 27, 2026
9a6a393
update extractors and showeranalysis
markmac99 Apr 27, 2026
f45a037
bug in extractor thats existed since 2023 but nobody noticed...
markmac99 Apr 27, 2026
48e51c9
trying to fix matplotlib bug
markmac99 Apr 27, 2026
b524e94
more working on matplotlib issue
markmac99 Apr 27, 2026
5a8aa03
oops overfixed a bug
markmac99 Apr 27, 2026
383dd74
another incorrect bugfix!
markmac99 Apr 27, 2026
c2e8b1f
make bars wider
markmac99 Apr 27, 2026
550afbe
more removal of MeteorTools
markmac99 Apr 27, 2026
66a7fa4
bugfix in createannualbarchart
markmac99 Apr 27, 2026
d55eb05
working on bug
markmac99 Apr 27, 2026
e074739
more work on lenght bug
markmac99 Apr 27, 2026
c944a17
remove some debugging
markmac99 Apr 27, 2026
a069e8a
oops forgot to push the fixed version of createReportIndex
markmac99 Apr 27, 2026
d21bdd0
segregating function to get list of images that weren't calibrated by…
markmac99 Apr 27, 2026
5fc7920
reorganize stuff a bit
markmac99 Apr 27, 2026
0a8d203
add email sending functionality to ukmon_pylib
markmac99 Apr 27, 2026
12a05c3
use send email functionality in code
markmac99 Apr 27, 2026
cfd7111
add database and gmaps keys/passwords as secure variables
markmac99 Apr 27, 2026
2e7d4b2
update to use secure keys
markmac99 Apr 27, 2026
3d511d3
remove dbpw from environment
markmac99 Apr 27, 2026
1d4b6df
remove dbpw from environment
markmac99 Apr 27, 2026
67b026c
add script to retrieve db passwd
markmac99 Apr 27, 2026
b283c2f
add script to retrieve db passwords
markmac99 Apr 27, 2026
9e212e5
bug in createTables
markmac99 Apr 27, 2026
814368f
updates to migration instructions
markmac99 Apr 27, 2026
d2594c2
include pip installs in the script
markmac99 Apr 27, 2026
1e79073
tweak installer
markmac99 Apr 27, 2026
474434d
remove glob.glob1
markmac99 Apr 27, 2026
2b1c332
move unused scripts - will delete later
markmac99 Apr 28, 2026
f8bf444
fix mariadb connections
markmac99 Apr 28, 2026
7e4a62e
typo
markmac99 Apr 28, 2026
6643b2b
tidy up docs
markmac99 Apr 28, 2026
0df64d2
fixing mysql calls
markmac99 Apr 28, 2026
8184c80
small changes to documentation
markmac99 Apr 28, 2026
99dc404
suppress pip messages if already installed
markmac99 Apr 28, 2026
378da82
tweaks to the installer
markmac99 Apr 28, 2026
c3392e1
add logrotate stuff
markmac99 Apr 28, 2026
2ea7fd1
bugfixes in installer
markmac99 Apr 28, 2026
c73fe55
tidy up installer
markmac99 Apr 28, 2026
6f7c51e
bugfix in key mgmt
markmac99 Apr 28, 2026
db8e111
move some functionality into new script to tidy up nightly job and si…
markmac99 Apr 29, 2026
7cf10c9
improve install script
markmac99 Apr 29, 2026
d4fa638
update location of camera count file
markmac99 Apr 29, 2026
f8165a3
move annual bar charts into a more logical location
markmac99 Apr 29, 2026
b1e7187
update test script
markmac99 Apr 29, 2026
531d817
add gmaps param to my acct
markmac99 Apr 29, 2026
ef54c94
relocate coverage maps and front page index
markmac99 Apr 29, 2026
91dc688
tidy up useraudit process
markmac99 Apr 29, 2026
8cc2ed4
bugfixes in testing
markmac99 Apr 29, 2026
47fd55b
bugfix in createAnnualBarchart
markmac99 Apr 29, 2026
aacc917
bug in testscript
markmac99 Apr 29, 2026
b141904
another small bug in createSummaryTable
markmac99 Apr 29, 2026
564b655
still fighting that bug
markmac99 Apr 29, 2026
55872fa
tidy up lastlog data
markmac99 Apr 29, 2026
cceb1a4
remove unused file
markmac99 Apr 29, 2026
c467a9c
update cam status reporting
markmac99 Apr 29, 2026
5757d2c
clear down the old brightness data
markmac99 Apr 29, 2026
043986a
simplification of logging and of the nightlyJob script
markmac99 Apr 29, 2026
0e748e9
bugfixes in process to gather consumed image ifo
markmac99 Apr 29, 2026
6b25760
update getUncal to work for historic data
markmac99 Apr 29, 2026
57e4486
typo
markmac99 Apr 29, 2026
192f366
improvements in getUncalImages
markmac99 Apr 29, 2026
4d1eb92
bugfix
markmac99 Apr 29, 2026
06b2b19
add python to get unused images
markmac99 Apr 29, 2026
c6d4893
move script to right place
markmac99 Apr 29, 2026
db3e093
comment out unnecessary echo
markmac99 Apr 30, 2026
44c07e9
bugfixes in camMetrics while migrating user accts
markmac99 Apr 30, 2026
99ff82f
fix #448
markmac99 Apr 30, 2026
57d9bf3
make sure window title is sensible
markmac99 Apr 30, 2026
3eed2b2
bugfix in replot and get unused
markmac99 Apr 30, 2026
46ef42f
bugfix in removeDeletedTraj for search index
markmac99 Apr 30, 2026
2e511b4
remove deprecation warning issue #450
markmac99 Apr 30, 2026
41c37c0
whoops naive vs tzaware dates
markmac99 Apr 30, 2026
f68185d
remove warning in cameraStatusReport issue #453
markmac99 Apr 30, 2026
7ed5362
remove warning issue #454
markmac99 Apr 30, 2026
f981ef5
widen constraints on analysing pickles to get images
markmac99 Apr 30, 2026
36a8ed9
add migration script
markmac99 Apr 30, 2026
0dedbe6
add sudo
markmac99 Apr 30, 2026
0235adf
actually do it
markmac99 Apr 30, 2026
dc95620
update sftp migration script
markmac99 Apr 30, 2026
4b559f0
more changes to migration script
markmac99 Apr 30, 2026
a91ac87
moving sftp migration script
markmac99 Apr 30, 2026
27ab535
update messages and docos
markmac99 Apr 30, 2026
b829c17
slight tweak to migration script
markmac99 Apr 30, 2026
54324dc
further work on sftp account migration
markmac99 Apr 30, 2026
c65b741
update ukmon ini files after migration
markmac99 Apr 30, 2026
dbd346c
typo
markmac99 Apr 30, 2026
1daa675
collect old server login records
markmac99 Apr 30, 2026
995c886
update migration instructions
markmac99 Apr 30, 2026
d16a0e2
update cam metrics report to include hostname
markmac99 May 1, 2026
b565e4d
bugfix as $USER not available in cron
markmac99 May 3, 2026
ac0923b
removing unused files
markmac99 May 3, 2026
44e8481
some tidying up
markmac99 May 3, 2026
968b396
motre reorg
markmac99 May 3, 2026
b410ced
remove disused template
markmac99 May 3, 2026
94dd416
simplifying logging and removing unused aws profile
markmac99 May 3, 2026
df4aa81
removing profile from python
markmac99 May 3, 2026
3e9d8f6
adding executable bit
markmac99 May 4, 2026
32353bc
typo
markmac99 May 4, 2026
a07908f
bugfix to work around typo
markmac99 May 4, 2026
55bae43
print message when done
markmac99 May 4, 2026
a5617a3
bugfix to get trajectories from s3 before trying to check for missing…
markmac99 May 4, 2026
f56b37e
improve to support running for past dates
markmac99 May 4, 2026
7f20a70
errors in bashrc and logrotate config
markmac99 May 4, 2026
8333f03
prevent email being sent for anything other than current days report
markmac99 May 4, 2026
5445404
bugfix: make sure we use the most recent stats
markmac99 May 4, 2026
8c63165
improvement in reportOfLatestMatches to handle past dates
markmac99 May 4, 2026
ab5fd5a
bugfix
markmac99 May 4, 2026
3429919
small tweak to support reportOfLatestMatches
markmac99 May 4, 2026
398ab0b
tweak getMatchStats to handle historic data better
markmac99 May 4, 2026
abd0ed2
add mariadb and ping to the sec grp so that the database can be acces…
markmac99 May 4, 2026
31affc2
update the db servername
markmac99 May 4, 2026
ca9ad30
bugfix in match stats
markmac99 May 5, 2026
accfc82
prevent bogus renaming of matchJob.log
markmac99 May 5, 2026
7163bee
bumping version
markmac99 May 5, 2026
c002178
bump version 2026.04.1 -> 2026.05.0
markmac99 May 5, 2026
7c57fd8
Merge branch 'master' into markmac99
markmac99 May 5, 2026
86d7e54
update matchapi to use indexed column
markmac99 May 5, 2026
c7eec3a
add api readme
markmac99 May 5, 2026
59e5178
tweak to cammetrics to enhance stationlogins report
markmac99 May 6, 2026
4f9bed7
slight tweak to formatting
markmac99 May 6, 2026
e8d0c0f
minor tweak to avoid unexpectedly changing directory
markmac99 May 6, 2026
4fa95d5
add support script for during server migrations
markmac99 May 6, 2026
a0fad5a
skip 1st row
markmac99 May 6, 2026
0c6ed69
add check for todos
markmac99 May 6, 2026
2125490
oops strip whitespace
markmac99 May 6, 2026
26de815
darn whitespace
markmac99 May 6, 2026
48fa13c
working on migration tasks
markmac99 May 6, 2026
6a3af38
minor tweaks
markmac99 May 6, 2026
7c83078
daft typo
markmac99 May 6, 2026
776ddd8
Merge branch 'master' into markmac99
markmac99 May 6, 2026
fdb17b5
bump version 2026.05.0 -> 2026.05.1
markmac99 May 6, 2026
75d0e09
Merge branch 'markmac99' of github.com:ukmda/ukmda-dataprocessing int…
markmac99 May 6, 2026
e99637a
bump version 2026.05.1 -> 2026.05.2
markmac99 May 6, 2026
5446e2b
update CodeQL to v3
markmac99 May 6, 2026
6749e8d
bump codeQL to v4
markmac99 May 7, 2026
fc6dbb0
tweak to script supporting server migration
markmac99 May 7, 2026
ad324e8
tweak to scripts supporting server migration
markmac99 May 7, 2026
47ce18a
add some stats on migration status
markmac99 May 7, 2026
c8fff1e
tweak
markmac99 May 7, 2026
88abe94
Merge branch 'master' into markmac99
markmac99 May 7, 2026
daebe1a
get cursor keys working in python
markmac99 May 8, 2026
24a41a5
set via even if no recent login
markmac99 May 8, 2026
d0eb45e
Merge branch 'markmac99' of github.com:ukmda/ukmda-dataprocessing int…
markmac99 May 8, 2026
4b89c65
improved reporting on migration
markmac99 May 8, 2026
452d346
tweaks to migr scripts
markmac99 May 8, 2026
a6d1217
another small tweak
markmac99 May 8, 2026
d2ca8a3
make lists unique
markmac99 May 8, 2026
e3570f0
uniq and sort backwards
markmac99 May 8, 2026
ce7b8fd
testing fix for #460
markmac99 May 8, 2026
1cf2d27
more work on status reports
markmac99 May 8, 2026
ce3dcf7
bugfix in failed matches report
markmac99 May 8, 2026
2ed336d
found the bug
markmac99 May 8, 2026
957a1f1
attempt to fix fails report
markmac99 May 8, 2026
75726ec
another tweak
markmac99 May 8, 2026
7d9ef3b
okay, got it
markmac99 May 8, 2026
546cdf3
remove debug
markmac99 May 8, 2026
e25ce5d
fix timing metrics data
markmac99 May 8, 2026
ec87a39
small tweak
markmac99 May 8, 2026
f051a7c
looks good
markmac99 May 8, 2026
a439fe1
add EIP for the batchserver
markmac99 May 13, 2026
eda54dd
bugfix to handle bad data in login details
markmac99 May 14, 2026
27331c2
add function to email problem cameras with bespoke message
markmac99 May 14, 2026
263d881
bump version 2026.05.2 -> 2026.05.3
markmac99 May 14, 2026
92438d4
Merge branch 'master' into markmac99
markmac99 May 14, 2026
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 README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# UK Meteor Data Analysis Shared code and libraries
version: 2026.05.2
version: 2026.05.3

This repository contains the code behind the UK Meteors data archive and data processing pipeline.

Expand Down
2 changes: 1 addition & 1 deletion archive/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Data Processing and Flows
==========================

version: 2026.05.2
version: 2026.05.3

This diagram shows the overall flow of data from Cameras to websites and out to the public.

Expand Down
6 changes: 5 additions & 1 deletion archive/analysis/getLogData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ echo "the entire night was uncalibrated (indicated by the 'skipping' warning).</
echo "<p>To interpret these data, see " >> $logfile
echo "<a href=https://github.com/markmac99/ukmon-pitools/wiki/UKMON-Pi-Toolset-FAQ#Interpreting_the_Uncalibrated_Report>here</a></p>" >> $logfile
echo "<pre>" >> $logfile
grep "Skipping" $lastmtch >> $logfile
grep "Skipping" $lastmtch | egrep -v "directory|pickle" >> $logfile
echo "</pre>" >> $logfile

echo "<h2 id=fails>Failed Match Report</h2>" >> $logfile
Expand All @@ -72,6 +72,7 @@ echo "<a href=https://github.com/markmac99/ukmon-pitools/wiki/Trajectory-Solver-
echo "<pre>" >> $logfile
cat $DATADIR/failed/${rundate}_failed.txt >> $logfile
echo "</pre>" >> $logfile

echo "<h2 id=graph>Chart of Batch Element Runtimes</h2>" >> $logfile
echo "<p>This section shows the runtime of the different jobs in the batch</p>" >> $logfile
echo "<p><a href=/reports/batchcharts/$rundate-perfNightly.jpg><img src=/reports/batchcharts/$rundate-perfNightly.jpg width=300\%></a></p>" >> $logfile
Expand All @@ -93,4 +94,7 @@ done
cat $TEMPLATES/footer.html >> $DATADIR/lastlogs/index.html
aws s3 cp $DATADIR/lastlogs/index.html $WEBSITEBUCKET/reports/lastlogs/ --quiet

# housekeep the fails reports
find $DATADIR/failed -mtime +90 -exec rm -f {} \;

find $DATADIR/lastlogs -name "lastlog*" -mtime +90 -exec rm -f {} \;
5 changes: 4 additions & 1 deletion archive/server_setup/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ fi
unset __conda_setup
# <<< conda initialize <<<

# make the function keys work properly in python
export TERM=putty

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
xterm*|rxvt*|putty*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
Expand Down
28 changes: 15 additions & 13 deletions archive/server_setup/acctStatusChecks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ here="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

cd $here

sudo ls -1 /var/sftp > moved.txt
grep batchs /home/ubuntu/prod/data/reports/stationlogins.txt |awk '{print $3}'| sort > switched.txt
grep ukmonh /home/ubuntu/prod/data/reports/stationlogins.txt |awk '{print $3}'| sort > pending.txt
sudo ls -1 /var/sftp | egrep -v "test|logup" > moved.txt
grep batchs /home/ubuntu/prod/data/reports/stationlogins.txt | cut -c 42-61 | sed 's/ //g' | sort | uniq > switched.txt
grep ukmonh /home/ubuntu/prod/data/reports/stationlogins.txt | cut -c 42-61 | sed 's/ //g' | sort | uniq > pending.txt

ssh ukmonhelper2 "~/prod/server_setup/get-nbd.sh" | while read i ; do echo $i | awk -F"/" '{print $4}' ; done > not-being-done.txt
ssh ukmonhelper2 "~/prod/server_setup/get-all.sh" | while read i ; do echo $i | awk -F"/" '{print $4}' ; done > all-accounts.txt

python ~/src/ukmda-dataprocessing/archive/server_setup/checkSftpAccounts.py

echo "Moved: $(wc -l moved.txt | awk '{print $1}')"
echo "Switched: $(wc -l switched.txt | awk '{print $1}')"
echo "Pending: $(wc -l pending.txt | awk '{print $1}')"
echo "Total: $(wc -l still-live.txt | awk '{print $1}')"
echo ""
echo "Not Live: $(wc -l not_live.txt | awk '{print $1}')"
echo "Not Upl: $(wc -l not_uploading.txt | awk '{print $1}')"
echo ""
echo "Dead: $(wc -l not-being-done.txt | awk '{print $1}')"
echo ""

echo "Moved: $(wc -l moved.txt | awk '{print $1}')" > statusreport.txt
echo "Switched: $(wc -l switched.txt | awk '{print $1}')" >> statusreport.txt
echo "Pending: $(wc -l pending.txt | awk '{print $1}')" >> statusreport.txt
echo "Total: $(wc -l still-live.txt | awk '{print $1}')" >> statusreport.txt
echo "" >> statusreport.txt
echo "Not Live: $(wc -l not_live.txt | awk '{print $1}')" >> statusreport.txt
echo "Not Upl: $(wc -l not_uploading.txt | awk '{print $1}')" >> statusreport.txt
echo "" >> statusreport.txt
echo "Dead: $(wc -l not-being-done.txt | awk '{print $1}')" >> statusreport.txt
echo "" >> statusreport.txt
cat statusreport.txt
12 changes: 11 additions & 1 deletion archive/server_setup/checkSftpAccounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,14 @@
for nam in livenames:
if nam.strip() not in donelist:
print('done list is missing', nam)
outf.write(f'{nam}\n')
outf.write(f'{nam}\n')


moved = open('moved.txt').readlines()
pending = open('pending.txt').readlines()
switched = open('switched.txt').readlines()

pendingnotmoved = [x for x in pending if x not in moved]

print('stations marked pending but not moved - check if need done')
print(pendingnotmoved)
8 changes: 8 additions & 0 deletions archive/terraform/ukmda/batchserver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ resource "aws_network_interface" "batchserver_if" {
"billingtag" = "ukmda"
}
}

resource "aws_eip" "batchserver" {
instance = aws_instance.batchserver.id
tags = {
billingtag = "ukmda"
Name = "ukmonhelper_eip"
}
}
2 changes: 1 addition & 1 deletion archive/ukmon_pylib/metrics/camMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,5 @@ def backPopulate(stationid):
for _,rw in df.iterrows():
lastup = '> 1 month ago' if pd.isnull(rw.lastupload) else rw.lastupload.strftime('%Y-%m-%dT%H:%M:%S')
lastlo = '> 1 month ago' if pd.isnull(rw.lastseen) else rw.lastseen.strftime('%Y-%m-%dT%H:%M:%S')
via = '' if pd.isnull(rw.host) else rw.host
via = 'ukmonhelper2' if pd.isnull(rw.host) else rw.host
outf.write(f'{lastup:19s} {lastlo:19s} {rw.location:20s} {rw.stationid:10s} {via}\n')
96 changes: 27 additions & 69 deletions archive/ukmon_pylib/metrics/timingMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


def graphOfData(logf, dtstr):

lis = open(logf,'r').readlines()
dta = [li for li in lis if li[:8]==dtstr]

Expand Down Expand Up @@ -55,78 +56,35 @@ def graphOfData(logf, dtstr):


def getLogStats(nightlogf, matchlogf, thisdy):
with open(nightlogf,'r') as inf:
loglines = inf.readlines()

#logf = os.path.basename(nightlogf)
#spls = logf.split('-')
#thisdy= spls[1]
matchstr = 'RUNTIME'

# <13>Nov 1 11:49:55 nightlyJob: RUNTIME 10554 showerReport ALL 202211
startFAM = 0
startRD = 0
dts = []
tss = []
tsks = []
secs = []
msgs = []
for li in loglines:
if matchstr in li:
li = ' '.join(li.split()) # remove double-spaces eg when date is ' 6 Jan' as opposed to '16 Jan'
spls = li.split()
msg = ''
for s in range(6, len(spls)):
msg = msg + ' ' + spls[s]
if 'start findAllMatches' in msg:
startFAM = int(spls[5])
dts.append(thisdy)
tss.append(spls[2])
tsks.append(spls[3].replace(':',''))
secs.append(int(spls[5]))
msgs.append(msg.strip())

with open(matchlogf,'r') as inf:
loglines = inf.readlines()
# logline example
# <13>May 8 06:10:02 nightlyJob: start nightlyJob
outdir = os.path.split(nightlogf)[0]

# scan for findAllMatches data first
for li in loglines:
if matchstr in li:
spls = li.split()
if 'runDistrib' in spls[3]:
continue
msg = ''
for s in range(6, len(spls)):
msg = msg + ' ' + spls[s]
if 'start runDistrib' in msg:
startRD = int(spls[5])
dts.append(thisdy)
tss.append(spls[2])
tsks.append(spls[3].replace(':',''))
secs.append(int(spls[5])+startFAM)
msgs.append(msg.strip())
loglines = open(nightlogf,'r').readlines()
bsfs = [x for x in loglines if 'start'in x or 'finish' in x or 'end' in x]
bsfs = [x for x in bsfs if x[0]=='<']

# rescan for runDistrib data
for li in loglines:
if matchstr in li:
spls = li.split()
if 'runDistrib' not in spls[3]:
continue
msg = ''
for s in range(6, len(spls)):
msg = msg + ' ' + spls[s]
dts.append(thisdy)
tss.append(spls[2])
tsks.append(spls[3].replace(':',''))
secs.append(int(spls[5]) + startFAM + startRD)
msgs.append(msg.strip())
loglines = open(matchlogf,'r').readlines()
msfs = [x for x in loglines if 'start'in x or 'finish' in x or 'end' in x]
msfs = [x for x in msfs if x[0]=='<']

df = pd.DataFrame(zip(dts,tss,secs,tsks,msgs), columns=['dts','tss','secs','tsk','msgs'])
df = df.sort_values(by=['tss'])
#print(df)
outdir = os.path.split(nightlogf)[0]
df.to_csv(os.path.join(outdir, 'perfNightly.csv'), mode='a', header=False, index=False)

alldata = msfs + bsfs
alldata.sort()
starttime = None
yr = datetime.datetime.now().year
with open(os.path.join(outdir, 'perfNightly.csv'), 'a+') as outf:
for rw in alldata:
dtpart = rw[4:19]
evtdt = datetime.datetime.strptime(f'{yr} {dtpart}', '%Y %b %d %H:%M:%S')
if 'start nightlyJob' in rw:
starttime = evtdt
elapsed_secs = (evtdt - starttime).seconds
txtpart = rw[20:]
task = txtpart[:txtpart.find(':')]
msg = txtpart[txtpart.find(':')+1:].replace(',', ' ')
outstr = f'{evtdt.strftime("%Y%m%d,%H:%M:%S")},{elapsed_secs},{task},{msg}'
outf.write(outstr)


if __name__ == '__main__':
dtstr = sys.argv[1]
Expand Down
14 changes: 9 additions & 5 deletions archive/ukmon_pylib/reports/findFailedMatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,27 @@ def saveData(observation, repfile):


def processOneLog(logfile, repfile):
with open(logfile, 'r') as inf:
lis = inf.readlines()
lis = open(logfile, 'r').readlines()

obs = False
observation = []
for li in lis:
if 'Observations:' in li:
if 'Observations ' in li:
obs = True
if obs is True:
observation.append(li)
if 'Shower:' in li:
if 'Saving trajectory:' in li or 'Updating database' in li:
obs = False
observation = []
if '-----------------------' in li:
if 'Updating database' in li or 'added to fails' in li:
if obs is True:
#print('got fail')
observation.append('--------------\n\n')
saveData(observation, repfile)
obs = False
observation = []
if "SOLVING RUN DONE" in li:
break

return

Expand All @@ -48,5 +51,6 @@ def processOneLog(logfile, repfile):
logdir = os.path.join(srcdir, 'logs','distrib')
logs = glob.glob(f'{repdt}*.log', root_dir=logdir)
for logf in logs:
#print(logf)
processOneLog(os.path.join(logdir, logf), reportfile)
reportfile.close()
93 changes: 7 additions & 86 deletions archive/ukmon_pylib/reports/getSolutionStati.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,93 +5,14 @@
import sys


def getSolutionStati(fname):
with open(fname, 'r') as inf:
lis = inf.readlines()
# find start of interesting data
totnew = 0
totchk = 0
gotnew = 0
gotchk = 0
chktraj = False
newtraj = False
for li in lis:
# check for new data for existing solns
if 'Checking trajectory at ' in li and chktraj is False:
thistraj = li
chktraj = True
totchk += 1
continue
if 'Checking trajectory at ' in li and chktraj is True:
spls = thistraj.strip().split(' ')
print(f'{spls[3]} {spls[4]} no new data')
totchk += 1
thistraj = li
chktraj = True
continue
if "New Trajectory solution failed" in li and chktraj is True:
spls = thistraj.strip().split(' ')
print(f'{spls[3]} {spls[4]} no improvement')
chktraj = False
continue
if "Shower:" in li and chktraj is True:
spls = thistraj.strip().split(' ')
spl2 = li.strip().split(' ')
try:
if spl2[3] == '...':
shwr = 'Spo'
else:
shwr = spl2[3]
except:
if spl2[1] == '...':
shwr = 'Spo'
else:
shwr = spl2[1]

print(f'{spls[3]} {spls[4]} updated as {shwr}')
gotchk += 1
chktraj = False
continue

# check for new groups
if "Observations:" in li:
thistraj = None
newtraj = True
totnew += 1
continue
if "Observations:" not in li and newtraj is True and thistraj is None:
thistraj = li
continue
if "-------" in li and newtraj is True:
spls = thistraj.strip().split(' ')
print(f'{spls[3]} {spls[4]} not matched')
newtraj = False
thistraj = None
continue
if "Shower:" in li and newtraj is True:
spls = thistraj.strip().split(' ')
spl2 = li.strip().split(' ')
try:
if spl2[3] == '...':
shwr = 'Spo'
else:
shwr = spl2[3]
except:
if spl2[1] == '...':
shwr = 'Spo'
else:
shwr = spl2[1]
print(f'{spls[3]} {spls[4]} solved as {shwr}')
gotnew += 1
newtraj = False
thistraj = None
continue
if "SOLVING RUN DONE" in li:
break

return totnew, totchk, gotnew, gotchk
def parseDistriblog(logname):
lis = open(logname,'r').readlines()
dta = [x for x in lis if ('added to fails' in x or ('saved' in x and 'to' in x)) and ('CorrelateEngine' in x or 'CorrelateRMS' in x)]
offset = 49 if 'match' in logname else 76
for dd in dta:
print(dd[offset:].strip())


if __name__ == '__main__':
fname = sys.argv[1]
print(getSolutionStati(fname))
parseDistriblog(fname)
Loading
Loading