Skip to content

Commit

Permalink
Add agent, server and web-server Makefiles
Browse files Browse the repository at this point in the history
The agent and web-server Makefiles provide an install target.

For the server Makefile, there are two targets: `install' and
`install-build-artifacts'.  The first one can be used interactively to
do a local server installation. The second one is only to be used
when building an RPM: it installs SHA1 and SEQNO files that are not
generally available: they are only produced during an RPM build.

They also include a `clean' target for debugging convenience:
`make clean' removes the corresponding local installation.

The installation location is controlled by the DESTDIR variable
(by default, `/opt/pbench-server' and `/opt/pbench-web-server' resp.)
The default can be overridden on the command line.

In addition, we add a `package.json' file for the web-server npm install
(and remove the patch that added a different package.json file to the
server installation - it is not clear why that was a patch).

We also make VERSION a file local to web-server/, not a link. That
follows the trend set by PR #1670. The top-level VERSION file is then
useless and we get rid of it.

Finally, there is an opportunistic fix for a bug that reared its ugly head
when testing the above:

pbench-server-activate-create-crontab role: fix PATH

Add the server bin/ path at the beginning of PATH in the execution environment
instead of at the end: that avoids unpleasant surprises if e.g. the agent is
already installed.
  • Loading branch information
ndokos authored and portante committed Jun 9, 2020
1 parent 93e6744 commit fb19ef2
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 2 deletions.
157 changes: 157 additions & 0 deletions agent/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# settings - hardwired, but they could be set from the config file or
# from the command line.
DESTDIR=/opt/pbench-agent-test
OWNER=pbench
GROUP=pbench

# derived directories
CONFIGDIR=${DESTDIR}/config
UTILDIR=${DESTDIR}/util-scripts
BENCHDIR=${DESTDIR}/bench-scripts
TOOLDIR=${DESTDIR}/tool-scripts
LIBDIR=${DESTDIR}/lib

# commands used below
COPY = cp -a
CHOWN = chown -R ${OWNER}.${GROUP}
INSTALL = install
#INSTALLOPTS = --mode 755 --directory --owner=${OWNER} --group=${GROUP}
INSTALLOPTS = --directory

# all the scripts that's fit to install
util-scripts = \
cdm-get-iterations \
getconf.py \
pbench-add-metalog-option \
pbench-agent-config-activate \
pbench-agent-config-ssh-key \
pbench-avg-stddev \
pbench-cleanup \
pbench-clear-results \
pbench-clear-tools \
pbench-collect-sysinfo \
pbench-copy-results \
pbench-copy-result-tb \
pbench-get-iteration-metrics \
pbench-get-metric-data \
pbench-get-primary-metric \
pbench-import-cdm \
pbench-kill-tools \
pbench-list-tools \
pbench-list-triggers \
pbench-log-timestamp \
pbench-make-result-tb \
pbench-metadata-log \
pbench-move-results \
pbench-output-monitor \
pbench-postprocess-tools \
pbench-postprocess-tools-cdm \
pbench-register-tool \
pbench-register-tool-set \
pbench-register-tool-trigger \
pbench-remote-sysinfo-dump \
pbench-start-tools \
pbench-stop-tools \
pbench-sysinfo-dump \
pbench-tool-trigger \
README \
require-rpm

bench-scripts = \
pbench-cyclictest \
pbench-dbench \
pbench-fio \
pbench-fio.md \
pbench-gen-iterations \
pbench-iozone \
pbench-linpack \
pbench-migrate \
pbench-netperf \
pbench-run-benchmark \
pbench-run-benchmark-sample \
pbench-specjbb2005 \
pbench-trafficgen \
pbench-uperf \
pbench-uperf.md \
pbench-user-benchmark \
postprocess \
templates


tool-scripts = \

# targets
.PHONY: install \
install-dirs \
install-ansible \
install-util-scripts \
install-bench-scripts \
install-tool-scripts \
install-lib \
install-configtools \
install-stockpile \
install-build-artifacts

install: install-dirs install-ansible install-config install-util-scripts install-bench-scripts install-tool-scripts install-lib install-configtools install-stockpile
${COPY} VERSION ${DESTDIR}
${COPY} base ${DESTDIR}
${COPY} profile ${DESTDIR}

install-dirs:
${INSTALL} ${INSTALLOPTS} ${DESTDIR}
${INSTALL} ${INSTALLOPTS} ${DESTDIR}/ansible
${INSTALL} ${INSTALLOPTS} ${CONFIGDIR}
${INSTALL} ${INSTALLOPTS} ${CONFIGDIR}/benchmark
${INSTALL} ${INSTALLOPTS} ${UTILDIR}
${INSTALL} ${INSTALLOPTS} ${BENCHDIR}
${INSTALL} ${INSTALLOPTS} ${BENCHDIR}/postprocess
${INSTALL} ${INSTALLOPTS} ${BENCHDIR}/templates
${INSTALL} ${INSTALLOPTS} ${TOOLDIR}
${INSTALL} ${INSTALLOPTS} ${TOOLDIR}/postprocess
${INSTALL} ${INSTALLOPTS} ${TOOLDIR}/datalog
${INSTALL} ${INSTALLOPTS} ${LIBDIR}
${INSTALL} ${INSTALLOPTS} ${LIBDIR}/configtools
${INSTALL} ${INSTALLOPTS} ${DESTDIR}/stockpile

install-ansible:
${COPY} -r ansible ${DESTDIR}

install-config:
${COPY} -r config ${DESTDIR}

install-util-scripts:
cd util-scripts; \
${COPY} ${util-scripts} ${UTILDIR}

install-bench-scripts:
cd bench-scripts; \
${COPY} -r ${bench-scripts} ${BENCHDIR}
cd ${BENCHDIR}; \
ln -sf postprocess/compare-bench-results compare-bench-results

# install-bench-script-postprocess:
# cd bench-scripts; \
# ${COPY} -r postprocess ${BENCHDIR}

install-tool-scripts:
${COPY} -r tool-scripts ${DESTDIR}

install-stockpile:
${COPY} -r stockpile ${DESTDIR}

install-lib:
${COPY} -r lib ${DESTDIR}

install-configtools:
${COPY} -r ../lib/configtools ${DESTDIR}/lib

# SHA1 and SEQNO - these are used when building an RPM only
# so we provide a target for the spec file to invoke. This
# is *NOT* meant to be invoked interactively.
install-build-artifacts:
${COPY} ../SHA1 ${DESTDIR}
${COPY} ../SEQNO ${DESTDIR}
${COPY} ../MANIFEST ${DESTDIR}

clean:
rm -rf ${DESTDIR}
113 changes: 113 additions & 0 deletions server/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# settings - hardwired, but they could be set from the config file or
# from the command line.
DESTDIR=/opt/pbench-server
OWNER=pbench
GROUP=pbench

# derived directories
BINDIR=${DESTDIR}/bin
LIBDIR=${DESTDIR}/lib

# commands used below
COPY = cp -a
CHOWN = chown -R ${OWNER}.${GROUP}
INSTALL = install
#INSTALLOPTS = --mode 755 --directory --owner=${OWNER} --group=${GROUP}
INSTALLOPTS = --directory

# all the scripts that's fit to install
binbase = \
pbench-base.py\
pbench-base.sh

# pbench-server-activate-create-crontab is needed by the ansible installation playbook.
# pbench-remote*, pbench-satelliter-state-change.py and pbench-server-set-result-state
# are needed on satellites, but we install them everywhere.
bintools = \
pbench-trampoline\
pbench-pp-status\
pbench-server-activate-create-crontab\
pbench-remote-satellite-state-change\
pbench-remote-sync-package-tarballs\
pbench-satellite-state-change.py\
pbench-server-set-result-state\
getconf.py

# All of these should be linked to pbench-trampoline.
# In addition, each one has a companion (either .sh or .py)
# which needs to be installed as well.
binlinks = \
pbench-audit-server\
pbench-backup-tarballs\
pbench-check-tb-age\
pbench-clean-up-dangling-results-links\
pbench-copy-sosreports\
pbench-cull-unpacked-tarballs\
pbench-dispatch\
pbench-index\
pbench-reindex\
pbench-report-status\
pbench-satellite-cleanup\
pbench-satellite-state-change\
pbench-server-prep-shim-002\
pbench-sync-package-tarballs\
pbench-sync-satellite\
pbench-unpack-tarballs\
pbench-verify-backup-tarballs\

# targets
.PHONY: install \
install-dirs \
install-bin install-binbase install-bintools install-binscripts \
install-lib \
install-configtools \
install-build-artifacts

install: install-dirs install-bin install-lib
${COPY} VERSION ${DESTDIR}

install-dirs:
${INSTALL} ${INSTALLOPTS} ${DESTDIR}
${INSTALL} ${INSTALLOPTS} ${BINDIR}
${INSTALL} ${INSTALLOPTS} ${LIBDIR}
${INSTALL} ${INSTALLOPTS} ${LIBDIR}/crontab
${INSTALL} ${INSTALLOPTS} ${LIBDIR}/configtools

install-bin: install-binbase install-bintools install-binscripts install-configtools

install-binbase:
for f in ${binbase} ;do \
${COPY} bin/$$f ${BINDIR} \
;done

install-bintools:
for f in ${bintools} ;do \
${COPY} bin/$$f ${BINDIR} \
;done

install-binscripts:
cd bin; \
for f in ${binlinks} ;do \
${COPY} $$f ${BINDIR}; \
if [ -e $$f.sh ] ;then \
${COPY} $$f.sh ${BINDIR} \
;elif [ -e $$f.py ] ;then \
${COPY} $$f.py ${BINDIR} \
;fi \
;done

install-lib:
${COPY} -r lib ${DESTDIR}

install-configtools:
${COPY} -r ../lib/configtools ${LIBDIR}

# SHA1 and SEQNO - these are used when building an RPM only
# so we provide a target for the spec file to invoke. This
# is *NOT* meant to be invoked interactively.
install-build-artifacts:
${COPY} ../SHA1 ${DESTDIR}
${COPY} ../SEQNO ${DESTDIR}

clean:
rm -rf ${DESTDIR}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
command: "{{ scl }} pbench-server-activate-create-crontab {{ pbench_server_install_dir }}/lib/crontab"
environment:
_PBENCH_SERVER_CONFIG: "{{ pbench_server_install_dir }}/lib/config/pbench-server.cfg"
PATH: "{{ ansible_env.PATH }}:{{ pbench_server_install_dir }}/bin"
PATH: "{{ pbench_server_install_dir }}/bin:{{ ansible_env.PATH }}"
PYTHONPATH: "{{ pbench_server_install_dir }}/lib:"
48 changes: 48 additions & 0 deletions web-server/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# settings - hardwired, but they could be set from the config file.
DESTDIR=/opt/pbench-web-server

OWNER=pbench
GROUP=pbench

# commands used below
COPY = cp -a
CHOWN = chown -R ${OWNER}.${GROUP}
INSTALL = install
# The following requires root, so we avoid it here: it causes problems when building an RPM.
# Instead, we'll take care of it when the RPM is installed.
# For manual installation, we might resort to a conditional.
#INSTALLOPTS = --mode 755 --directory --owner=${OWNER} --group=${GROUP}
INSTALLOPTS = --directory

# targets
.PHONY: install \
install-dirs \
install-v0.2 \
install-v0.3 \
clean

install: install-dirs install-v0.2 install-v0.3
${COPY} package.json ${DESTDIR}
${COPY} VERSION ${DESTDIR}

install-dirs:
${INSTALL} ${INSTALLOPTS} ${DESTDIR}
${INSTALL} ${INSTALLOPTS} ${DESTDIR}/css
${INSTALL} ${INSTALLOPTS} ${DESTDIR}/css/v0.2
${INSTALL} ${INSTALLOPTS} ${DESTDIR}/css/v0.3
${INSTALL} ${INSTALLOPTS} ${DESTDIR}/js
${INSTALL} ${INSTALLOPTS} ${DESTDIR}/js/v0.2
${INSTALL} ${INSTALLOPTS} ${DESTDIR}/js/v0.3

install-v0.2:
${COPY} v0.2/css/* ${DESTDIR}/css/v0.2
${COPY} v0.2/js/* ${DESTDIR}/js/v0.2

install-v0.3:
${COPY} v0.3/LICENSE.TXT ${DESTDIR}/css/v0.3
${COPY} v0.3/LICENSE.TXT ${DESTDIR}/js/v0.3
${COPY} v0.3/css/* ${DESTDIR}/css/v0.3
${COPY} v0.3/js/* ${DESTDIR}/js/v0.3

clean:
rm -rf ${DESTDIR}
1 change: 0 additions & 1 deletion web-server/VERSION

This file was deleted.

1 change: 1 addition & 0 deletions web-server/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.69
25 changes: 25 additions & 0 deletions web-server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "pbench-web-server",
"version": "1.0.0",
"description": "JS and CSS for pbench results visualization",
"main": "index.js",
"dependencies": {
"c3": "^0.4.11",
"d3": "^3.5.17",
"d3-queue": "^3.0.1",
"fastdom": "^1.0.3",
"function-bind": "^1.1.0",
"nvd3": "^1.8.2",
"save-svg-as-png": "^1.0.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Andrew Theurer, Karl Rister",
"repository": {
"type" : "git",
"url" : "https://github.com/distributed-system-analysis/pbench.git"
},
"license": "GPL-3.0"
}

0 comments on commit fb19ef2

Please sign in to comment.