Skip to content

Commit

Permalink
refactored images to use the base images
Browse files Browse the repository at this point in the history
  • Loading branch information
attila-balint-kul committed Dec 7, 2023
1 parent 57e0a43 commit 51fbf02
Show file tree
Hide file tree
Showing 29 changed files with 26 additions and 97 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data/
docs/
venv/
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ docs-build:

.PHONY: build
## Build source distribution and wheel
build: style
build:
hatch build

.PHONY: publish
Expand All @@ -93,6 +93,13 @@ MODEL_NAME := sf-naive
IMAGE_TAG := $(ENFOBENCH_VERSION)-$(MODEL_NAME)
DEFAULT_PORT := 3000

.PHONY: base-images
## Create docker base image
base-images:
docker build --build-arg DARTS_VERSION=0.27.0 -t $(DOCKER_HUB_REPOSITORY):base-u8darts-0.27.0 ./docker/base/darts
docker build --build-arg SKTIME_VERSION=0.24.1 -t $(DOCKER_HUB_REPOSITORY):base-sktime-0.24.1 ./docker/base/sktime
docker build --build-arg STATSFORECAST_VERSION=1.5.0 -t $(DOCKER_HUB_REPOSITORY):base-statsforecast-1.5.0 ./docker/base/statsforecast

.PHONY: image
## Create docker image
image:
Expand Down
7 changes: 1 addition & 6 deletions models/dt-daily-naive/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-u8darts-0.27.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

EXPOSE 3000
Expand Down
1 change: 0 additions & 1 deletion models/dt-daily-naive/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
u8darts==0.27.0
7 changes: 1 addition & 6 deletions models/dt-four-theta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-u8darts-0.27.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

ENV ENFOBENCH_MODEL_SEASONALITY="1D"
Expand Down
1 change: 0 additions & 1 deletion models/dt-four-theta/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
u8darts==0.27.0
7 changes: 1 addition & 6 deletions models/dt-lightgbm-direct/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-u8darts-0.27.0

# OpenMP is required by LightGBM
RUN apt-get update && \
Expand All @@ -7,13 +7,8 @@ RUN apt-get update && \
WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

ENV ENFOBENCH_MODEL_SEASONALITY="1D"
Expand Down
7 changes: 1 addition & 6 deletions models/dt-linear-regression/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-u8darts-0.27.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

ENV ENFOBENCH_MODEL_SEASONALITY="1D"
Expand Down
1 change: 0 additions & 1 deletion models/dt-linear-regression/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
u8darts==0.27.0
7 changes: 1 addition & 6 deletions models/dt-naive-mean/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-u8darts-0.27.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

EXPOSE 3000
Expand Down
1 change: 0 additions & 1 deletion models/dt-naive-mean/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
u8darts==0.27.0
7 changes: 1 addition & 6 deletions models/dt-theta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-u8darts-0.27.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

EXPOSE 3000
Expand Down
1 change: 0 additions & 1 deletion models/dt-theta/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
u8darts==0.27.0
7 changes: 1 addition & 6 deletions models/sf-auto-ces/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-statsforecast-1.5.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

ENV ENFOBENCH_MODEL_SEASONALITY="1D"
Expand Down
1 change: 0 additions & 1 deletion models/sf-auto-ces/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
statsforecast==1.5.0
7 changes: 1 addition & 6 deletions models/sf-historic-average/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-statsforecast-1.5.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

EXPOSE 3000
Expand Down
1 change: 0 additions & 1 deletion models/sf-historic-average/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
statsforecast==1.5.0
7 changes: 1 addition & 6 deletions models/sf-mstl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-statsforecast-1.5.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

EXPOSE 3000
Expand Down
1 change: 0 additions & 1 deletion models/sf-mstl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
statsforecast==1.5.0
7 changes: 1 addition & 6 deletions models/sf-naive-seasonal-avg/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-statsforecast-1.5.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

ENV ENFOBENCH_MODEL_SEASONALITY="1D"
Expand Down
1 change: 0 additions & 1 deletion models/sf-naive-seasonal-avg/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
statsforecast==1.5.0
7 changes: 1 addition & 6 deletions models/sf-naive-seasonal/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-statsforecast-1.5.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

ENV ENFOBENCH_MODEL_SEASONALITY="1D"
Expand Down
1 change: 0 additions & 1 deletion models/sf-naive-seasonal/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
statsforecast==1.5.0
7 changes: 1 addition & 6 deletions models/sf-naive/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-statsforecast-1.5.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

EXPOSE 3000
Expand Down
1 change: 0 additions & 1 deletion models/sf-naive/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
statsforecast==1.5.0
7 changes: 1 addition & 6 deletions models/sf-seasonal-es/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-statsforecast-1.5.0

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu

COPY ./src /usr/local/app/src

ENV ENFOBENCH_MODEL_SEASONALITY="1D"
Expand Down
1 change: 0 additions & 1 deletion models/sf-seasonal-es/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
statsforecast==1.5.0
7 changes: 2 additions & 5 deletions models/st-naive-mean/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
FROM python:3.11.6-slim-bookworm
FROM attilabalint/enfobench-demand-models:base-sktime-0.24.1

WORKDIR /usr/local/app

COPY ./requirements.txt /usr/local/app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r /usr/local/app/requirements.txt

# Polars requires AVX2 CPU instructions, which are not available on the server
RUN pip uninstall -y polars
RUN pip install --no-cache-dir polars-lts-cpu
COPY ./src /usr/local/app/src

COPY ./src /usr/local/app/src

Expand Down
1 change: 0 additions & 1 deletion models/st-naive-mean/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enfobench>=0.4.0,<0.5.0
sktime==0.24.1

0 comments on commit 51fbf02

Please sign in to comment.