Dockerfile 1.8 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
FROM python:3 as source
RUN pip install --upgrade pip

RUN mkdir /src
ADD ./src/ /src/

WORKDIR /src
RUN pip install -r requirements.txt

RUN ls -la

RUN python3 setup.py sdist
RUN ls ./dist/

15
FROM ubuntu:focal
16
RUN mkdir -p /home/r_predictions
Andreas Tsagkaropoulos's avatar
Andreas Tsagkaropoulos committed
17

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
RUN apt-get update
ENV TZ=Europe/Athens
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
build-essential \
r-base-core \
r-base-dev \
r-cran-digest \
r-cran-boot \
r-cran-class \
r-cran-cluster \
r-cran-codetools \
r-cran-foreign \
r-cran-kernsmooth \
r-cran-lattice \
r-cran-littler \
r-cran-mass \
r-cran-matrix \
r-cran-mgcv \
r-cran-nlme \
r-cran-nnet \
r-cran-pkgkitten \
r-cran-rcpp \
r-cran-rpart \
r-cran-spatial \
r-cran-survival \
r-doc-html \
r-recommended \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*


COPY ./src/r_predictors/r_commands.R /home/r_predictions/
RUN Rscript /home/r_predictions/r_commands.R #install prerequisite libraries

56
COPY --from=source ./src/dist/esm_forecaster-0.1.0.tar.gz /home/r_predictions/
57
58
59
60
61
62
63
64
65
66
67
COPY ./src/requirements.txt /home/r_predictions/
COPY ./src/prepare_python_dependencies.sh /home/r_predictions/
RUN bash -x /home/r_predictions/prepare_python_dependencies.sh

COPY ./src/r_predictors/forecasting_real_workload.R /home/r_predictions/

#below two commented lines only serve for experiments with predictive functionality
#COPY ./default_application.csv /home/r_predictions
#RUN Rscript forecasting_real_workload.R default_application.csv MinimumCores 1638878119

WORKDIR /home/r_predictions/esm_forecaster-0.1.0
68

69
CMD ["/bin/sh","-c","python3 -u /home/r_predictions/esm_forecaster-0.1.0/runtime/Predictor.py /home/r_predictions/esm_forecaster-0.1.0/r_predictors/prediction_configuration.properties 2>&1 > $LOG_FILE "]