<commit_before># Before first use on a new machine:
#  sudo make init
# During development when protos/*.proto is updated:
#   make build
# Run controller app:
#   make run

ifeq ($(OS),Windows_NT)
	RequirementsFile := requirements-windows.txt
else
	RequirementsFile := requirements.txt
endif

SRC_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

init:
	python -m pip install --upgrade pip==9.0.1
	pip install -r $(RequirementsFile)
	# For gRPC-web support
	sudo apt-get install nginx

build: proto-py

proto-py:
	cd ./protos && make

install-client:
	sed -e 's,{SRC_DIR},'"$(SRC_DIR)",g -e s/{TYPE}/client/g template.service > /tmp/controller-client.service
	sudo cp /tmp/controller-client.service /etc/systemd/system/controller-client.service
	sudo systemctl enable controller-client.service

install-server:
	sed -e 's,{SRC_DIR},'"$(SRC_DIR)",g -e s/{TYPE}/server/g template.service > /tmp/controller-server.service
	sudo cp /tmp/controller-server.service /etc/systemd/system/controller-server.service
	sudo systemctl enable controller-server.service

run-client: build
	python main.py

run-server: build
	python main.py server<commit_msg>mv instead of cp tmp files to install service<commit_after># Before first use on a new machine:
#  sudo make init
# During development when protos/*.proto is updated:
#   make build
# Run controller app:
#   make run

ifeq ($(OS),Windows_NT)
	RequirementsFile := requirements-windows.txt
else
	RequirementsFile := requirements.txt
endif

SRC_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

init:
	python -m pip install --upgrade pip==9.0.1
	pip install -r $(RequirementsFile)
	# For gRPC-web support
	sudo apt-get install nginx

build: proto-py

proto-py:
	cd ./protos && make

install-client:
	sed -e 's,{SRC_DIR},'"$(SRC_DIR)",g -e s/{TYPE}/client/g template.service > /tmp/controller-client.service
	sudo mv /tmp/controller-client.service /etc/systemd/system/controller-client.service
	sudo systemctl enable controller-client.service

install-server:
	sed -e 's,{SRC_DIR},'"$(SRC_DIR)",g -e s/{TYPE}/server/g template.service > /tmp/controller-server.service
	sudo mv /tmp/controller-server.service /etc/systemd/system/controller-server.service
	sudo systemctl enable controller-server.service

run-client: build
	python main.py

run-server: build
	python main.py server
{'fraction_non_alphanumeric': 0.12702472293265132, 'fraction_numerical': 0.0025575447570332483, 'mean_word_length': 4.522352941176471, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6916713', 'n_tokens_mistral': 777, 'n_tokens_neox': 750, 'n_words': 211}