-
Notifications
You must be signed in to change notification settings - Fork 69
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
Move scripts to help manage items in crontab on the teuthology box #332
Open
yuriw
wants to merge
1
commit into
ceph:main
Choose a base branch
from
yuriw:wip-wip-sepia-scripts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
# /nightlies/cron_wrapper.sh | ||
|
||
# check for no argument case and stop | ||
if [ -z $1 ]; then | ||
echo "need argument" | ||
exit 1 | ||
fi | ||
|
||
# set permanent $LOG file var | ||
LOG="/var/log/crontab-nightlies-log/crontab.log" | ||
# set $LOG_LOCKED_ERR in case locking failed | ||
LOG_LOCK_ERR="/var/log/crontab-nightlies-log/crontab_lock_problem.$$" | ||
|
||
# temp files to store stdout and stderr | ||
# named with the PID of this script in their name so they'll be unique | ||
STDERR="/var/tmp/stderr.$$" | ||
STDOUT="/var/tmp/stdout.$$" | ||
|
||
# $STDOUT and $STDERR are removed when the script exits for any reason | ||
trap "rm -f $STDOUT $STDERR" 0 | ||
|
||
# run a command from this script's argument | ||
# redirect stdout to $STDOUT file and redirect stderr to $STDERR file | ||
|
||
DATE=$(date) | ||
echo -n "$DATE: " >> $STDOUT | ||
echo "Running command: $@" >> $STDOUT | ||
"$@" > $STDOUT 2> $STDERR | ||
|
||
# get return code from the command run | ||
code=$? | ||
|
||
if [ $code != 0 ] ; then | ||
# echoing to stdout/stderr makes cron send email | ||
echo "stdout:" | ||
cat $STDOUT | ||
echo "stderr:" | ||
cat $STDERR | ||
else | ||
# normal exit: just log stdout | ||
|
||
# lock $LOG with file descriptor 200 | ||
exec 200>>$LOG | ||
# if $LOG is locked by other process - wait for 20 sec | ||
flock -w 20 200 || LOG=$LOG_LOCK_ERR | ||
echo "stdout:" >> $LOG | ||
cat $STDOUT >> $LOG | ||
echo "stderr:" >> $LOG | ||
cat $STDERR >> $LOG | ||
# unlock | ||
flock -u 200 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# $1 - part | ||
# $2 - branch name | ||
# $3 - machine name | ||
# $4 - email address | ||
# $5 - filter out (this arg is to be at the end of the command line for now) | ||
|
||
## example #1 | ||
## (date +%U) week number | ||
## % 2 - mod 2 (e.g. 0,1,0,1 ...) | ||
## * 7 - multiplied by 7 (e.g. 0,7,0,7...) | ||
## $1 day of the week (0-6) | ||
## /14 for 2 weeks | ||
|
||
## example #2 | ||
## (date +%U) week number | ||
## % 4 - mod 4 (e.g. 0,1,2,3,0,1,2,3 ...) | ||
## * 7 - multiplied by 7 (e.g. 0,7,14,21,0,7,14,21...) | ||
## $1 day of the week (0-6) | ||
## /28 for 4 weeks | ||
|
||
echo "Scheduling " $2 " branch" | ||
if [ $2 = "master" ] ; then | ||
# run master branch with --newest option looking for good sha1 7 builds back | ||
teuthology-suite -v -c $2 -m $3 -k distro -s rados --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/28 --newest 7 -e $4 ~/vps.yaml $5 | ||
elif [ $2 = "hammer" ] ; then | ||
# run hammer branch with less jobs | ||
teuthology-suite -v -c $2 -m $3 -k distro -s rados --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/56 -e $4 ~/vps.yaml $5 | ||
elif [ $2 = "jewel" ] ; then | ||
# run jewel branch with /40 jobs | ||
teuthology-suite -v -c $2 -m $3 -k distro -s rados --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/40 -e $4 ~/vps.yaml $5 | ||
else | ||
# run NON master branches without --newest | ||
teuthology-suite -v -c $2 -m $3 -k distro -s rados --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/28 -e $4 ~/vps.yaml $5 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
#command line => CEPH_BRANCH=<branch>; MACHINE_NAME=<machine_type>; SUITE_NAME=<suite>; ../schedule_subset.sh <day_of_week> $CEPH_BRANCH $MACHINE_NAME $SUITE_NAME $CEPH_QA_EMAIL | ||
|
||
# $1 - part (day of week) | ||
# $2 - branch name | ||
# $3 - machine name | ||
# $4 - suite name | ||
# $5 - email address | ||
# $6 - filter out (this arg is to be at the end of the command line for now) | ||
|
||
## example #1 | ||
## (date +%U) week number | ||
## % 2 - mod 2 (e.g. 0,1,0,1 ...) | ||
## * 7 - multiplied by 7 (e.g. 0,7,0,7...) | ||
## $1 day of the week (0-6) | ||
## /14 for 2 weeks | ||
|
||
## example #2 | ||
## (date +%U) week number | ||
## % 4 - mod 4 (e.g. 0,1,2,3,0,1,2,3 ...) | ||
## * 7 - multiplied by 7 (e.g. 0,7,14,21,0,7,14,21...) | ||
## $1 day of the week (0-6) | ||
## /28 for 4 weeks | ||
|
||
echo "Scheduling " $2 " branch" | ||
if [ $2 = "master" ] ; then | ||
# run master branch with --newest option looking for good sha1 7 builds back with /999 jobs | ||
teuthology-suite -v -c $2 -m $3 -k distro -s $4 --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/999 --newest 7 -e $5 $6 | ||
elif [ $2 = "hammer" ] ; then | ||
# run hammer branch with less jobs | ||
teuthology-suite -v -c $2 -m $3 -k distro -s $4 --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/56 -e $5 $6 | ||
elif [ $2 = "jewel" ] ; then | ||
# run jewel branch with /40 jobs | ||
teuthology-suite -v -c $2 -m $3 -k distro -s $4 --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/40 -e $5 $6 | ||
elif [ $2 = "kraken" ] ; then | ||
# run kraken branch with /999 jobs | ||
teuthology-suite -v -c $2 -m $3 -k distro -s $4 --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/999 -e $5 $6 | ||
elif [ $2 = "luminous" ] ; then | ||
# run luminous branch with /999 jobs | ||
teuthology-suite -v -c $2 -m $3 -k distro -s $4 --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/999 -e $5 $6 | ||
else | ||
# run NON master branches without --newest | ||
teuthology-suite -v -c $2 -m $3 -k distro -s $4 --subset $(echo "(($(date +%U) % 4) * 7) + $1" | bc)/28 -e $5 $6 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
overrides: | ||
ceph: | ||
conf: | ||
global: | ||
osd heartbeat grace: 100 | ||
# this line to address issue #1017 | ||
mon lease: 15 | ||
mon lease ack timeout: 25 | ||
s3tests: | ||
idle_timeout: 1200 | ||
ceph-fuse: | ||
client.0: | ||
mount_wait: 60 | ||
mount_timeout: 120 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remind me why this file can't be in ceph.git/qa/suites/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zmc because the way we use it I believe per @liewegas ' initial suggestion is we add
vps.yaml
on every line in crontab that runs onvps
nodesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't really answer the question :-/