Skip to content

Commit

Permalink
APS-44 task: Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tcooper committed Nov 7, 2014
0 parents commit b0385a4
Show file tree
Hide file tree
Showing 17 changed files with 728 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.rpmmacros
BUILD/
RPMS/
SOURCES/
SPECS/
SRPMS/
Rolls.mk
Rules-install.mk
Rules-linux-centos.mk
Rules-linux.mk
Rules-rcfiles.mk
Rules-scripts.mk
Rules.mk
_arch
_distribution
_os
disk?/
python.mk
rocks-version-common.mk
rocks-version.mk
roll-profile.mk
roll-*.xml
*.spec
*.spec.mk
*.iso
*.rpm
*.tar.gz
*.tar.bz2
*.tgz
*.zip
67 changes: 67 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# $Id$
#
# @Copyright@
#
# Rocks(r)
# www.rocksclusters.org
# version 6.1.1 (Sand Boa)
#
# Copyright (c) 2000 - 2014 The Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice unmodified and in its entirety, this list of conditions and the
# following disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# 3. All advertising and press materials, printed or electronic, mentioning
# features or use of this software must display the following acknowledgement:
#
# "This product includes software developed by the Rocks(r)
# Cluster Group at the San Diego Supercomputer Center at the
# University of California, San Diego and its contributors."
#
# 4. Except as permitted for the purposes of acknowledgment in paragraph 3,
# neither the name or logo of this software nor the names of its
# authors may be used to endorse or promote products derived from this
# software without specific prior written permission. The name of the
# software includes the following terms, and any derivatives thereof:
# "Rocks", "Rocks Clusters", and "Avalanche Installer". For licensing of
# the associated name, interested parties should contact Technology
# Transfer & Intellectual Property Services, University of California,
# San Diego, 9500 Gilman Drive, Mail Code 0910, La Jolla, CA 92093-0910,
# Ph: (858) 534-5815, FAX: (858) 534-7345, E-MAIL:[email protected]
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# @Copyright@
#
# $Log$
#

-include $(ROLLSROOT)/etc/Rolls.mk
include Rolls.mk

default: roll

distclean:: clean
-rm -f _arch build.log
-rm -rf RPMS SRPMS
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SDSC "rabbitmq" roll

## Overview

This roll bundles rabbitmq.

For more information about the various packages included in the rabbitmq roll please visit their official web pages:

- <a href="" target="_blank"></a> is .
- <a href="" target="_blank"></a> is .


## Requirements

To build/install this roll you must have root access to a Rocks development
machine (e.g., a frontend or development appliance).

If your Rocks development machine does *not* have Internet access you must
download the appropriate rabbitmq source file(s) using a machine that does
have Internet access and copy them into the `src/<package>` directories on your
Rocks development machine.


## Dependencies

Unknown at this time.


## Building

To build the rabbitmq-roll, execute these instructions on a Rocks development
machine (e.g., a frontend or development appliance):

```shell
% make default 2>&1 | tee build.log
% grep "RPM build error" build.log
```

If nothing is returned from the grep command then the roll should have been
created as... `rabbitmq-*.iso`. If you built the roll on a Rocks frontend then
proceed to the installation step. If you built the roll on a Rocks development
appliance you need to copy the roll to your Rocks frontend before continuing
with installation.


## Installation

To install, execute these instructions on a Rocks frontend:

```shell
% rocks add roll *.iso
% rocks enable roll rabbitmq
% cd /export/rocks/install
% rocks create distro
% rocks run roll rabbitmq | bash
```


13 changes: 13 additions & 0 deletions USING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SDSC HPC Group Rocks® roll template

rabbitmq is a Rocks(r) roll template to be used as a starting point for the creation of new rolls.

Currently the only difference between this roll and the template generated by the Rocks(r) command...

rocks create new roll name=rabbitmq

...is the inclusion of the `rename_roll.sh` script which can be used to rename directories and files as well as replace the content of the template files with the 'new' roll name.

Ultimately, more generic code will be added to the template to illustrate examples of how to include various types of Rocks(r) roll content and methods to pull 'source' packages for a roll from the Internet into the roll build tree.

*This file should be removed from any child repository created from it along with `gen_hash.sh` and `rename_roll.sh`.*
17 changes: 17 additions & 0 deletions gen_hash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# Generates a 'binary_hashes' entry for supplied object(s)

for OBJ in "$@"
do

OBJ_BASENAME=`basename ${OBJ}`
OBJ_DIRNAME=`dirname ${OBJ}`

if [ -f ${OBJ} ]; then
OBJ_SIZE=`ls -l $OBJ | awk '{print $5}'`
OBJ_HASH=`git hash-object -t blob $OBJ`
OBJ_NAME=${OBJ}
printf "%15d %40s %s\n" $OBJ_SIZE $OBJ_HASH $OBJ_NAME
fi

done
32 changes: 32 additions & 0 deletions graphs/default/rabbitmq.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" standalone="no"?>

<graph>

<description>

The rabbitmq Roll

</description>

<copyright>
Copyright (c) 2000 - 2014 The Regents of the University of California.
All rights reserved. Rocks(r) v6.1.1 www.rocksclusters.org

</copyright>

<changelog>
$Log$
</changelog>

<!-- add edges here -->
<edge from="base">
<to>rabbitmq-base</to>
</edge>

<!-- enforce post section ordering -->
<!-- rabbitmq-base post sections execute after base post sections -->
<order head="base">
<tail>rabbitmq-base</tail>
</order>

</graph>
23 changes: 23 additions & 0 deletions nodes/rabbitmq-base.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" standalone="no"?>

<kickstart>


<description>
Your rabbitmq roll description here
</description>

<copyright>
Copyright (c) 2000 - 2014 The Regents of the University of California.
All rights reserved. Rocks(r) v6.1.1 www.rocksclusters.org

</copyright>

<changelog>
$Log$
</changelog>

<package>rabbitmq</package>


</kickstart>
106 changes: 106 additions & 0 deletions rename_roll.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash

# This script replaces all instances of the 'old' name of this roll template with
# a 'new' roll name. It changes file/directory names as well as the contents of
# the files inside this template roll.

usage () {
echo "$(basename "$0") -n newname [-c curname] [-h] -- program to rename the roll template
where:
-h show this help text
-n where newname is the new name for the roll
-c where curname is the current name of the roll"
}

CURNAME=
NEWNAME=
options='hn:c:'
while getopts $options option
do
case "$option" in
c ) CURNAME=$OPTARG;;
n ) NEWNAME=$OPTARG;;
h ) usage; exit;;
\? ) printf "unknown option: -%s\n" "$OPTARG" >&2; usage >&2; exit 1;;
: ) printf "missing argument for -%s\n" "$OPTARG" >&2; usage >&2; exit 1;;
* ) printf "unimplemented optio: -%s\n" "$OPTARG" >&2; usage >&2; exit 1;;
esac
done
shift $((OPTIND - 1))

# You 'must' supply a new roll name'
if [[ -z $NEWNAME ]]
then
usage
exit 1
fi

# If -c option is not specified determine it from graph file.
if [[ -z $CURNAME ]]
then
CURNAME=$(basename `ls graphs/default/*.xml` | cut -d. -f1)
fi

echo "Renaming ${CURNAME} roll to ${NEWNAME}"
ROOT=$(pwd)

echo " Changing directory names..."
DIRS=$(find . -depth -type d | grep $CURNAME)

for d in ${DIRS}
do
if [ -d ${d} ]; then
newd=$(echo ${d} | sed "s,\(.*\)"${CURNAME}"\(.*\),\1"${NEWNAME}"\2,g")
mv ./${d} ./${newd};
fi
done
cd ${ROOT}

echo " Changing file names..."
FILES=$(find . -depth -type f | grep ${CURNAME})

for f in ${FILES}
do
if [ -f ${f} ]; then
newf=$(echo ${f} | sed "s,"${CURNAME}","${NEWNAME}",g");
mv ./${f} ./${newf};
fi
done
cd ${ROOT}

echo " Changing file contents...."
FILES=`find . -depth -type f | egrep -v "rename_roll.sh"`

for f in ${FILES}
do
sed -i "s,"${CURNAME}","${NEWNAME}",g" ./${f}
done
cd ${ROOT}

echo " Removing .git directories..."
DIRS=$(find . -depth -type d -iname ".git")

for d in ${DIRS}
do
if [ -d ${d} ]; then
/bin/rm -rf ./${d};
fi
done
cd ${ROOT}

cat << EOF
The following steps are now required after using ./rename_roll.sh...
- Download or otherwise create src/${NEWNAME}/${NEWNAME}-1.0.tgz
- Upload src/${NEWNAME}/${NEWNAME}-1.0.tgz to the DL.SERVER listed in
src/${NEWNAME}/pull.mk
- Record size and git hash of src/${NEWNAME}/${NEWNAME}-1.0.tgz in
src/${NEWNAME}/binary_hashes per the instructions in src/${NEWNAME}/README.md
While not required, you should rename this directory ${NEWNAME}-roll to avoid confusion.
EOF

exit 0
Loading

0 comments on commit b0385a4

Please sign in to comment.