An open API service indexing awesome lists of open source software.

https://github.com/jeffersonlab/srm

System readiness manager app
https://github.com/jeffersonlab/srm

ace acg container-workflows java java-workflows javaee management-app smoothness

Last synced: about 2 months ago
JSON representation

System readiness manager app

Awesome Lists containing this project

README

          

# srm [![CI](https://github.com/JeffersonLab/srm/actions/workflows/ci.yaml/badge.svg)](https://github.com/JeffersonLab/srm/actions/workflows/ci.yaml) [![Docker](https://img.shields.io/docker/v/jeffersonlab/srm?sort=semver&label=DockerHub)](https://hub.docker.com/r/jeffersonlab/srm)
A [Jakarta EE 10](https://en.wikipedia.org/wiki/Jakarta_EE) web application for managing system readiness at Jefferson Lab built with the [Smoothness](https://github.com/JeffersonLab/smoothness) web template.

![Screenshot](https://github.com/JeffersonLab/srm/raw/main/Screenshot.png?raw=true "Screenshot")

---
- [Overview](https://github.com/JeffersonLab/srm#overview)
- [Quick Start with Compose](https://github.com/JeffersonLab/srm#quick-start-with-compose)
- [Install](https://github.com/JeffersonLab/srm#install)
- [Configure](https://github.com/JeffersonLab/srm#configure)
- [Build](https://github.com/JeffersonLab/srm#build)
- [Develop](https://github.com/JeffersonLab/srm#develop)
- [Release](https://github.com/JeffersonLab/srm#release)
- [Deploy](https://github.com/JeffersonLab/srm#deploy)
- [See Also](https://github.com/JeffersonLab/srm#see-also)
---

## Overview
The System Readiness application allows machine operators and management to determine machine readiness. The app inventories all systems of the machine and organizes systems into a hierarchy of categories. Further, systems are assigned individual components to increase readiness specificity. To aid in answering the more common question of where can beam be sent, each component is associated with zero or more beam destinations. Component readiness is determined by System Responsible Groups, and each component has an ordered set assigned. Each Responsible Group is associated with a set of group leaders, who are authorized to mark final readiness.

## Quick Start with Compose
1. Grab project
```
git clone https://github.com/JeffersonLab/srm
cd srm
```
2. Launch [Compose](https://github.com/docker/compose)
```
docker compose up
```
3. Navigate to page
```
http://localhost:8080/srm
```

**Note**: Login with demo username "tbrown" and password "password".

See: [Docker Compose Strategy](https://gist.github.com/slominskir/a7da801e8259f5974c978f9c3091d52c)

## Install
This application requires a Java 17+ JVM and standard library to run, plus a Jakarta EE 10 application server (developed with Wildfly).

1. Install service [dependencies](https://github.com/JeffersonLab/srm/blob/main/deps.yaml)
2. Download [Wildfly 37.0.1](https://www.wildfly.org/downloads/)
3. [Configure](https://github.com/JeffersonLab/srm#configure) Wildfly and start it
4. Download [srm.war](https://github.com/JeffersonLab/srm/releases) and deploy it to Wildfly
5. Navigate your web browser to [localhost:8080/srm](http://localhost:8080/srm)

## Configure

### Configtime
Wildfly must be pre-configured before the first deployment of the app. The [wildfly bash scripts](https://github.com/JeffersonLab/wildfly#configure) can be used to accomplish this. See the [Dockerfile](https://github.com/JeffersonLab/srm/blob/main/Dockerfile) for an example.

### Runtime
Uses the [Smoothness Environment Variables](https://github.com/JeffersonLab/smoothness#environment-variables) plus the following application specific:

| Name | Description |
|----------------|---------------------------------------------------------------------------------------------------------------------------------|
| SRM_BOOKS_CSV | Comma Separated Logbooks to post OPS-PR entries to. Defaults to TLOG. Generally should be set to ELOG in production. |
| CED_SERVER_URL | The scheme, host name and port of the CEBAF Element Database (CED) |

There are some [Settings](https://github.com/JeffersonLab/srm/blob/87cb8b7d1a9b0e2e36cc68b34eaefe02478bb89a/docker/oracle/setup/02_ddl.sql#L256-L264) in the database as well.

### Database
This application requires an Oracle 19+ database with the following [schema](https://github.com/JeffersonLab/srm/tree/main/container/oracle/initdb.d) installed. The application server hosting this app must also be configured with a JNDI datasource.

## Build
This project is built with [Java 21](https://adoptium.net/) (compiled to Java 17 bytecode), and uses the [Gradle 9](https://gradle.org/) build tool to automatically download dependencies and build the project from source:

```
git clone https://github.com/JeffersonLab/srm
cd srm
gradlew build
```
**Note**: If you do not already have Gradle installed, it will be installed automatically by the wrapper script included in the source

**Note for JLab On-Site Users**: Jefferson Lab has an intercepting [proxy](https://gist.github.com/slominskir/92c25a033db93a90184a5994e71d0b78)

See: [Docker Development Quick Reference](https://gist.github.com/slominskir/a7da801e8259f5974c978f9c3091d52c#development-quick-reference)

## Develop
In order to iterate rapidly when making changes it's often useful to run the app directly on the local workstation, perhaps leveraging an IDE. In this scenario run the service dependencies with:
```
docker compose -f deps.yaml up
```
**Note**: The local install of Wildfly should be [configured](https://github.com/JeffersonLab/srm#configure) to proxy connections to services via localhost and therefore the environment variables should contain:
```
KEYCLOAK_BACKEND_SERVER_URL=http://localhost:8081
FRONTEND_SERVER_URL=https://localhost:8443
```
Further, the local DataSource must also leverage localhost port forwarding so the `standalone.xml` connection-url field should be: `jdbc:oracle:thin:@//localhost:1521/xepdb1`.

The [server](https://github.com/JeffersonLab/wildfly/blob/main/scripts/server-setup.sh) and [app](https://github.com/JeffersonLab/wildfly/blob/main/scripts/app-setup.sh) setup scripts can be used to set up a local instance of Wildfly.

## Release
1. Bump the version number in the VERSION file and commit and push to GitHub (using [Semantic Versioning](https://semver.org/)).
2. The [CD](https://github.com/JeffersonLab/srm/blob/main/.github/workflows/cd.yaml) GitHub Action should run automatically invoking:
- The [Create release](https://github.com/JeffersonLab/java-workflows/blob/main/.github/workflows/gh-release.yaml) GitHub Action to tag the source and create release notes summarizing any pull requests. Edit the release notes to add any missing details. A war file artifact is attached to the release.
- The [Publish docker image](https://github.com/JeffersonLab/container-workflows/blob/main/.github/workflows/docker-publish.yaml) GitHub Action to create a new demo Docker image.
- The [Deploy to JLab](https://github.com/JeffersonLab/general-workflows/blob/main/.github/workflows/jlab-deploy-app.yaml) GitHub Action to deploy to the JLab test environment.

## Deploy
The deploy to JLab's acctest is handled automatically via the release workflow.

At JLab this app is found at [ace.jlab.org/srm](https://ace.jlab.org/srm) and internally at [acctest.acc.jlab.org/srm](https://acctest.acc.jlab.org/srm). However, those servers are proxies for `wildfly3.acc.jlab.org` and `wildflytest3.acc.jlab.org` respectively. A [deploy script](https://github.com/JeffersonLab/wildfly/blob/main/scripts/deploy.sh) is provided on each server to automate wget and deploy. Example:

```
/opt/wildfly/cd/deploy.sh srm v1.2.3
```

**JLab Internal Docs**: [RHEL9 Wildfly](https://acgdocs.acc.jlab.org/en/ace/builds/rhel9-wildfly)

## See Also
- [Hot Checkout for 12 GeV at Jefferson Lab](https://proceedings.jacow.org/ICALEPCS2015/papers/mopgf072.pdf), presented at [ICALEPCS 2015](https://proceedings.jacow.org/ICALEPCS2015/)
- [JLab ACE management-app list](https://github.com/search?q=org%3Ajeffersonlab+topic%3Aace+topic%3Amanagement-app&type=repositories)