Skip to content

Commit

Permalink
Merge pull request #6 from rlcee/210315a
Browse files Browse the repository at this point in the history
Most of tarball and mgit
  • Loading branch information
rlcee authored Mar 15, 2021
2 parents 8f99853 + 28ba20c commit fa366a1
Show file tree
Hide file tree
Showing 9 changed files with 313 additions and 320 deletions.
395 changes: 138 additions & 257 deletions bin/mgit

Large diffs are not rendered by default.

23 changes: 10 additions & 13 deletions bin/muse
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ museUsage() {
global options:
-v add verbosity
- h print help
-h print help
action:
status - print status of setup
setup - setup UPS products and path
build - run scons
link - link to packages in another build area
status - print status of setup
setup - setup UPS products and path
build - run scons code build
link - create a link to a package in another build area
tarball - tar up build for grid or a release
To see actions options, add "-h" to the action
To see each actions options, add "-h" to the action
EOF

Expand Down Expand Up @@ -74,11 +75,10 @@ if [ -z "$COMMAND" ]; then
$DONE 1
fi

OWD=$PWD

if [ "$COMMAND" == "setup" ]; then

#source $MUSE_DIR/bin/museSetup.sh "$@"
OWD=$PWD
source museSetup.sh "$@"
RC=$?

Expand All @@ -87,6 +87,7 @@ if [ "$COMMAND" == "setup" ]; then

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

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

Expand All @@ -95,12 +96,10 @@ elif [ "$COMMAND" == "link" ]; then
fi

if [ -z "$MUSE_WORK_DIR" ]; then
echo "EROR - MUSE_WORK_DIR not set - muse setup must be run first"
echo "ERROR - MUSE_WORK_DIR not set - \"muse setup\" must be run first"
$DONE 1
fi

cd $MUSE_WORK_DIR

if [ "$COMMAND" == "build" ]; then

$MUSE_DIR/bin/museBuild.sh "$@"
Expand All @@ -118,11 +117,9 @@ elif [ "$COMMAND" == "tarball" ]; then

else
echo "ERROR - unknown command $COMMAND"
cd $OWD
$DONE 1
fi

cd $OWD
$DONE $RC


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

cd $MUSE_WORK_DIR

#
# "build" the linked packages by making sure the links
# from our build area to the backing build area are there
Expand Down
85 changes: 67 additions & 18 deletions bin/museLink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
usageLink() {
cat <<EOF
muse link path/to/package
muse link <repo selection>
Create a link to a package in another build area so that package
can be included in the local build. This package will be included in
include and link paths, but it will not itself be built.
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
include, link, fcl and data paths, but it will not itself be built.
Example:
Since this command is usually run before "muse setup",
in must be run in the intended muse working directory
> muse link /mu2e/app/users/\$USER/myBaseBuild/Offline
creates
linkOffline -> /mu2e/app/users/\$USER/myBaseBuild/Offline
If the command is run without any arguments, a list
of suggested Offline backing builds will be shown
<repo selection>
The path seelction 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
EOF
return
Expand All @@ -29,30 +38,70 @@ if [[ "$1" == "-h" || "$1" == "--help" || "$1" == "help" ]]; then
exit 0
fi

CI_BASE=/cvmfs/mu2e-development.opensciencegrid.org/museCIBuild
#PUB_BASE=/cvmfs/mu2e.opensciencegrid.org/...

TARGET="$1"

#
# if no target, list cvmfs Offline
#

if [ -z "$TARGET" ]; then

echo "Recent published releases:"

echo "Recent CI builds"
BRANCHES=$( ls $CI_BASE )
for BRANCH in $BRANCHES
do
find $CI_BASE/$BRANCH -mindepth 1 -maxdepth 1 \
-printf "%TY-%Tm-%Td %TH:%TM %p\n" | \
sort -r | sed 's|'$CI_BASE/'||'
done

# add PUB area when ready

exit 0
fi


#
# we are assuming that the user specified the target relative
# to the working dir, if a relative path
#

if [ ! -d "$TARGET" ]; then
echo "ERROR target is not a directory: $TARGET"
exit 1
pubreg="^v[0-9,_]*+$"
FTARGET="no_final_target"

if [[ "$TARGET" =~ $pubreg ]]; then
[ $MUSE_VERBOSE -gt 0 ] && echo "would do published Offline $TARGET"
# must be a full path
FTARGET=cant_do_pub_$TARGET
elif [ -d $CI_BASE/$TARGET/Offline ]; then
FTARGET=$CI_BASE/$TARGET/Offline
elif [ -d "$TARGET" ]; then

reg="^/.*"
if [[ ! "$TARGET" =~ $reg ]]; then
# if target was a relative path, then account for the link subdir
FTARGET="../$TARGET"
else
FTARGET="$TARGET"
fi

else
echo "ERROR - target could not be parsed: $TARGET"
exit 1
fi

if [ ! -d link ]; then
mkdir link
fi

reg="^/.*"
if [[ ! "$TARGET" =~ $reg ]]; then
# if target was a relative path, then account for the link subdir
TARGET="../$TARGET"
fi
LINK=link/$(basename $FTARGET)

LINK=link/$(basename $TARGET)
ln -s $TARGET $LINK
ln -s $FTARGET $LINK

if [ -n "$MUSE_WORK_DIR" ]; then
echo "WARNING - Muse is already already setup - adding links "
Expand Down
43 changes: 40 additions & 3 deletions bin/museSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,45 @@
# script to drive the muse command to setup and build Mu2e analysis repos
#

usageSetup() {
echo setup usage
museSetupUsage() {
cat <<EOF
muse <global options> setup <directory> <options>
<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.
<options>
-q : add the following build options
prof/debug - complier switches (default prof)
eNN - compiler, like "e20" (default by an algorithm)
pNNN/uNNN - environmental set, like "p020" (default by an algorithm)
the following default to off:
ogl - link geant OGL graphics lib (default off)
qt - switch to geant libraries with qt graphics (default off)
st - compile with multi-threading flag off
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
EOF

return
}


if [[ "$1" == "-h" || "$1" == "--help" || "$1" == "help" ]]; then
museSetupUsage
return 0
fi

[ $MUSE_VERBOSE -gt 0 ] && echo "INFO - running museSetup with args: $@"

Expand Down Expand Up @@ -253,6 +286,8 @@ if [ $MUSE_VERBOSE -gt 0 ]; then
echo MUSE_BUILD_DIR=$MUSE_BUILD_DIR
fi

export MU2E_UPS_QUALIFIERS=+${MUSE_COMPILER_E}:+${MUSE_BUILD}

#
# now set paths for Offline and the build
#
Expand Down Expand Up @@ -420,4 +455,6 @@ if [ $RC -ne 0 ]; then
return 1
fi

echo " Build: $MUSE_BUILD Core: $MUSE_FLAVOR $MUSE_COMPILER_E $MUSE_ENVSET Options: $MUSE_OPTS"

return 0
13 changes: 7 additions & 6 deletions bin/museStatus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if [[ "$1" == "-h" || "$1" == "--help" || "$1" == "help" ]]; then
exit 0
fi

cd $MUSE_WORK_DIR

if [ -d build ]; then
echo ""
Expand Down Expand Up @@ -58,13 +59,15 @@ echo " MUSE_ENVSET = " $MUSE_ENVSET
echo " MUSE_ENVSET_DIR = " $MUSE_ENVSET_DIR
[ $MUSE_VERBOSE -gt 0 ] && echo "build directory stub based on the build options:"
echo " MUSE_STUB = " $MUSE_STUB
[ $MUSE_VERBOSE -gt 0 ] && echo "the relative path to the build directory:"
echo " MUSE_BUILD_BASE = " $MUSE_BUILD_BASE
[ $MUSE_VERBOSE -gt 0 ] && echo "full path to build dir:"
echo " MUSE_BUILD_DIR = " $MUSE_BUILD_DIR
#[ $MUSE_VERBOSE -gt 0 ] && echo "the relative path to the build directory:"
#echo " MUSE_BUILD_BASE = " $MUSE_BUILD_BASE
#[ $MUSE_VERBOSE -gt 0 ] && echo "full path to build dir:"
#echo " MUSE_BUILD_DIR = " $MUSE_BUILD_DIR
[ $MUSE_VERBOSE -gt 0 ] && echo "location of Muse UPS product"
echo " MUSE_DIR = " $MUSE_DIR

echo

[ $MUSE_VERBOSE -eq 0 ] && exit 0
echo "build options:"
echo " MUSE_FLAVOR = " $MUSE_FLAVOR
Expand Down Expand Up @@ -94,6 +97,4 @@ echo ""
echo "ROOT_INCLUDE_PATH="
echo $ROOT_INCLUDE_PATH | tr ":" "\n"

echo ""

exit 0
Loading

0 comments on commit fa366a1

Please sign in to comment.