Skip to content

Commit 1ae72df

Browse files
Better project and target structure; bump version: 0.1.5
1 parent 2d848fa commit 1ae72df

File tree

10 files changed

+24
-31
lines changed

10 files changed

+24
-31
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ jobs:
3434
- name: Build package
3535
run: python -m build
3636

37-
- name: Create additional assets archive
38-
run: |
39-
mkdir -p release_files/conf
40-
cp conf/*.dist release_files/conf/
41-
cd release_files
42-
zip -r ../additional_assets.zip .
43-
cd ..
44-
4537
- name: Get version from tag
4638
id: get_version
4739
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
@@ -56,4 +48,3 @@ jobs:
5648
files: |
5749
dist/*.whl
5850
dist/*.tar.gz
59-
additional_assets.zip

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# Keep .idea/modules.xml
1515

1616
venv/
17-
platform_problem_monitoring_core.conf
18-
conf/lucene_query.json
17+
main.conf
18+
etc/lucene_query.json
1919

2020
# Python package build artifacts
2121
*.egg-info/

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ This tool is ideal if:
5959

6060
4. **Create a configuration file:**
6161
```bash
62-
cp src/platform_problem_monitoring_core.conf.dist platform_problem_monitoring_core.conf
62+
cp etc/main.conf.dist /etc/main.conf
6363
```
6464

6565
5. **Edit the configuration:**
@@ -83,7 +83,7 @@ This tool is ideal if:
8383

8484
6. **Set up the Elasticsearch query:**
8585
```bash
86-
cp src/lucene_query.json.dist lucene_query.json
86+
cp etc/lucene_query.json.dist etc/lucene_query.json
8787
```
8888

8989
This default query looks for error messages while filtering out noise:
@@ -111,7 +111,7 @@ This tool is ideal if:
111111

112112
7. **Run the tool:**
113113
```bash
114-
./src/run.sh ./platform_problem_monitoring_core.conf
114+
./bin/ppmc ./main.conf
115115
```
116116

117117
## How It Works
@@ -178,7 +178,7 @@ To run the tool periodically, set up a cron job:
178178

179179
```bash
180180
# Run every 6 hours
181-
0 */6 * * * cd /path/to/platform-problem-monitoring-core && ./src/run.sh ./platform_problem_monitoring_core.conf >> /var/log/platform-monitoring.log 2>&1
181+
0 */6 * * * cd /path/to/platform-problem-monitoring-core && ./src/ppmc ./main.conf >> /var/log/platform-monitoring.log 2>&1
182182
```
183183

184184
## Advanced Configuration

src/platform_problem_monitoring_core/bin/run.sh renamed to bin/ppmc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
23
# Platform Problem Monitoring Core - Main execution script
34

45
set -e # Exit immediately if a command exits with a non-zero status

docs/NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@
1818
}
1919
}
2020
'
21+
22+
## TODOs & Ideas
23+
24+
- add step 12 (cleanup) to ppmc
25+
- add ppmc option to disable cleanup step 12

docs/RELEASE_MANAGEMENT.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ This document outlines the release process for the Platform Problem Monitoring C
66

77
Each release includes the following artifacts:
88

9-
1. **Python Package Distributions**
10-
- **Source Distribution (.tar.gz)** - Contains the raw source code of the package
11-
- **Wheel Distribution (.whl)** - A pre-built package that's ready to install
12-
13-
2. **Additional Assets Archive (`additional_assets.zip`)**
14-
- `conf/lucene_query.json.dist` - Query template for Elasticsearch
15-
- `conf/platform_problem_monitoring_core.conf.dist` - Main configuration file template
9+
- **Source Distribution (.tar.gz)** - Contains the raw source code of the package
10+
- **Wheel Distribution (.whl)** - A pre-built package that's ready to install
1611

1712
## Release Workflow
1813

docs/REQUIREMENTS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The tech stack for this application is defined as follows:
8888
- It is a software application written in Python 3, and provided in source-code form
8989
- Setup and dependencies are managed via the pyproject.toml approach
9090
- A bash shell script is provided which allows the user to start the application in a straightforward manner, e.g.
91-
./run.sh <path-to-config-file>
91+
./ppmc <path-to-config-file>
9292

9393
The architecture is defined as follows:
9494

@@ -291,7 +291,7 @@ Main operations & side effects, and Outputs:
291291
- remove the local folder
292292
- Outputs: none (besides exit code and progress, success, and error messages)
293293

294-
The aforementioned run.sh shell script is able to read a configuration file with the following structure:
294+
The aforementioned ppmc shell script is able to read a configuration file with the following structure:
295295

296296
REMOTE_STATE_S3_BUCKET_NAME=""
297297
REMOTE_STATE_S3_FOLDER_NAME=""
@@ -309,12 +309,12 @@ The aforementioned run.sh shell script is able to read a configuration file with
309309
SMTP_SENDER_ADDRESS=""
310310
SMTP_RECEIVER_ADDRESS=""
311311

312-
If this configuration is stored in a file called platform_problem_monitoring_core.conf, then the run.sh script can be
313-
called as `run.sh ./platform_problem_monitoring_core.conf` and will make use of these parameters when executing the
312+
If this configuration is stored in a file called main.conf, then the ppmc script can be
313+
called as `ppmc ./main.conf` and will make use of these parameters when executing the
314314
different step scripts.
315315

316316
Other parameters that are relevant between step script executions, like for example the name of the JSON file where
317-
downloaded logstash documents are stored, are hardcoded within the run.sh shell script (but paths of intermediate result
317+
downloaded logstash documents are stored, are hardcoded within the ppmc shell script (but paths of intermediate result
318318
files are of course located within the temporary work folder created in step 1).
319319

320320
The resulting Python and Bash code must be clean, well documented, with concise and comprehensible naming.
File renamed without changes.
File renamed without changes.

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "platform_problem_monitoring_core"
7-
version = "0.1.4"
7+
version = "0.1.5"
88
description = "A tool for monitoring platform problems using Elasticsearch logs"
99
authors = [
1010
{name = "Platform Team"}
@@ -44,11 +44,12 @@ package-dir = {"" = "src"}
4444

4545
# Add package data to include resources in the wheel
4646
[tool.setuptools.package-data]
47-
platform_problem_monitoring_core = ["resources/*.html", "bin/*"]
47+
platform_problem_monitoring_core = ["resources/*.html"]
4848

4949
# Add data files to include configuration templates
5050
[tool.setuptools.data-files]
51-
"conf" = ["conf/*.dist"]
51+
"etc/platform_problem_monitoring_core" = ["etc/*.dist"]
52+
"bin" = ["bin/*"]
5253

5354
[tool.black]
5455
line-length = 120

0 commit comments

Comments
 (0)