-
Notifications
You must be signed in to change notification settings - Fork 10
how to install flux accounting alongside flux core
Christopher Moussa edited this page Jul 27, 2020
·
1 revision
This documentation outlines the process of installing flux-accounting
alongside Flux so that the accounting subcommands can be picked up by Flux's command driver.
- clone both repos:
$ git clone https://github.com/flux-framework/flux-core.git
$ git clone https://github.com/flux-framework/flux-accounting.git
- set FLUX_INSTALL_PREFIX:
$ export FLUX_INSTALL_PREFIX=~/flux/accounting-target/
- build flux-core:
[flux-core]$ ./autogen.sh && ./configure --prefix=$FLUX_INSTALL_PREFIX && make -j && make install
The Flux executable gets placed here:
[flux-core]$ ll ~/flux/accounting-target/bin/
total 724
-rwxr-xr-x 1 moussa1 moussa1 736104 Jun 17 10:36 flux
- set the PATH and PYTHONPATH environment variables:
$ export PYTHONPATH=~/flux/accounting-target/lib/python3.7/site-packages/
$ export PATH=$PATH:~/flux/accounting-target/bin/
Here are the contents of flux-accounting's Makefile:
FLUX_INSTALL_PREFIX ?= /usr
FLUX=${FLUX_INSTALL_PREFIX}/bin/flux
FLUX_PYTHON_VERSION=$(shell ${FLUX} python --version | cut -f 2 -d ' ' | cut -f 1-2 -d.)
dependencies:
${FLUX} python -m pip install -r requirements.txt --user
install:
${FLUX_INSTALL_PREFIX}/bin/flux python setup.py install \
--prefix=${FLUX_INSTALL_PREFIX} \
--install-scripts=${FLUX_INSTALL_PREFIX}/libexec/flux/cmd/ \
--install-lib=${FLUX_INSTALL_PREFIX}/lib/flux/python${FLUX_PYTHON_VERSION}/
check:
${FLUX_INSTALL_PREFIX}/bin/flux python -m unittest discover -b
- Run
make install
:
[flux-accounting]$ make install
/g/g0/moussa1/flux/accounting-target/bin/flux python -m pip install -r requirements.txt --user
Requirement already satisfied: pandas==0.25.3 in /g/g0/moussa1/.local/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (0.25.3)
Requirement already satisfied: numpy>=1.13.3 in /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-3.7.2-asydydmavj2puklmx5t6cu3ruzmg2b3a/lib/python3.7/site-packages (from pandas==0.25.3->-r requirements.txt (line 1)) (1.16.2)
Requirement already satisfied: python-dateutil>=2.6.1 in /g/g0/moussa1/.local/lib/python3.7/site-packages (from pandas==0.25.3->-r requirements.txt (line 1)) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-3.7.2-asydydmavj2puklmx5t6cu3ruzmg2b3a/lib/python3.7/site-packages (from pandas==0.25.3->-r requirements.txt (line 1)) (2017.2)
Requirement already satisfied: six>=1.5 in /collab/usr/gapps/python/build/spack-toss3.3/opt/spack/linux-rhel7-x86_64/gcc-4.9.3/python-3.7.2-asydydmavj2puklmx5t6cu3ruzmg2b3a/lib/python3.7/site-packages (from python-dateutil>=2.6.1->pandas==0.25.3->-r requirements.txt (line 1)) (1.12.0)
/g/g0/moussa1/flux/accounting-target/bin/flux python -m pip install --install-option="--prefix=/g/g0/moussa1/flux/accounting-target/" --install-option="--install-scripts=/g/g0/moussa1/flux/accounting-target/libexec/flux/cmd/" . --upgrade
/usr/tce/packages/python/python-3.7.2/lib/python3.7/site-packages/pip/_internal/commands/install.py:207: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
cmdoptions.check_install_build_global(options)
Processing /g/g0/moussa1/src/flux-framework/flux-accounting
Skipping bdist_wheel for flux-accounting, due to binaries being disabled for it.
Installing collected packages: flux-accounting
Running setup.py install for flux-accounting ... done
Successfully installed flux-accounting
- Now I can call
flux-accounting
commands using theflux(1)
command driver:
$ ~/flux/accounting-target/bin/flux account -h
usage: flux-account.py [-h] {view-user,add-user,delete-user,edit-user} ...
Description: Translate command line arguments into SQLite instructions for the
Flux Accounting Database.
positional arguments:
{view-user,add-user,delete-user,edit-user}
sub-command help
view-user view a user's information in the accounting database
add-user add a user to the accounting database
delete-user remove a user from the accounting database
edit-user edit a user's value
optional arguments:
-h, --help show this help message and exit
- And from the directory where the database file is located (like before), I can run the
flux account
commands and interact with the DB:
[accounting]$ ~/flux/accounting-target/bin/flux account add-user --username=fluxuser --account=acct
[accounting]$ ~/flux/accounting-target/bin/flux account view-user fluxuser
id_assoc creation_time mod_time deleted user_name admin_level account parent_acct shares max_jobs max_wall_pj
0 1 1592415668 1592415668 0 fluxuser 1 acct pacct 10 100 60
[accounting]$ ~/flux/accounting-target/bin/flux account edit-user --username=fluxuser --field=max_jobs --new-value=12345
[accounting]$ ~/flux/accounting-target/bin/flux account delete-user fluxuser