diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b20a9b77462882d491862c22030c90d9ebc3c57..7596c0281eb7e7badb8b3a8788108d21b3d90470 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,8 @@ variables: SLO_SEVERITY_CALCULATOR_CLI: "mvn --batch-mode -f morphemic-slo-severity-calculator/pom.xml" PREDICTON_ORCHESTRATOR_CLI: "mvn --batch-mode -N -f prediction_orchestrator/pom.xml" + DOCKER_FORECAST_ESHYBRID_DOCKER_NAME: 'morphemic_forecasting_eshybird' + cache: paths: - maven_repo/ @@ -245,8 +247,8 @@ deploy:morphemic-forecasting-eshybrid: - $DOCKER_DIND_SERVICE script: - cd morphemic-forecasting-eshybrid - - docker build -t morphemic-forecasting-eshybird . + - docker build -t $DOCKER_FORECAST_ESHYBRID_DOCKER_NAME . - docker image ls - echo "$K8S_SECRET_DOCKER_PASSWORD" | docker login $CI_REGISTRY -u $K8S_SECRET_DOCKER_USER --password-stdin - - docker tag morphemic-forecasting-eshybrid:latest $CI_REGISTRY_IMAGE/morphemic-forecasting-eshybrid:$CI_COMMIT_BRANCH - - docker push $CI_REGISTRY_IMAGE/morphemic-forecasting-eshybrid:$CI_COMMIT_BRANCH + - docker tag $DOCKER_FORECAST_ESHYBRID_DOCKER_NAME:latest $CI_REGISTRY_IMAGE/$DOCKER_FORECAST_ESHYBRID_DOCKER_NAME:$CI_COMMIT_BRANCH + - docker push $CI_REGISTRY_IMAGE/$DOCKER_FORECAST_ESHYBRID_DOCKER_NAME:$CI_COMMIT_BRANCH diff --git a/morphemic-forecasting-eshybrid/forecasting/eshybrid.py b/morphemic-forecasting-eshybrid/forecasting/eshybrid.py index 2d554beb61475342fc1a5cb7e13cb788c0b87517..5b94d3936a91bbe8570636a9357f898a1936ec00 100644 --- a/morphemic-forecasting-eshybrid/forecasting/eshybrid.py +++ b/morphemic-forecasting-eshybrid/forecasting/eshybrid.py @@ -124,7 +124,7 @@ class ESHybrid(morphemic.handler.ModelHandler,messaging.listener.MorphemicListen def on_metrics_to_predict(self,res): - logging.debug("[6] Metrics to predics %s " % res) + logging.debug("[2] Metrics to predics %s " % res) for metric in self.metrics: logging.debug("Un-subscribing from %s " % metric) self.connector.unsubscribe(metric.metric,self.id) @@ -148,7 +148,7 @@ class ESHybrid(morphemic.handler.ModelHandler,messaging.listener.MorphemicListen def on_start_forecasting_eshybrid(self,res): - logging.debug("[6] Start Forecasting %s " % res) + logging.debug("[7] Start Forecasting %s " % res) if not self.metrics: logging.error("Start forecasting before metrics to predict ") diff --git a/morphemic-forecasting-eshybrid/main.py b/morphemic-forecasting-eshybrid/main.py index 99d0136e215ca231624988254270fa4562f0cb9c..dd1e582cadef1a8053d0da91cefe37b85bba583c 100644 --- a/morphemic-forecasting-eshybrid/main.py +++ b/morphemic-forecasting-eshybrid/main.py @@ -1,13 +1,19 @@ import logging import configparser import os +import argparse from forecasting import eshybrid logger = logging.getLogger() logger.setLevel(logging.DEBUG) -config_file = "%s/%s" % (os.getcwd(), "sync.cfg") +parser = argparse.ArgumentParser(description='Run eshybrid forecaster') +parser.add_argument('--config', help='Config file to run, default sync.cfg') + +args = parser.parse_args() + +config_file = "%s/%s" % (os.getcwd(), args.config or "sync.cfg") print("Config file %s ", config_file) config = configparser.RawConfigParser() config.read(config_file) diff --git a/morphemic-forecasting-eshybrid/morphemic/model.py b/morphemic-forecasting-eshybrid/morphemic/model.py index 2562291e0c9bde7b1a0e708772334778b20832e8..ea6a730f641eff155b62677237cdedf1ecbaf21f 100644 --- a/morphemic-forecasting-eshybrid/morphemic/model.py +++ b/morphemic-forecasting-eshybrid/morphemic/model.py @@ -139,5 +139,4 @@ class Model: ret= self._model.model_for_metric(metric).predict(m_pd) - return ret \ No newline at end of file