-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from fukuda-lab/improvement/prepare-for-open-so…
…urcing Prepare for open sourcing.
- Loading branch information
Showing
78 changed files
with
5,264 additions
and
1,496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
|
||
# Set path variables. | ||
repo_root="$(realpath $(dirname $BASH_SOURCE[0])/..)" | ||
conf_path="$repo_root/configurations/examples" | ||
|
||
# Move to repository root to make sure all subsequent commands | ||
# run from the right directory. | ||
cd "$repo_root" | ||
|
||
# Run all training examples sequentially. | ||
counter=1 | ||
for p in $(ls $conf_path/train); do | ||
echo "-----------------------------------------------" | ||
echo "$counter: running example configuration from $p" | ||
echo "-----------------------------------------------" | ||
((++counter)) | ||
|
||
python3 code/IoT-AD.py -c "$conf_path/train/$p" || \ | ||
{ echo "Error while running $conf_path/train/$p"; exit 1; } | ||
done | ||
|
||
# Run all test examples sequentially. | ||
counter=1 | ||
for p in $(ls $conf_path/test); do | ||
echo "-----------------------------------------------" | ||
echo "$counter: running example configuration from $p" | ||
echo "-----------------------------------------------" | ||
((++counter)) | ||
|
||
python3 code/IoT-AD.py -c "$conf_path/test/$p" || \ | ||
{ echo "Error while running $conf_path/test/$p"; exit 1; } | ||
done | ||
|
||
echo "---------" | ||
echo "Finished!" | ||
echo "---------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
|
||
# Set path variables. | ||
repo_root="$(realpath $(dirname $BASH_SOURCE[0])/..)" | ||
conf_path="$repo_root/configurations/examples" | ||
|
||
# Move to repository root to make sure all subsequent commands | ||
# run from the right directory. | ||
cd "$repo_root" | ||
|
||
# Run all training examples sequentially. | ||
counter=1 | ||
for p in $(ls $conf_path/train); do | ||
echo "-----------------------------------------------" | ||
echo "$counter: running example configuration from $p" | ||
echo "-----------------------------------------------" | ||
((++counter)) | ||
|
||
python3 code/IoT-AD.py -c "$conf_path/train/$p" & | ||
done | ||
|
||
wait | ||
|
||
# Run all test examples sequentially. | ||
counter=1 | ||
for p in $(ls $conf_path/test); do | ||
echo "-----------------------------------------------" | ||
echo "$counter: running example configuration from $p" & | ||
echo "-----------------------------------------------" | ||
((++counter)) | ||
|
||
python3 code/IoT-AD.py -c "$conf_path/test/$p" | ||
done | ||
|
||
wait | ||
|
||
echo "---------" | ||
echo "Finished!" | ||
echo "---------" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Set up SIURU and run sample configurations | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Initialize submodules | ||
run: git submodule update --init --recursive | ||
- name: Install Ubuntu dependencies | ||
run: sudo apt install libpcap-dev | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r code/requirements.txt | ||
- name: Build and install PcapPlusPlus | ||
run: | | ||
cd code/cpp-extract-features/PcapPlusPlus | ||
cmake -S . -B cmake-build | ||
cmake --build cmake-build --config Release | ||
sudo cmake --install cmake-build | ||
- name: Build feature extractor | ||
run: | | ||
cd code/cpp-extract-features | ||
mkdir cmake-build && cd cmake-build | ||
cmake ../.. | ||
cmake --build . --config Release | ||
sudo setcap cap_net_raw+ep $(pwd)/pcap-feature-extraction | ||
- name: Build and test sample configurations | ||
run: ./.ci/run_sample_configurations.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/code/cpp-extract-features/cmake-build/ | ||
/code/cpp-extract-features/PcapPlusPlus/cmake-build/ | ||
/data/ | ||
!/data/README.md | ||
!/data/MQTTset-reduced/ | ||
/influxdb/ | ||
/logs/ | ||
/models/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "code/cpp-extract-features/PcapPlusPlus"] | ||
path = code/cpp-extract-features/PcapPlusPlus | ||
url = [email protected]:seladb/PcapPlusPlus.git | ||
url = https://github.com/seladb/PcapPlusPlus.git | ||
[submodule "data/MQTTset-reduced"] | ||
path = data/MQTTset-reduced | ||
url = https://github.com/l-laura/MQTTset-reduced |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Copyright © 2023 Laura Lahesoo | ||
Copyright © 2023 Fukuda-lab, National Institute of Informatics, Japan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.