Skip to content

Commit

Permalink
Create CI task and add missing requirements (sklearn, nltk)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhujiem committed Sep 5, 2023
1 parent c82e548 commit 93d94a6
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 6 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
path:
- 'logparser/*'
- 'tests/*'
pull_request:
path:
- 'logparser/*'
- 'tests/*'

jobs:
build:
runs-on: ubuntu-20.04
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.13, 3.11]

steps:
- uses: actions/checkout@v3

- name: Setup python environment
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}

- name: Install dependencies
run: |
pip install -q deap==1.4.1
pip install -q nltk
pip install -e .
- name: Run test
timeout-minutes: 180
run: |
cd tests
bash test_all.sh
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
<div>
<a href="https://pypi.org/project/logparser3"><img src="https://img.shields.io/badge/python-3.6+-blue" style="max-width: 100%;" alt="Python version"></a>
<a href="https://pypi.org/project/logparser3"><img src="https://img.shields.io/pypi/v/logparser3.svg" style="max-width: 100%;" alt="Pypi version"></a>
<a href="https://github.com/logpai/logparser/actions/workflows/ci.yml"><img src="https://github.com/logpai/logparser/workflows/CI/badge.svg" style="max-width: 100%;" alt="Pypi version"></a>
<a href="https://pepy.tech/project/logparser3"><img src="https://static.pepy.tech/badge/logparser3" style="max-width: 100%;" alt="Downloads"></a>
<a href="https://github.com/logpai/logparser/blob/main/LICENSE"><img src="https://img.shields.io/github/license/logpai/logparser.svg" style="max-width: 100%;" alt="License"></a>
<a href="https://github.com/logpai/logparser#discussion"><img src="https://img.shields.io/badge/chat-wechat-brightgreen?style=flat" style="max-width: 100%;" alt="License"></a>
</div>
<hr/>

Expand Down Expand Up @@ -59,8 +61,13 @@ In particular, the package depends on the following requirements.
+ numpy
+ pandas
+ scipy
+ scikit-learn
+ deap (if using logparser.MoLFI)
+ nltk (if using logparser.SHISO)
+ gcc (if using logparser.SLCT)
+ perl (if using logparser.LogCluster)

Note that regex matching in Python is brittle, so we recommend fixing the regex library to version 2022.3.2.

### Get started

Expand Down
1 change: 1 addition & 0 deletions logparser/LenMa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The code has been tested in the following enviornment:
+ pandas 1.0.1
+ numpy 1.18.1
+ scipy 1.4.1
+ sklearn 0.22.1

Run the following scripts to start the demo:

Expand Down
3 changes: 2 additions & 1 deletion logparser/LenMa/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pandas
regex==2022.3.2
numpy
scipy
scipy
scikit-learn
1 change: 1 addition & 0 deletions logparser/SHISO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The code has been tested in the following enviornment:
+ pandas 1.0.1
+ numpy 1.18.1
+ scipy 1.4.1
+ nltk 3.4.5

Run the following script to start the demo:

Expand Down
3 changes: 2 additions & 1 deletion logparser/SHISO/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pandas
regex==2022.3.2
numpy
scipy
scipy
nltk
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ regex==2022.3.2
numpy
pandas
scipy
scikit-learn
tqdm
nltk
deap
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
version="1.0.0",
author="logpai",
author_email="[email protected]",
description="A machine learning toolkit for log parsing",
description="A machine learning toolkit for log parsing from LOGPAI",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/logpai/logparser",
Expand All @@ -17,7 +17,7 @@
exclude=["tests", "data", "docs", "example"]),
include_package_data=True,
python_requires=">=3.6",
install_requires=["regex==2022.3.2", "numpy", "pandas", "scipy", "tqdm"],
install_requires=["regex==2022.3.2", "numpy", "pandas", "scipy", "tqdm", "scikit-learn"],
classifiers=(
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ echo "=== Testing LenMa ===" && cd $home/LenMa && python demo.py && \
echo "=== Testing LFA ===" && cd $home/LFA && python demo.py && \
echo "=== Testing LKE ===" && cd $home/LKE && python demo.py && \
echo "=== Testing LogCluster ===" && cd $home/LogCluster && python demo.py && \
echo "=== Testing LogMine ===" && cd $home/LogMine && python demo.py && \
echo "=== Testing LogSig ===" && cd $home/LogSig && python demo.py && \
echo "=== Testing MoLFI ===" && cd $home/MoLFI && python demo.py && \
echo "=== Testing SHISO ===" && cd $home/SHISO && python demo.py && \
echo "=== Testing SLCT ===" && cd $home/SLCT && python demo.py && \
echo "=== Testing Spell ===" && cd $home/Spell && python demo.py && \
echo "=== Testing logmatch ===" && cd $home/logmatch && python demo.py

echo "=== Testing logmatch ===" && cd $home/logmatch && python demo.py &&\
echo "All tests succeed!"

0 comments on commit 93d94a6

Please sign in to comment.