Skip to content

Commit 503028f

Browse files
committed
update makefile
1 parent d59a593 commit 503028f

File tree

2 files changed

+18
-64
lines changed

2 files changed

+18
-64
lines changed

Makefile

Lines changed: 12 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,85 +4,33 @@ PIP=$(shell which pip3 || echo "pip3")
44

55
# CONDA_EXE must be set before running `make dev` or `rmdev`
66
# export CONDA_EXE=$_CONDA_EXE
7-
CONDA_DEV=posml-dev
7+
CONDA_DEV=netml-dev
88
CONDAROOT=$(shell ${CONDA_EXE} info --base)/bin
99
CONDA_ENV=$(shell ${CONDA_EXE} info --base)/envs/$(CONDA_DEV)/bin
1010

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:
1414
@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
1617
@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:
2320
@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
7423
@echo
7524
test: build
7625
@docker build -t networkml-test -f Dockerfile.test .
7726
@docker run --rm networkml-test
7827
build:
7928
@docker build -t networkml .
8029
install:
81-
$(PIP) install -r requirements.txt
82-
python3 setup.py install
30+
pip3 install .
8331

8432
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
8634
source $(CONDAROOT)/activate $(CONDA_DEV) ; \
8735
$(CONDA_ENV)/pip install --upgrade pip ; \
8836
$(CONDA_ENV)/pip install .

netml-dev.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: netml-dev
2+
channels:
3+
- defaults
4+
dependencies:
5+
- pip=20.0
6+
- python=3.7.6

0 commit comments

Comments
 (0)