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

Define custom image

parent f551c8d8
No related branches found
No related tags found
1 merge request!231Build custom SLO checker images
Pipeline #6178 failed
This commit is part of merge request !230. Comments created here will be created in the context of that merge request.
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
FROM python:3.8
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
WORKDIR /code
COPY ./app /app
\ No newline at end of file
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app
ENV HOST 0.0.0.0
ENV PORT 80
CMD ["sh", "-c", "uvicorn app.main:app --host $HOST --port $PORT"]
from fastapi import FastAPI,Request
import trend_slope_computer as trend_slope_computer
from .trend_slope_computer import compute
import logging
import os
import pandas as pd
......@@ -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)
try:
trend_slope = trend_slope_computer.compute(df, warmup)
trend_slope = compute(df, warmup)
except Exception as e:
err_msg = 'Computing trend slope failed.'
logger.exception(err_msg)
......
fastapi==0.65.2
#requests
fastapi>=0.68.0,<0.69.0
uvicorn>=0.15.0,<0.16.0
#pydantic>=1.8.0,<2.0.0
scikit-learn==0.20.3
pandas==1.0.3
uvicorn
requests
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment