Skip to content

Commit

Permalink
Merge pull request #8 from rlcee/210327
Browse files Browse the repository at this point in the history
status can be run before setup; fix tarball exclude
  • Loading branch information
rlcee authored Mar 28, 2021
2 parents ca4903b + 303b9c7 commit c478582
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 51 deletions.
14 changes: 6 additions & 8 deletions bin/muse
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@ if [ "$COMMAND" == "setup" ]; then
cd $OWD
$DONE $RC

elif [ "$COMMAND" == "status" ]; then

$MUSE_DIR/bin/museStatus.sh "$@"
$DONE $?

elif [ "$COMMAND" == "link" ]; then

# this command must be run in the working dir
$MUSE_DIR/bin/museLink.sh "$@"
RC=$?

$DONE $RC
$DONE $?

fi

Expand All @@ -105,11 +108,6 @@ if [ "$COMMAND" == "build" ]; then
$MUSE_DIR/bin/museBuild.sh "$@"
RC=$?

elif [ "$COMMAND" == "status" ]; then

$MUSE_DIR/bin/museStatus.sh "$@"
RC=$?

elif [ "$COMMAND" == "tarball" ]; then

$MUSE_DIR/bin/museTarball.sh "$@"
Expand Down
38 changes: 38 additions & 0 deletions bin/museBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,40 @@
# script to drive the muse command to build Mu2e analysis repos
#

usageMuseBuild() {
cat <<EOF
muse build <options> <scons options>
Build the code repos ion the Muse working directory.
This is two steps:
1) create links to the build products of repos added by "muse link"
2) run scons in the Muse working dir
The build directory in the Muse working directory can be deleted to
effectively remove all build products. Nothing is written anywhere else.
<options>
-h, --help : print usage
<scons options>
All the text here is passed to the scons command line.
It might include "-j 20" for threaded build, or targets,
or "-c" to clean the build.
EOF
return 0
}


if [[ "$1" == "-h" || "$1" == "--help" || "$1" == "help" ]]; then
usageMuseBuild
exit 0
fi

cd $MUSE_WORK_DIR

echo -n "$(date +'%D %H:%M:%S to ')" > $MUSE_BUILD_DIR/.musebuild

#
# "build" the linked packages by making sure the links
# from our build area to the backing build area are there
Expand All @@ -30,6 +62,12 @@ fi
scons -C $MUSE_WORK_DIR -f $MUSE_DIR/python/SConstruct "$@"
RC=$?

if [ $RC -eq 0 ]; then
echo "$(date +'%H:%M:%S')" >> $MUSE_BUILD_DIR/.musebuild
else
echo " scons error $RC" >> $MUSE_BUILD_DIR/.musebuild
fi

exit $RC


Expand Down
2 changes: 1 addition & 1 deletion bin/museInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mkdir -p $VERSION
cd $VERSION

rsync --exclude "*~" --exclude "*__*" --exclude "museInstall.sh" \
-r $SDIR/bin $SDIR/python .
-r $SDIR/bin $SDIR/python $SDIR/config .
mkdir -p ups
cd ups

Expand Down
18 changes: 10 additions & 8 deletions bin/museLink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# in another area to this area so it be used as input to the build
#

usageLink() {
usageMuseLink() {
cat <<EOF
muse link <repo selection>
muse link <repo selection> <options>
Create a link to a repo in another Muse build area so that package
can be included in the local build. The linked package will be included in
Expand All @@ -16,25 +16,28 @@ usageLink() {
Since this command is usually run before "muse setup",
in must be run in the intended muse working directory
If the command is run without any arguments, a list
If the command is run without any arguments, or with -l, a list
of suggested Offline backing builds will be shown
<repo selection>
The path seelction can be presented three ways
The link selection can be presented three ways
1) as a path to a repo in a muse working directory:
muse link /mu2e/app/users/\$USER/myBaseBuild/Offline
2) a branch/commit for a continuous integration backing build:
muse link master/c2409d93
3) a published Offline tag:
muse link v09_10_00
<options>
-h, --help : print usage
EOF
return
}


if [[ "$1" == "-h" || "$1" == "--help" || "$1" == "help" ]]; then
usageLink
usageMuseLink
exit 0
fi

Expand All @@ -47,9 +50,10 @@ TARGET="$1"
# if no target, list cvmfs Offline
#

if [ -z "$TARGET" ]; then
if [[ -z "$TARGET" || "$TARGET" == "-l"]]; then

echo "Recent published releases:"
# add PUB area when ready

echo "Recent CI builds"
BRANCHES=$( ls $CI_BASE )
Expand All @@ -60,8 +64,6 @@ if [ -z "$TARGET" ]; then
sort -r | sed 's|'$CI_BASE/'||'
done

# add PUB area when ready

exit 0
fi

Expand Down
10 changes: 6 additions & 4 deletions bin/museSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ museSetupUsage() {
<global options>
-v : add verbosity
-h : print usage
<directory>
If this is present, and is a directory path, then this will be
set as the Muse working directory. If not present, then
use the default directory.
the default directory is used as the Muse working directory.
<options>
-q : add the following build options
-h, --help : print usage
-q : add the following build qualifiers
prof/debug - complier switches (default prof)
eNN - compiler, like "e20" (default by an algorithm)
pNNN/uNNN - environmental set, like "p020" (default by an algorithm)
Expand All @@ -29,9 +29,11 @@ museSetupUsage() {
trigger - build only libraries needed in the trigger
Options may be separated by a space or a colon
Example:
muse -v setup /mu2e/app/$USER/analysis -q debug
muse setup (if in the working directory)
muse -v setup /mu2e/app/users/$USER/analysis -q debug
EOF

Expand Down
26 changes: 21 additions & 5 deletions bin/museStatus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@
#

museStatusUsage() {
cat <<EOF EOF
cat <<EOF
muse <global options> status
muse <global options> status <command options>
Print information about the Muse working directory and how
this process is setup. If "muse setup" has not been run in
this process, attempt to print some useful information
assuming the default directory is the Muse working directory.
<global options>
-v : add verbosity
-h : print usage
<command options>
-h, --help : print usage
EOF
return
Expand All @@ -22,18 +30,25 @@ if [[ "$1" == "-h" || "$1" == "--help" || "$1" == "help" ]]; then
exit 0
fi

cd $MUSE_WORK_DIR
[ -n "$MUSE_WORK_DIR" ] && cd $MUSE_WORK_DIR

if [ -d build ]; then
echo ""
echo " existing builds:"
DIRS=$(ls -1 build)
for DIR in $DIRS; do
if [ "$DIR" == "$MUSE_STUB" ]; then
echo " $DIR ** this is your current setup **"
echo " $DIR ** this is your current setup **"
else
echo " $DIR"
fi

echo -n " Build times: "
if [ -e build/$DIR/.musebuild ]; then
echo "$(cat build/$DIR/.musebuild)"
else
echo " N/A"
fi
done
echo ""
else
Expand All @@ -42,6 +57,7 @@ else
echo ""
fi

[ -z "$MUSE_WORK_DIR" ] && exit 0

[ $MUSE_VERBOSE -gt 0 ] && echo "directory containing repos to be built:"
echo " MUSE_WORK_DIR = $MUSE_WORK_DIR "
Expand Down
16 changes: 10 additions & 6 deletions bin/museTarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
# script to drive the muse command to setup and build Mu2e analysis repos
#

museTarballUsage() {
usageMuseTarball() {
cat <<EOF
muse <global options> tarball <command options> <extras>
muse <global options> tarball <options> <extras>
Make a tarball, ready to be submitted to the grid. All locally built
products are tarred, areas on cvmfs are linked. The tarball defaults to
/mu2e/data/users/\$USER/museTarball/tmp.dir/Code.tar.bz2
<global options>
-v, --verbose : add verbosity
<command options>
<options>
-h, --help : print usage
-t, --tmpdir : temp build space
-e, --exportdir : landing directory for the tarball
Expand All @@ -30,7 +34,7 @@ EOF
PARAMS="$(getopt -o ht:e:r -l tmpdir,exportdir,release --name $(basename $0) -- "$@")"
if [ $? -ne 0 ]; then
echo "ERROR - could not parsing tarball arguments"
museTarballUsage
usageMuseTarball
exit 1
fi
eval set -- "$PARAMS"
Expand All @@ -44,7 +48,7 @@ while true
do
case $1 in
-h|--help)
museTarballUsage
usageMuseTarball
exit 0
;;
-t|--tmpdir)
Expand All @@ -65,7 +69,7 @@ do
break
;;
*)
museTarballUsage
usageMuseTarball
break
;;
esac
Expand Down
19 changes: 0 additions & 19 deletions bin/museUnsetup.sh

This file was deleted.

0 comments on commit c478582

Please sign in to comment.