Skip to content

Commit

Permalink
moving loggers to the new splunk-ready logging support in the spylunk…
Browse files Browse the repository at this point in the history
…ing project
  • Loading branch information
jay-johnson committed Jun 22, 2018
1 parent 9ad5f8c commit 65db951
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 17 deletions.
2 changes: 1 addition & 1 deletion antinex_core/antinex_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import pandas as pd
import antinex_utils.make_predictions
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from antinex_utils.utils import ppj
from antinex_utils.consts import SUCCESS
from antinex_core.send_results_to_broker import send_results_to_broker
Expand Down
2 changes: 1 addition & 1 deletion antinex_core/antinex_worker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from celery import Celery
from celery import signals
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from antinex_utils.utils import ev
from celery_connectors.subscriber import Subscriber
from antinex_core.antinex_processor import AntiNexProcessor
Expand Down
2 changes: 1 addition & 1 deletion antinex_core/scripts/antinex_scaler_django.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
import numpy as np
import pandas as pd
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from antinex_utils.consts import SUCCESS
from antinex_utils.build_scaler_train_and_test_datasets import \
build_scaler_train_and_test_datasets
Expand Down
2 changes: 1 addition & 1 deletion antinex_core/scripts/convert_bottom_rows_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
import argparse
import pandas as pd
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from antinex_utils.utils import ppj


Expand Down
2 changes: 1 addition & 1 deletion antinex_core/scripts/publish_predict_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import argparse
import json
import pandas as pd
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from celery_connectors.publisher import Publisher


Expand Down
2 changes: 1 addition & 1 deletion antinex_core/scripts/publish_regression_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import argparse
import json
import pandas as pd
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from celery_connectors.publisher import Publisher


Expand Down
2 changes: 1 addition & 1 deletion antinex_core/scripts/publish_train_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json
import argparse
import pandas as pd
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from celery_connectors.publisher import Publisher


Expand Down
2 changes: 1 addition & 1 deletion antinex_core/send_results_to_broker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import pandas as pd
from celery import Celery
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from antinex_utils.consts import SUCCESS
from antinex_utils.consts import ERROR
from antinex_utils.consts import FAILED
Expand Down
16 changes: 14 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ RUN echo "" >> /etc/bashrc \
&& echo "alias ut='cd /opt/antinex/utils'" >> /etc/bashrc \
&& echo "alias ad='cd /opt/antinex/antinex-datasets'" >> /etc/bashrc \
&& echo "alias ds='cd /opt/antinex/datasets'" >> /etc/bashrc \
&& echo "alias sp='cd /opt/spylunking'" >> /etc/bashrc \
&& echo "alias vi='/usr/bin/vim'" >> /etc/bashrc

RUN echo "setting up /etc/pip.conf" \
Expand All @@ -92,14 +93,16 @@ RUN echo "cloning repos" \
&& git clone https://github.com/jay-johnson/antinex-utils.git /opt/antinex/utils \
&& git clone https://github.com/jay-johnson/antinex-datasets.git /opt/antinex/antinex-datasets \
&& git clone https://github.com/jay-johnson/network-pipeline-datasets.git /opt/antinex/datasets \
&& git clone https://github.com/jay-johnson/spylunking.git /opt/spylunking \
&& chmod 775 \
/opt/antinex/api \
/opt/antinex/core \
/opt/antinex/client \
/opt/antinex/pipeline \
/opt/antinex/utils \
/opt/antinex/antinex-datasets \
/opt/antinex/datasets
/opt/antinex/datasets \
/opt/spylunking

RUN echo "checking repos in container" \
&& ls -l /opt/antinex/api \
Expand All @@ -108,7 +111,15 @@ RUN echo "checking repos in container" \
&& ls -l /opt/antinex/pipeline \
&& ls -l /opt/antinex/utils \
&& ls -l /opt/antinex/antinex-datasets \
&& ls -l /opt/antinex/datasets
&& ls -l /opt/antinex/datasets \
&& ls -l /opt/spylunking

RUN echo "installing python logger with splunk support" \
&& . /opt/venv/bin/activate \
&& cd /opt/spylunking \
&& pip install --upgrade -e . \
&& cd docs \
&& make html

RUN echo "installing utils" \
&& . /opt/venv/bin/activate \
Expand Down Expand Up @@ -240,6 +251,7 @@ RUN find /opt/antinex/pipeline -type d -exec chmod 777 {} \;
RUN find /opt/antinex/utils -type d -exec chmod 777 {} \;
RUN find /opt/antinex/antinex-datasets -type d -exec chmod 777 {} \;
RUN find /opt/antinex/datasets -type d -exec chmod 777 {} \;
RUN find /opt/spylunking -type d -exec chmod 777 {} \;
RUN find /opt/venv -type d -exec chmod 777 {} \;
RUN find /var/log -type d -exec chmod 777 {} \;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"import sys\n",
"import json\n",
"import pandas as pd\n",
"from antinex_client.log.setup_logging import build_colorized_logger\n",
"from spylunking.log.setup_logging import build_colorized_logger\n",
"from antinex_client.utils import ev\n",
"from antinex_client.utils import ppj\n",
"from antinex_client.ai_client import AIClient\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"import sys\n",
"import json\n",
"import pandas as pd\n",
"from antinex_client.log.setup_logging import build_colorized_logger\n",
"from spylunking.log.setup_logging import build_colorized_logger\n",
"from antinex_client.utils import ev\n",
"from antinex_client.utils import ppj\n",
"from antinex_client.ai_client import AIClient\n",
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def run_tests(self):
"sphinx-autobuild",
"sphinx_bootstrap_theme",
"sphinx_rtd_theme",
"spylunking",
"tox",
"tqdm",
"unittest2",
Expand All @@ -87,7 +88,7 @@ def run_tests(self):
setup(
name="antinex-core",
cmdclass={"test": PyTest},
version="1.0.51",
version="1.0.52",
description=("AntiNex publisher-subscriber core for processing "
"training and prediction requests for deep neural "
"networks to detect network exploits using Keras "
Expand Down
2 changes: 1 addition & 1 deletion tests/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import uuid
import unittest
import pandas as pd
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from celery_connectors.publisher import Publisher


Expand Down
2 changes: 1 addition & 1 deletion tests/mock_make_predictions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from antinex_utils.consts import SUCCESS
from antinex_utils.consts import ERR
from antinex_utils.consts import FAILED
Expand Down
2 changes: 1 addition & 1 deletion tests/test_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from tests.mock_make_predictions import mock_make_predictions_error
from tests.mock_make_predictions import mock_make_predictions_fail
from tests.mock_message import MockMessage
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from antinex_core.antinex_processor import AntiNexProcessor


Expand Down
2 changes: 1 addition & 1 deletion tests/test_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from tests.mock_make_predictions import mock_make_predictions_error
from tests.mock_make_predictions import mock_make_predictions_fail
from tests.mock_message import MockMessage
from antinex_core.log.setup_logging import build_colorized_logger
from spylunking.log.setup_logging import build_colorized_logger
from antinex_core.antinex_processor import AntiNexProcessor


Expand Down

0 comments on commit 65db951

Please sign in to comment.