Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
8cba86e4
Commit
8cba86e4
authored
6 years ago
by
Jason Hiser
Browse files
Options
Downloads
Patches
Plain Diff
updated thanos to deal with timing, etc. for logs.
Former-commit-id: 2b21dddcf0db2ece286bf5949ed93e7446bee9da
parent
b1e1c444
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/ps_analyze.sh
+33
-25
33 additions, 25 deletions
tools/ps_analyze.sh
with
33 additions
and
25 deletions
tools/ps_analyze.sh
+
33
−
25
View file @
8cba86e4
...
@@ -601,18 +601,20 @@ perform_step()
...
@@ -601,18 +601,20 @@ perform_step()
fi
fi
fi
fi
echo
-n
Performing step
"
$step
"
[
dependencies
=
$mandatory
]
...
starttime
=
`
$PS_DATE
`
starttime
=
`
$PS_DATE
`
# If verbose is on, tee to a file
# If verbose is on, tee to a file
if
[[
!
-z
"
$DEBUG_STEPS
"
]]
;
then
if
[[
!
-z
"
$DEBUG_STEPS
"
]]
;
then
echo
-n
Performing step
"
$step
"
[
dependencies
=
$mandatory
]
...
eval
$command
eval
$command
command_exit
=
$?
command_exit
=
$?
elif
[[
!
-z
"
$VERBOSE
"
&&
$using_thanos
-eq
0
]]
;
then
elif
[[
!
-z
"
$VERBOSE
"
&&
$using_thanos
-eq
0
]]
;
then
echo
-n
Performing step
"
$step
"
[
dependencies
=
$mandatory
]
...
eval
$command
2>&1 |
tee
$logfile
eval
$command
2>&1 |
tee
$logfile
command_exit
=
${
PIPESTATUS
[0]
}
# this funkiness gets the exit code of $command, not tee
command_exit
=
${
PIPESTATUS
[0]
}
# this funkiness gets the exit code of $command, not tee
elif
[[
!
-z
"
$VERBOSE
"
&&
$using_thanos
-ne
0
]]
;
then
elif
[[
!
-z
"
$VERBOSE
"
&&
$using_thanos
-ne
0
]]
;
then
echo
-n
Performing step
"
$step
"
[
dependencies
=
$mandatory
]
...
eval
$command
>
$logfile
2>&1
eval
$command
>
$logfile
2>&1
# display logs to stdout
# display logs to stdout
for
this_step
in
$step
for
this_step
in
$step
...
@@ -620,7 +622,11 @@ perform_step()
...
@@ -620,7 +622,11 @@ perform_step()
cat
logs/
$this_step
.log
cat
logs/
$this_step
.log
done
done
cat
$logfile
cat
$logfile
elif
[[
$using_thanos
-ne
0
]]
;
then
eval
$command
command_exit
=
$?
else
else
echo
-n
Performing step
"
$step
"
[
dependencies
=
$mandatory
]
...
eval
$command
>
$logfile
2>&1
eval
$command
>
$logfile
2>&1
command_exit
=
$?
command_exit
=
$?
fi
fi
...
@@ -645,31 +651,33 @@ perform_step()
...
@@ -645,31 +651,33 @@ perform_step()
fi
fi
fi
fi
is_step_error
$step
$command_exit
if
[[
$using_thanos
-eq
0
]]
;
then
if
[[
$?
-ne
0
]]
;
then
is_step_error
$step
$command_exit
echo
"Done. Command failed! ***************************************"
if
[[
$?
-ne
0
]]
;
then
echo
"Done. Command failed! ***************************************"
# check if we need to exit
stop_if_error
$step
# check if we need to exit
if
[
$?
-gt
$error_threshold
]
;
then
stop_if_error
$step
echo
The
$step
step is necessary, but failed. Exiting ps_analyze early.
if
[
$?
-gt
$error_threshold
]
;
then
exit
-1
;
echo
The
$step
step is necessary, but failed. Exiting ps_analyze early.
exit
-1
;
fi
errors
=
1
elif
[
-f
warning.txt
]
;
then
# report warning to user.
warnings
=
1
echo
"Done. Command had serious warnings! ***************************************"
cat
warning.txt
# report warning in log file, line by line, as an attribute.
while
IFS
=
read
-r
line
;
do
echo
echo
"#ATTRIBUTE serious_warning_text=
\"
$line
\"
"
>>
$logfile
done
<
"warning.txt"
# remove warning.txt so we don't report these warnings again.
rm
-f
warning.txt
else
echo
"Done. Successful."
fi
fi
errors
=
1
elif
[
-f
warning.txt
]
;
then
# report warning to user.
warnings
=
1
echo
"Done. Command had serious warnings! ***************************************"
cat
warning.txt
# report warning in log file, line by line, as an attribute.
while
IFS
=
read
-r
line
;
do
echo
echo
"#ATTRIBUTE serious_warning_text=
\"
$line
\"
"
>>
$logfile
done
<
"warning.txt"
# remove warning.txt so we don't report these warnings again.
rm
-f
warning.txt
else
echo
Done. Successful.
fi
fi
# move to the next step
# move to the next step
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment