Skip to content

Checkpoint in log checking improvement; extraction of compile aliases…#408

Open
rrivera747 wants to merge 2 commits into
developfrom
rrivera/betterLogChecking
Open

Checkpoint in log checking improvement; extraction of compile aliases…#408
rrivera747 wants to merge 2 commits into
developfrom
rrivera/betterLogChecking

Conversation

@rrivera747
Copy link
Copy Markdown
Contributor

… as general tool

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the tools/ots log-finding capabilities with new modes for local-only and ARTDAQ-host log discovery, and factors compile-related shell aliases into a standalone script installed via the tools CMake packaging.

Changes:

  • Added ots -ll/--logfind-local (local-only) and ots -lll/--logfind-artdaq (local + ARTDAQ hosts from latest ranks.txt) log-finding modes.
  • Implemented expanded “recently written files” scanning under $USER_DATA/Logs, action-handler logs under tmp/, and ARTDAQ configuration/run-record locations.
  • Added and installed tools/ots_compile_aliases.sh as a reusable compile-alias helper script.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
tools/ots_compile_aliases.sh New compile alias helper with lockfile protection and build/install logging.
tools/ots Adds new logfind flags and substantial log discovery + remote SSH parsing logic.
tools/CMakeLists.txt Installs the new ots_compile_aliases.sh script via cet_script(ALWAYS_COPY ...).

Comment on lines +1 to +8
#!/bin/sh
# Source this to get color code variables to use during output

# setup compile aliases (for more spack debug info, use spack -d install -j$CETPKG_J 2>&1)
#============================
lockfile="/tmp/ots_compile_${OTS_SOURCE//\//_}.lock"

get_lock() {
Comment on lines +80 to +85
#only run warn check if build succeeded
if [ $CHECK_GIT_REPO_STATUS == 1 ]; then
echo -e "$(date +%d%h%y.%T) setup_ots.sh:${LINENO} | \t Will report a warning if any uncommitted code found..."
UpdateOTS.sh --warnfast 2>&1 >/dev/null
echo #to get back to terminal
fi
Comment thread tools/ots
Comment on lines +2691 to +2694
# extract file path from lines containing "less /"
if [[ "$_lf_clean" == *"less /"* ]]; then
_lf_path="${_lf_clean##*less }"
_lf_path="${_lf_path%% *}" # trim any trailing whitespace
Comment thread tools/ots
Comment on lines +3081 to +3082
if [[ "$_lf_clean" == *"less /"* ]]; then
_lf_path="${_lf_clean##*less }"
Comment thread tools/ots
# - Also search each remote host from the XML via:
# ssh -K host "cd <ots_root> && source ./fast_ots_setup.sh <subsystem> logs"
# which sources the environment and runs 'ots -ll' (local-only log find).
# - ots -ll outputs machine-parseable lines: LOGFIND_LOCAL:<time_label>:<path>
Comment thread tools/ots
_logfind_runrecords_dir=""

# find the latest (highest numbered) run record directory
_logfind_latest_run_dir=$(find -L "${USER_DATA}/ARTDAQConfigurations/run_records" -maxdepth 1 -mindepth 1 -type d 2>/dev/null | sort -t/ -k$(echo "${USER_DATA}/ARTDAQConfigurations/run_records/x" | tr -cd '/' | wc -c) -n | tail -1)
Comment thread tools/ots
Comment on lines +2973 to +2974
| sort -t/ -k$(echo "${USER_DATA}/ARTDAQConfigurations/run_records/" | tr -cd '/' | wc -c) -n \
| tail -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋 Triage

Development

Successfully merging this pull request may close these issues.

3 participants