Commit 95b72196 authored by Fotis Paraskevopoulos's avatar Fotis Paraskevopoulos
Browse files

Setting python3.9 as default

parent 13f0d022
FROM ubuntu:20.04
ADD https://bootstrap.pypa.io/get-pip.py /tmp/get-pip.py
RUN apt-get update && apt-get install -y \
wget \
python3 \
python3-pip \
wget curl \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt install -y python3.9 python3.9-distutils \
&& python3.9 /tmp/get-pip.py \
&& rm -rf /var/lib/apt/lists/*
COPY . /app
ADD https://gitlab.ow2.org/melodic/morphemic-preprocessor/-/archive/morphemic-rc1.5/morphemic-preprocessor-morphemic-rc1.5.tar.gz /var/lib/morphemic/
......@@ -27,4 +33,4 @@ RUN pip3 install -r requirements.txt \
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["python3", "main.py"]
\ No newline at end of file
CMD ["python3.9", "main.py"]
......@@ -70,7 +70,6 @@ class ESHybrid(morphemic.handler.ModelHandler,messaging.listener.MorphemicListen
def stop(self):
logging.debug("Stopping...")
self._run = False
self.connector.disconnect()
def start(self):
logging.debug("Starting ESHybrid")
......@@ -83,28 +82,31 @@ class ESHybrid(morphemic.handler.ModelHandler,messaging.listener.MorphemicListen
if self.scheduler:
self.scheduler.check(self)
time.sleep(1)
self.connector.disconnect()
def on_schedule(self, times):
for m in self.metrics:
# predictions = self.model.predict(self.application, m, times)
# if not predictions:
# continue
predictions = self.model.predict(
self.application,
m,
times
)
for t in times:
logging.debug("Sending prediction for time %s(%s) " % (datetime.datetime.fromtimestamp(t), t))
self.connector.send_to_topic(
"intermediate_prediction.eshybrid.%s" % m,
{
"metricValue": 12.43,
"metricValue": predictions[t],
"timestamp": int(time.time()),
"probability": 0.98,
"confidence_interval": [float(8),float(15)],
"predictionTime":t,
}
)
# for p in predictions[m['metric']]:
def _train_model(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment