Skip to content

Commit

Permalink
Merge branch 'dev' into dev.667-fr-add-helm-packaging-update-packagin…
Browse files Browse the repository at this point in the history
…g-utils
  • Loading branch information
GregJohnStewart committed Nov 15, 2024
2 parents 146b7eb + a48f2d7 commit 0850c66
Show file tree
Hide file tree
Showing 135 changed files with 5,561 additions and 314 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/plugin-alertMessenger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI - Plugin - Alert Messenger

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ "**" ]
paths:
- "software/plugins/alert-messenger/**"
- ".github/workflows/plugin-alertMessenger.yml"
pull_request:
branches: [ "**" ]
paths:
- "software/plugins/alert-messenger/**"
- ".github/workflows/plugin-alertMessenger.yml"
workflow_call:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
working-directory: "software/plugins/alert-messenger/"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
uses: ./.github/workflows/wf-gradleBuild.yaml
with:
path: "software/plugins/alert-messenger/"
unitTest:
uses: ./.github/workflows/wf-gradleUnitTest.yaml
with:
path: "software/plugins/alert-messenger/"
intTest:
uses: ./.github/workflows/wf-gradleQuarkusIntTest.yaml
strategy:
matrix:
containerBased: [ false ] # TODO:: enable true
with:
path: "software/plugins/alert-messenger/"
containerBased: ${{ matrix.containerBased }}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packageName":"oqm-infra-jaeger",
"version":"1.2.0",
"version":"1.2.1",
"description":"Jaeger instance for Open QuarterMaster.",
"homepage":"https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster/tree/main/software/Infrastructure/jaeger",
"configs": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packageName":"oqm-infra-kafka+red+panda",
"version":"1.0.0",
"version":"1.0.1",
"description":"Kafka instance for Open QuarterMaster using Red Panda.",
"homepage":"https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster/tree/main/software/Infrastructure/kafka-red-panda",
"configs": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#

[Unit]
Description=Keycloak server for Open Quartermaster. Version ${version}, using Keycloak tagged to "24.0".
Description=Keycloak server for Open Quartermaster. Version ${version}, using Keycloak tagged to "26.0".
Documentation=https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster/tree/main/software/Infrastructure
After=docker.service
Wants=network-online.target
Expand All @@ -20,11 +20,11 @@ Requires=oqm-infra-postgres.service
[Service]
Type=simple
Restart=always
TimeoutSec=5m
TimeoutSec=10m
# setup operating variables
Environment="CONTAINER_NAME=oqm-infra-keycloak"
Environment="IMAGE_NAME=quay.io/keycloak/keycloak"
Environment="IMAGE_VERSION=24.0"
Environment="IMAGE_VERSION=26.0"
Environment="ENV_CONFIG_FILE=/tmp/oqm/serviceConfig/infra/keycloak/env.list"

ExecStartPre=/bin/bash -c "/usr/bin/docker stop -t 10 $CONTAINER_NAME || echo 'Could not stop keycloak container'"
Expand All @@ -38,6 +38,7 @@ ExecStartPre=/bin/bash -c "cp \"$(oqm-config -g cert.certs.privateKey)\" /etc/oq
ExecStartPre=/bin/bash -c "cp \"$(oqm-config -g cert.certs.systemCert)\" /etc/oqm/serviceConfig/infra/keycloak/files/publicCert.pem"
ExecStartPre=/bin/bash -c "cp \"$(oqm-config -g cert.certs.keystore)\" /etc/oqm/serviceConfig/infra/keycloak/files/keystore.p12"
ExecStartPre=/bin/bash -c "mkdir -p /tmp/oqm/serviceConfig/infra/keycloak"
# TODO:: use file templating to achieve this
ExecStartPre=/bin/bash -c "touch $ENV_CONFIG_FILE"
ExecStartPre=/bin/bash -c "chmod 600 $ENV_CONFIG_FILE"
ExecStartPre=/bin/bash -c "truncate -s 0 $ENV_CONFIG_FILE"
Expand Down Expand Up @@ -101,7 +102,7 @@ ExecStartPost=/bin/bash -c "running=\"false\"; \
echo \"Container was stopped!\"; \
exit 1; \
fi; \
hcGet=\"$(/usr/bin/curl -k \"https://$hostname:$servicePort/health\")\"; \
hcGet=\"$(docker run --rm --name oqm-infra-keycloak-hc --network=oqm-internal docker.io/curlimages/curl:latest https://oqm-infra-keycloak:9000/health -k)\"; \
echo \"Health check get: $hcGet\"; \
status=\"$(jq --argjson hcGet \"$hcGet\" -nr '$hcGet.status')\"; \
echo \"Status: $status\"; \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packageName":"oqm-infra-keycloak",
"version":"1.2.0",
"version":"1.2.2",
"description":"Keycloak instance for Open QuarterMaster.",
"homepage":"https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster/tree/main/deployment/Single%20Host/Infrastructure/keycloak",
"configs": [
Expand Down
2 changes: 1 addition & 1 deletion deployment/Single Host/Infrastructure/makeInstallers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Developer: EBP
Architecture: all
Description: $(cat "$packageConfigFile" | jq -r '.description')
Homepage: $(cat "$packageConfigFile" | jq -r '.homepage')
Depends: docker, docker.io, oqm-manager-station+captain (>= 2.2.0)$(cat "$packageConfigFile" | jq -r '.dependencies.deb')
Depends: docker.io, oqm-manager-station+captain (>= 2.2.0)$(cat "$packageConfigFile" | jq -r '.dependencies.deb')
EOT
# TODO:: add conflicts

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packageName":"oqm-infra-mongodb",
"version":"1.2.0",
"version":"1.2.1",
"description":"MongoDb instance for Open QuarterMaster.",
"homepage":"https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster/tree/main/software/Infrastructure/mongo",
"configs": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packageName":"oqm-infra-postgres",
"version":"1.2.0",
"version":"1.2.1",
"description":"Postgresql instance for Open QuarterMaster.",
"homepage":"https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster/tree/main/software/Infrastructure/postgresql",
"configs": [
Expand Down
4 changes: 2 additions & 2 deletions deployment/Single Host/Station-Captain/properties.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"packageName":"oqm-manager-station+captain",
"version":"2.4.0",
"version":"2.4.2",
"description":"Utility for setting up and maintaining an instance of Open QuarterMaster.",
"maintainer": {
"name":"EBP"
},
"homepage":"https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster/tree/main/software/Station%20Captain",
"dependencies": {
"deb":"bash, curl, jq, libnss-mdns, hwinfo, moreutils, dialog, docker, docker.io, unattended-upgrades, ca-certificates, python3 (>= 3.10.0), python3-dialog, python3-docker, python3-systemd, python3-argcomplete, python3-jinja2",
"deb":"bash, curl, jq, libnss-mdns, hwinfo, moreutils, dialog, docker.io, unattended-upgrades, ca-certificates, python3 (>= 3.10.0), python3-dialog, python3-docker, python3-systemd, python3-argcomplete, python3-jinja2, python3-distutils-extra",
"rpm":"bash, curl, jq, hwinfo, moreutils, dialog, docker, python3"
},
"copyright": {
Expand Down
25 changes: 18 additions & 7 deletions deployment/Single Host/Station-Captain/src/lib/LogUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,36 @@ class LogUtils:

@staticmethod
def setupLogging(logFile:str, console:bool=False):
Path(LogUtils.logDir).mkdir(parents=True, exist_ok=True)
LogUtils.logFile = logFile
filePresent:bool = False
if not os.path.exists(logFile):
try:
Path(LogUtils.logDir).mkdir(parents=True, exist_ok=True)
os.mknod(logFile)
LogUtils.logFile = logFile
filePresent = True
except Exception as e:
LogUtils.logFile = False
filePresent = False
else:
filePresent = True
logging.basicConfig(level=logging.NOTSET)

if console:
LogUtils.logLevel = logging.DEBUG

@staticmethod
def setupLogger(name: str) -> logging.Logger:
fh = logging.handlers.RotatingFileHandler(LogUtils.logDir+LogUtils.logFile, maxBytes=10*1024*1024, backupCount=5)
fh.setLevel(logging.DEBUG)

# sh = logging.StreamHandler()
# sh.setLevel(LogUtils.logLevel)

logOut = logging.getLogger(name)
# print(LogUtils.logLevel == logging.DEBUG)
logOut.setLevel(LogUtils.logLevel)
logOut.addHandler(fh)

if not LogUtils.logFile:
fh = logging.handlers.RotatingFileHandler(LogUtils.logDir+LogUtils.logFile, maxBytes=10*1024*1024, backupCount=5)
fh.setLevel(logging.DEBUG)
logOut.addHandler(fh)

# logOut.addHandler(sh)
return logOut

17 changes: 9 additions & 8 deletions deployment/Single Host/docs/System Requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@

This is a set of requirements for the entire system, not necessarily just the station captain.

This system is regularly tested on Ubuntu 22.04.
This system is regularly tested on Ubuntu 24.04.

## Software Requirements

- A Modern Linux OS
- At the moment we only support Debian-based systems (`apt`), we plan on eventually also supporting Fedora/RHEL (`dnf`) systems. (Tested on Ubuntu 22.04, Raspbian)
- At the moment we only support Debian-based systems (`apt`), we plan on eventually also supporting Fedora/RHEL (`dnf`) systems.
- Tested and verified:
- Ubuntu 22.04
- Lubuntu 22.04
- Ubuntu 24.04
- Raspbian (current version as of Dec 2023)

## Hardware Requirements:

- 2 cores on headless server, 4 cores on a host with a desktop
- 4gb of RAM, 8gb recommended for minimum
- CPU Requirements
- 2 cores on headless server, 4 cores on a host with a desktop
- One of the following architectures:
- 64-bit `x64` ISA, intel or AMD
- Must include [AVX](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions). Known supported:
- Any AMD
- Any modern Intel i3, i5, i7, i9
- Intel N95, N100
- Intel N95, N100, N300
- 64-bit ARM v8

Note:: it is possible certain plugins, or a large number of plugins, will require more resources or have different hardware requirements.
> [!NOTE]
> it is possible certain plugins, or a large number of plugins, will require more resources or have different hardware requirements.
### Proven SBC's and other 'specialty' hardware:

- ARM:
- [Raspberry Pi 5B](https://www.raspberrypi.com/products/raspberry-pi-5/), 8Gb memory recommended. 4Gb would probably be fine for testing and minimal purposes only, but any less is probably not going to be enough for a good experience.


- [Raspberry Pi 5B](https://www.raspberrypi.com/products/raspberry-pi-5/
- 8Gb memory recommended. 4Gb would probably be fine for testing and minimal purposes only, but any less is probably not going to be enough for a good experience.
90 changes: 90 additions & 0 deletions media/diagrams/Simple OQM Diagram.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<mxfile host="Electron" modified="2024-08-22T03:34:24.377Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.6.4 Chrome/124.0.6367.207 Electron/30.0.6 Safari/537.36" etag="DwPF22rHXfZuFsSd9hRX" version="24.6.4" type="device">
<diagram name="Page-1" id="3xNzu-Da8C1Rn3ltEX4L">
<mxGraphModel dx="1434" dy="803" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="jeEIYTSbyfxF0RzQu-zD-7" value="&lt;h1&gt;Core Services&lt;/h1&gt;" style="rounded=0;whiteSpace=wrap;html=1;verticalAlign=top;horizontal=0;" vertex="1" parent="1">
<mxGeometry x="50" y="130" width="380" height="240" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="jeEIYTSbyfxF0RzQu-zD-1" target="jeEIYTSbyfxF0RzQu-zD-7">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="240" y="60" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="jeEIYTSbyfxF0RzQu-zD-1" target="jeEIYTSbyfxF0RzQu-zD-15">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="540" y="60" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-1" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="390" y="20" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-5" value="Core API" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="130" y="290" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-8" value="Depot&lt;div&gt;(Landing page)&lt;/div&gt;" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="130" y="150" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-9" value="Base Station&lt;div&gt;(Main UI)&lt;/div&gt;" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="280" y="150" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-11" value="&lt;h1&gt;Databases&lt;/h1&gt;&lt;h1 style=&quot;line-height: 0%;&quot;&gt;&amp;amp; Infra&lt;/h1&gt;" style="rounded=0;whiteSpace=wrap;html=1;horizontal=0;verticalAlign=top;" vertex="1" parent="1">
<mxGeometry x="50" y="370" width="600" height="260" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-10" value="" style="shape=flexArrow;endArrow=classic;startArrow=classic;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<mxPoint x="290" y="410" as="sourcePoint" />
<mxPoint x="290" y="330" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-12" value="MongoDB" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="190" y="520" width="60" height="80" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-13" value="PostgreS&lt;span style=&quot;background-color: initial;&quot;&gt;QL&lt;/span&gt;" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="320" y="510" width="80" height="100" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-14" value="Keycloak&lt;div&gt;(User Auth)&lt;/div&gt;" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="350" y="380" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-15" value="&lt;h1&gt;Plugins&lt;/h1&gt;" style="rounded=0;whiteSpace=wrap;html=1;horizontal=0;verticalAlign=bottom;" vertex="1" parent="1">
<mxGeometry x="430" y="130" width="220" height="240" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-17" value="External Item Search" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="470" y="150" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-20" value="Kafka&lt;div&gt;(Messaging)&lt;/div&gt;" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="460" y="510" width="70" height="90" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-23" value="Alert Messenger" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="470" y="220" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-25" value="" style="shape=flexArrow;endArrow=classic;startArrow=classic;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<mxPoint x="539.5" y="410" as="sourcePoint" />
<mxPoint x="539.5" y="330" as="targetPoint" />
<Array as="points">
<mxPoint x="539.5" y="380" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-26" value="" style="shape=flexArrow;endArrow=classic;startArrow=classic;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="100" height="100" relative="1" as="geometry">
<mxPoint x="470" y="310.5" as="sourcePoint" />
<mxPoint x="390" y="310" as="targetPoint" />
<Array as="points">
<mxPoint x="440" y="310" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="jeEIYTSbyfxF0RzQu-zD-32" value="&lt;h1&gt;...&lt;/h1&gt;" style="text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="500" y="290" width="60" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
4 changes: 4 additions & 0 deletions media/diagrams/Simple OQM Diagram.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0850c66

Please sign in to comment.