@@ -4,85 +4,33 @@ PIP=$(shell which pip3 || echo "pip3")
4
4
5
5
# CONDA_EXE must be set before running `make dev` or `rmdev`
6
6
# export CONDA_EXE=$_CONDA_EXE
7
- CONDA_DEV =posml -dev
7
+ CONDA_DEV =netml -dev
8
8
CONDAROOT =$(shell ${CONDA_EXE} info --base) /bin
9
9
CONDA_ENV =$(shell ${CONDA_EXE} info --base) /envs/$(CONDA_DEV ) /bin
10
10
11
- run : eval_onelayer
12
- help :
13
- @echo " make OPTION (see below for description; requires setting PCAP environment variable) "
11
+ run : predict
12
+ predict : build predict_nobuild
13
+ predict_nobuild :
14
14
@echo
15
- @echo Set the PCAP environment variable to the directory of pcaps or a single pcap file you want to work with
15
+ @echo " Running Predict on PCAP files $( PCAP) "
16
+ @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " networkml /pcaps
16
17
@echo
17
- @echo " eval_[onelayer|randomforest|sos] Runs a directory of pcap files against specified model"
18
- @echo " test_[onelayer|randomforest] Tests directory of pcaps against specified model"
19
- @echo " train_[onelayer|randomforest|sos] Trains directory of pcaps against specified model"
20
- @echo " install Installs the python library"
21
- @echo " run Equivalent to eval_onelayer"
22
- @echo " test Run the code tests"
18
+ train : build train_nobuild
19
+ train_nobuild :
23
20
@echo
24
- @echo " DEV/STANDALONE OPTIONS:"
25
- @echo " dev Uses conda to create a contained python development environment"
26
- @echo " rmdev Removes the conda development environment"
27
- eval_onelayer : build eval_onelayer_nobuild
28
- eval_onelayer_nobuild :
29
- @echo
30
- @echo " Running OneLayer Eval on PCAP files $( PCAP) "
31
- @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -e POSEIDON_PUBLIC_SESSIONS=1 -e LOG_LEVEL=$(LOG_LEVEL ) networkml
32
- @echo
33
- test_onelayer : build test_onelayer_nobuild
34
- test_onelayer_nobuild :
35
- @echo
36
- @echo " Running OneLayer Test on PCAP files $( PCAP) "
37
- @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -v " $( PWD) /networkml/trained_models:/networkml/networkml/trained_models" -e POSEIDON_PUBLIC_SESSIONS=1 -e LOG_LEVEL=$(LOG_LEVEL ) networkml -o test -w networkml/trained_models/onelayer/test_onelayer.json
38
- @echo
39
- train_onelayer : build train_onelayer_nobuild
40
- train_onelayer_nobuild :
41
- @echo
42
- @echo " Running OneLayer Train on PCAP files $( PCAP) "
43
- @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -v " $( PWD) /networkml/trained_models:/networkml/networkml/trained_models" -e POSEIDON_PUBLIC_SESSIONS=1 -e LOG_LEVEL=$(LOG_LEVEL ) networkml -o train
44
- @echo
45
- eval_randomforest : build eval_randomforest_nobuild
46
- eval_randomforest_nobuild :
47
- @echo
48
- @echo " Running RandomForest Eval on PCAP files $( PCAP) "
49
- @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -e POSEIDON_PUBLIC_SESSIONS=1 -e LOG_LEVEL=$(LOG_LEVEL ) networkml -a randomforest -m networkml/trained_models/randomforest/RandomForestModel.pkl -w networkml/trained_models/randomforest/RandomForestModel.pkl
50
- @echo
51
- test_randomforest : build test_randomforest_nobuild
52
- test_randomforest_nobuild :
53
- @echo
54
- @echo " Running RandomForest Test on PCAP files $( PCAP) "
55
- @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -e POSEIDON_PUBLIC_SESSIONS=1 -e LOG_LEVEL=$(LOG_LEVEL ) networkml -o test -a randomforest -m networkml/trained_models/randomforest/RandomForestModel.pkl -w networkml/trained_models/randomforest/RandomForestModel.pkl
56
- @echo
57
- train_randomforest : build train_randomforest_nobuild
58
- train_randomforest_nobuild :
59
- @echo
60
- @echo " Running RandomForest Train on PCAP files $( PCAP) "
61
- @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -v " $( PWD) /networkml/trained_models:/networkml/networkml/trained_models" -e POSEIDON_PUBLIC_SESSIONS=1 -e LOG_LEVEL=$(LOG_LEVEL ) networkml -o train -a randomforest -m networkml/trained_models/randomforest/RandomForestModel.pkl -w networkml/trained_models/randomforest/RandomForestModel.pkl
62
- @echo
63
- eval_sos : build eval_sos_nobuild
64
- eval_sos_nobuild :
65
- @echo
66
- @echo " Running SoSModel Eval on PCAP files $( PCAP) "
67
- @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -e POSEIDON_PUBLIC_SESSIONS=1 -e LOG_LEVEL=$(LOG_LEVEL ) networkml -a sos
68
- @echo
69
- train_sos : build train_sos_nobuild
70
- train_sos_nobuild :
71
- @echo
72
- @echo " Running SoSModel Train on PCAP files $( PCAP) "
73
- @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -v " $( PWD) /networkml/trained_models:/networkml/networkml/trained_models" -e POSEIDON_PUBLIC_SESSIONS=1 -e LOG_LEVEL=$(LOG_LEVEL ) networkml -o train -a sos -m networkml/trained_models/sos/SoSmodel -w networkml/trained_models/sos/SoSmodel.pkl
21
+ @echo " Running Train on PCAP files $( PCAP) "
22
+ @docker run -it --rm -v " $( PCAP) :/pcaps$( PCAP) " -v " $( PWD) /networkml/trained_models:/usr/lib/python3.7/site-packages/networkml/networkml/trained_models" networkml -O train /pcaps
74
23
@echo
75
24
test : build
76
25
@docker build -t networkml-test -f Dockerfile.test .
77
26
@docker run --rm networkml-test
78
27
build :
79
28
@docker build -t networkml .
80
29
install :
81
- $(PIP ) install -r requirements.txt
82
- python3 setup.py install
30
+ pip3 install .
83
31
84
32
dev :
85
- ${CONDA_EXE} env create --force -f $(CONDA_DEV ) .yml python=3.6
33
+ ${CONDA_EXE} env create --force -f $(CONDA_DEV ) .yml python=3.7
86
34
source $(CONDAROOT ) /activate $(CONDA_DEV ) ; \
87
35
$(CONDA_ENV ) /pip install --upgrade pip ; \
88
36
$(CONDA_ENV ) /pip install .
0 commit comments