Skip to content
Snippets Groups Projects
Commit 5016cc0b authored by Sören Henning's avatar Sören Henning
Browse files

Fix path and import errors

parent 594b7dd3
No related branches found
No related tags found
1 merge request!231Build custom SLO checker images
Pipeline #6181 failed
...@@ -7,7 +7,9 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt ...@@ -7,7 +7,9 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app COPY ./app /code/app
WORKDIR /code/app
ENV HOST 0.0.0.0 ENV HOST 0.0.0.0
ENV PORT 80 ENV PORT 80
CMD ["sh", "-c", "uvicorn app.main:app --host $HOST --port $PORT"] CMD ["sh", "-c", "uvicorn main:app --host $HOST --port $PORT"]
import unittest import unittest
from .main import app, get_aggr_func, check_result from main import app, get_aggr_func, check_result
import json import json
from fastapi.testclient import TestClient from fastapi.testclient import TestClient
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
fastapi>=0.68.0,<0.69.0 fastapi>=0.68.0,<0.69.0
uvicorn>=0.15.0,<0.16.0 uvicorn>=0.15.0,<0.16.0
#pydantic>=1.8.0,<2.0.0 #pydantic>=1.8.0,<2.0.0
#scikit-learn==0.20.3 #scikit-learn==0.22.2
pandas==1.0.3 pandas==1.0.3
...@@ -7,7 +7,9 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt ...@@ -7,7 +7,9 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app COPY ./app /code/app
WORKDIR /code/app
ENV HOST 0.0.0.0 ENV HOST 0.0.0.0
ENV PORT 80 ENV PORT 80
CMD ["sh", "-c", "uvicorn app.main:app --host $HOST --port $PORT"] CMD ["sh", "-c", "uvicorn main:app --host $HOST --port $PORT"]
from fastapi import FastAPI,Request from fastapi import FastAPI,Request
from .trend_slope_computer import compute import trend_slope_computer as trend_slope_computer
import logging import logging
import os import os
import pandas as pd import pandas as pd
...@@ -33,7 +33,7 @@ def calculate_slope_trend(results, warmup): ...@@ -33,7 +33,7 @@ def calculate_slope_trend(results, warmup):
logger.info("Calculating trend slope with warmup of %s seconds for data frame:\n %s", warmup, df) logger.info("Calculating trend slope with warmup of %s seconds for data frame:\n %s", warmup, df)
try: try:
trend_slope = compute(df, warmup) trend_slope = trend_slope_computer.compute(df, warmup)
except Exception as e: except Exception as e:
err_msg = 'Computing trend slope failed.' err_msg = 'Computing trend slope failed.'
logger.exception(err_msg) logger.exception(err_msg)
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
fastapi>=0.68.0,<0.69.0 fastapi>=0.68.0,<0.69.0
uvicorn>=0.15.0,<0.16.0 uvicorn>=0.15.0,<0.16.0
#pydantic>=1.8.0,<2.0.0 #pydantic>=1.8.0,<2.0.0
scikit-learn==0.20.3 scikit-learn==0.22.2
pandas==1.0.3 pandas==1.0.3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment