<commit_before>.DEFAULT_GOAL := help
SHELL := /bin/bash

DEV_PATH := /usr/local/src

DCOSAR_AR_LOCAL_PATH := $(CURDIR)
DCOSAR_AR_CTR_MOUNT := /usr/local/adminrouter/nginx/conf/

BRIDGE_DEVNAME := $(shell docker network inspect -f '{{ index .Options "com.docker.network.bridge.name" }}' bridge | awk 'NF')
BRIDGE_IP := $(shell docker run --net=host --rm alpine ifconfig $(BRIDGE_DEVNAME) | grep 'inet addr:' | cut -d: -f2 | cut -d' ' -f1)

# FIXME: some problems with dns queries timing out, use hosts caching dns as a
# workaround for now
# DNS_DOCKER_OPTS := --dns=8.8.8.8 --dns=8.8.4.4
DNS_DOCKER_OPTS := --dns=$(BRIDGE_IP) --dns=8.8.8.8 --dns=8.8.4.4
DEVKIT_BASE_DOCKER_OPTS := --name adminrouter-devkit \
	$(DNS_DOCKER_OPTS) \
	-e NUM_CORES=2 \
	-e PYTHONDONTWRITEBYTECODE=true
DEVKIT_DOCKER_OPTS := $(DEVKIT_BASE_DOCKER_OPTS) \
	-v $(DCOSAR_AR_LOCAL_PATH):$(DCOSAR_AR_CTR_MOUNT)

.PHONY: clean-devkit-container
clean-devkit-container:
	-docker rm -vf adminrouter-devkit > /dev/null 2>&1

.PHONY: clean-containers
clean-containers: clean-devkit-container

.PHONY: clean
clean:
	@echo "+ Cleaning up..."
	-sudo find . -type f -name '*.pyc' -delete

.PHONY: devkit
devkit:
	if $$(docker images | grep mesosphere/adminrouter-devkit | grep -q full); then \
		echo "+ Devkit image already build"; \<commit_msg>Add comments describing the docker bridge IP lookup<commit_after>.DEFAULT_GOAL := help
SHELL := /bin/bash

DEV_PATH := /usr/local/src

DCOSAR_AR_LOCAL_PATH := $(CURDIR)
DCOSAR_AR_CTR_MOUNT := /usr/local/adminrouter/nginx/conf/

# Detect the docker network interface bridge name.
BRIDGE_DEVNAME := $(shell docker network inspect -f '{{ index .Options "com.docker.network.bridge.name" }}' bridge | awk 'NF')

# Detect the docker network interface bridge IP.
# Using a docker container for this allows the docker daemon to run locally or remotely in a VM, like docker-machine.
BRIDGE_IP := $(shell docker run --net=host --rm alpine ifconfig $(BRIDGE_DEVNAME) | grep 'inet addr:' | cut -d: -f2 | cut -d' ' -f1)

# FIXME: some problems with dns queries timing out, use hosts caching dns as a
# workaround for now
# DNS_DOCKER_OPTS := --dns=8.8.8.8 --dns=8.8.4.4
DNS_DOCKER_OPTS := --dns=$(BRIDGE_IP) --dns=8.8.8.8 --dns=8.8.4.4
DEVKIT_BASE_DOCKER_OPTS := --name adminrouter-devkit \
	$(DNS_DOCKER_OPTS) \
	-e NUM_CORES=2 \
	-e PYTHONDONTWRITEBYTECODE=true
DEVKIT_DOCKER_OPTS := $(DEVKIT_BASE_DOCKER_OPTS) \
	-v $(DCOSAR_AR_LOCAL_PATH):$(DCOSAR_AR_CTR_MOUNT)

.PHONY: clean-devkit-container
clean-devkit-container:
	-docker rm -vf adminrouter-devkit > /dev/null 2>&1

.PHONY: clean-containers
clean-containers: clean-devkit-container

.PHONY: clean
clean:
	@echo "+ Cleaning up..."
	-sudo find . -type f -name '*.pyc' -delete

.PHONY: devkit
devkit:
	if $$(docker images | grep mesosphere/adminrouter-devkit | grep -q full); then \
		echo "+ Devkit image already build"; \
{'fraction_non_alphanumeric': 0.14469565217391303, 'fraction_numerical': 0.014608695652173913, 'mean_word_length': 4.081272084805653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '7543960', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1138, 'n_words': 279}