Skip to content

Commit b2cd9c7

Browse files
committed
Add historical data for Open OnDemand
1 parent 6620913 commit b2cd9c7

5 files changed

Lines changed: 743 additions & 40 deletions

File tree

xdmod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ ARG TARGETARCH
99
FROM stage-${TARGETARCH} as final
1010

1111
COPY . /build
12-
RUN /build/install.sh && rm -rf /build
1312
COPY conf/httpd.conf /etc/httpd/conf.d/xdmod.conf
1413
COPY conf/simplesamlphp /etc/xdmod/simplesamlphp
1514
COPY hierarchy.csv /srv/xdmod/hierarchy.csv
@@ -18,4 +17,5 @@ COPY scripts/ /srv/xdmod/scripts
1817
COPY bin/sendmail /usr/sbin/sendmail
1918
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
2019
COPY small-logo.png /srv/xdmod/small-logo.png
20+
RUN /build/install.sh && rm -rf /build
2121
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

xdmod/README.md

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ Overwrite config file '/etc/xdmod/organization.json' (yes, no)? [yes]
499499
```
500500
- Press the `Enter` key.
501501

502-
### Resource Setup [Documentation](https://open.xdmod.org/9.5/configuration.html#resources)
502+
### Resource Setup [Documentation](https://open.xdmod.org/configuration.html#resources)
503503

504504
Next we will go through the process of adding a Resource to XDMoD.
505505

@@ -712,7 +712,7 @@ Press ENTER to continue.
712712

713713
- Press the `Enter` key once more to be taken back to the main XDMoD configuration menu.
714714

715-
## Create Admin User [Documentation](https://open.xdmod.org/9.5/configuration.html#create-admin-user)
715+
## Create Admin User [Documentation](https://open.xdmod.org//configuration.html#create-admin-user)
716716

717717
```shell
718718
5) Create Admin User
@@ -790,7 +790,7 @@ Admin user created.
790790
Press ENTER to continue.
791791
```
792792

793-
## Hierarchy Setup [Documentation](https://open.xdmod.org/9.5/hierarchy.html)
793+
## Hierarchy Setup [Documentation](https://open.xdmod.org/hierarchy.html)
794794

795795
```shell
796796
6) Hierarchy
@@ -820,7 +820,7 @@ Top Level Name: [Decanal Unit]
820820
```
821821

822822
For this tutorial we're going to leave the Hierarchy with its default values, but if you are setting this up for production
823-
then please see our [Hierarchy Guide](https://open.xdmod.org/9.5/hierarchy.html) as it will more completely describe how
823+
then please see our [Hierarchy Guide](https://open.xdmod.org//hierarchy.html) as it will more completely describe how
824824
the hierarchy works as well as how to populate it.
825825

826826
```shell
@@ -858,7 +858,7 @@ Press ENTER to continue.
858858

859859
- Press the `Enter` key to continue.
860860

861-
## Data Warehouse Batch Export [Documentation](https://open.xdmod.org/9.5/dw-export.html#configuration)
861+
## Data Warehouse Batch Export [Documentation](https://open.xdmod.org/dw-export.html#configuration)
862862

863863
```shell
864864
7) Data Warehouse Batch Export
@@ -1010,7 +1010,7 @@ directly when needing more advanced customization.
10101010
Now that we have XDMoD setup, it's time to ingest some data. The jobs that we started at the beginning of the tutorial
10111011
should be complete so let's walk through the shred, ingest, and aggregate steps for job accounting data.
10121012

1013-
### Shredding [Documentation](https://open.xdmod.org/9.5/shredder.html)
1013+
### Shredding [Documentation](https://open.xdmod.org/shredder.html)
10141014
XDMoD provides a special command line tool for working with directly with slurm via `sacct` called `xdmod-slurm-helper`.
10151015
To see what command line arguments it accepts you can run `xdmod-slurm-helper -h`. For our purposes we will be using it
10161016
as follows:
@@ -1021,7 +1021,7 @@ as follows:
10211021
*Note, you will need to replace `$yesterday` and `$tomrrow` with their respective values in YYYY-MM-DD format.*
10221022

10231023
If your organization doesn't use Slurm or will be using the log files instead of querying `sacct` directly, then
1024-
`xdmod-shredder` will be the command for you. You can find our Shredder guide at [Shredder Guide](https://open.xdmod.org/9.5/shredder.html)
1024+
`xdmod-shredder` will be the command for you. You can find our Shredder guide at [Shredder Guide](https://open.xdmod.org/shredder.html)
10251025

10261026
Upon running `xdmod-slurm-helper` you should see output similar to:
10271027
```shell
@@ -1035,7 +1035,7 @@ Upon running `xdmod-slurm-helper` you should see output similar to:
10351035
[root@xdmod ~]#
10361036
```
10371037

1038-
### Ingesting & Aggregating [Documentation](https://open.xdmod.org/9.5/ingestor.html)
1038+
### Ingesting & Aggregating [Documentation](https://open.xdmod.org/ingestor.html)
10391039
Now that the accounting logs have been shredded we can now ingest and aggregate the information from them, thus making the
10401040
information available in XDMoD.
10411041

@@ -1320,20 +1320,21 @@ staff to analyse who, how and what OnDemand is used.
13201320

13211321
### Prerequisites
13221322
Since the xdmod-ondemand module displays usage of Open OnDemand you need to
1323-
have used Open OnDemand! If you are running through these steps after having
1324-
used Open OnDemand then there will be data to show in XDMoD. If not then log in
1325-
to Open OnDemand [https://localhost:3443](https://localhost:3443) and click
1326-
around a bit to generate data.
1323+
have used Open OnDemand! The xdmod container includes an example log
1324+
file generated from Open OnDemand so there is data to show in XDMoD.
13271325

13281326
### Installation
1329-
The xdmod-ondemand RPM must be installed on the `xdmod` instance:
1327+
The xdmod-ondemand RPM is already installed on the `xdmod` instance. To install
1328+
it manually you would run the following:
13301329
```shell
1331-
[hpcadmin@xdmod /] sudo yum install -y https://github.com/ubccr/xdmod-ondemand/releases/download/9.5.0-rc2/xdmod-ondemand-9.5.0-1.0.el7.noarch.rpm
1330+
[hpcadmin@xdmod /] sudo yum install -y https://github.com/ubccr/xdmod-ondemand/releases/download/v10.0.0/xdmod-ondemand-10.0.0-1.0.el7.noarch.rpm
13321331
```
13331332

13341333
### Configuration
1335-
Then the module must be configured. This involves setting up the database
1336-
tables and adding a resource, tables for the module are set up via the `xdmod-setup` tool
1334+
The setup of the OnDemand module involves using the interactive `xdmod-setup` tool
1335+
to initialize the database tables and to add a resource.
1336+
The module has been configured in the container already. The following instuctions
1337+
step through how this was performed, but do not need to be manually run.
13371338
```bash
13381339
[root@xdmod /] xdmod-setup
13391340
```
@@ -1429,28 +1430,18 @@ Do you want to see the output (yes, no)? [no]
14291430

14301431

14311432
### Obtaining Open OnDemand logs
1432-
The xdmod-ondemand module parses the webserver log files from Open OnDemand. For this tutorial
1433-
we will manually copy the webserver logs from the `ondemand` instance to the `xdmod` instance.
1433+
The xdmod-ondemand module parses the webserver log files from Open OnDemand.
1434+
The `xdmod` container in this tutorial includes a example log file that
1435+
was generated from Open OnDemand and is stored in the `/scratch/ondemand/logs` directory.
1436+
1437+
In this tutorial we will also show how to manually copy the webserver logs from the `ondemand` instance
1438+
to the `xdmod` instance.
14341439
In a production environment you would either ensure the files were available via
14351440
a shared mounted filesystem or configure a periodic cronjob to copy them.
1436-
The following creates a directory on the `xdmod` instance to be used for the
1437-
temporary storage of the Open OnDemand logs. The file permissions are set so
1438-
that the `xdmod` user has read permission.
14391441

1440-
First we will need to create the directory that will contain the OnDemand logs
1441-
```shell
1442-
[hpcadmin@xdmod /] sudo mkdir -p /scratch/ondemand/logs
1443-
```
1444-
1445-
Next, we need to ensure that `hpcadmin:xdmod` have access to this directory and its files.
1446-
```shell
1447-
[hpcadmin@xdmod /] sudo chown hpcadmin:xdmod /scratch/ondemand/logs
1448-
```
1449-
1450-
Finally, we'll adjust the permissions on the directory so that only hpcadmin and xdmod have access to its contents
1451-
```shell
1452-
[hpcadmin@xdmod /] sudo chmod 750 /scratch/ondemand/logs
1453-
```
1442+
In this tutorial we will use the `/scratch/ondemand/logs` directory on the `xdmod` instance for the
1443+
staging area of the Open OnDemand logs to be ingested into XDMoD. The file permissions are set so
1444+
that the `xdmod` user has read permission and the `hpcadmin` user has write access.
14541445

14551446
We now need to copy the files from the `ondemand` instance to the `xdmod` instance. To accomplish this we will first
14561447
need to ssh to the `ondemand` instance.
@@ -1460,7 +1451,7 @@ need to ssh to the `ondemand` instance.
14601451

14611452
Then we will be using scp to copy Open OnDemands Apache access log to our newly created directory on the `xdmod` instance.
14621453
```shell
1463-
[hpcadmin@ondemand ~] sudo scp /var/log/httpd24/localhost_access_ssl.log hpcadmin@xdmod:/scratch/ondemand/logs/
1454+
[hpcadmin@ondemand ~] sudo scp /var/log/httpd/localhost_access_ssl.log hpcadmin@xdmod:/scratch/ondemand/logs/
14641455
```
14651456

14661457
When you are prompted for `hpcadmin`s password, go ahead and provide it. If successful you should see the file being transferred.

xdmod/entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ then
7878
echo "---> XDMoD Open OnDemand module setup"
7979
expect /srv/xdmod/scripts/xdmod-setup-ondemand.tcl | col -b
8080

81+
echo "---> XDMoD Open OnDemand ingest historical data"
82+
sudo -u xdmod xdmod-ondemand-ingestor -r ondemand -u https://localhost:3443 -d /scratch/ondemand/logs
83+
sudo -u xdmod xdmod-ingestor
84+
sudo -u xdmod xdmod-ondemand-ingestor -r ondemand -u https://localhost:3443 -d /scratch/ondemand/logs
85+
8186
echo "---> Make sure we have a place to keep our backups"
8287
mkdir -p /srv/xdmod/backups
8388
fi

0 commit comments

Comments
 (0)