From 79cc3e7f2aadba61d0ddf77bf08b29265b0d2943 Mon Sep 17 00:00:00 2001 From: andhreljaKern Date: Tue, 23 Jul 2024 09:54:55 +0200 Subject: [PATCH 1/3] ci: add arm64 Dockerfiles (sudachipy) --- Dockerfile.arm64 | 19 +++++++++++++++++++ dev.Dockerfile.arm64 | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile.arm64 create mode 100644 dev.Dockerfile.arm64 diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 new file mode 100644 index 0000000..286f6cf --- /dev/null +++ b/Dockerfile.arm64 @@ -0,0 +1,19 @@ +FROM kernai/refinery-parent-images:v1.17.2-common + +WORKDIR /program + +RUN apt update \ + && apt install curl build-essential -y \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y + +ENV PATH="/root/.cargo/bin:${PATH}" + +COPY requirements.txt . + +RUN pip3 install --no-cache-dir -r requirements.txt +RUN python -m spacy download en_core_web_sm +RUN python -m spacy download de_core_news_sm + +COPY / . + +CMD [ "/usr/local/bin/uvicorn", "--host", "0.0.0.0", "--port", "80", "app:app" ] \ No newline at end of file diff --git a/dev.Dockerfile.arm64 b/dev.Dockerfile.arm64 new file mode 100644 index 0000000..ae92597 --- /dev/null +++ b/dev.Dockerfile.arm64 @@ -0,0 +1,21 @@ +FROM kernai/refinery-parent-images:v1.17.2-common + +WORKDIR /app + +VOLUME ["/app"] + +RUN apt update \ + && apt install curl build-essential -y \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y + +ENV PATH="/root/.cargo/bin:${PATH}" + +COPY requirements*.txt . + +RUN pip3 install --no-cache-dir -r requirements-dev.txt +RUN python -m spacy download en_core_web_sm +RUN python -m spacy download de_core_news_sm + +COPY / . + +CMD [ "/usr/local/bin/uvicorn", "--host", "0.0.0.0", "--port", "80", "app:app", "--reload" ] \ No newline at end of file From 9d3b983eb548ba4f63d6b9ba7652fcee30b0aa73 Mon Sep 17 00:00:00 2001 From: andhreljaKern Date: Tue, 23 Jul 2024 09:59:29 +0200 Subject: [PATCH 2/3] perf: add Dockerfile.arm64 support to Drone --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index 49d1814..b3870f3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -80,6 +80,7 @@ steps: image: plugins/docker settings: registry: registry.dev.kern.ai + dockerfile: Dockerfile.arm64 username: from_secret: docker_username password: @@ -144,6 +145,7 @@ steps: - name: build and publish image: plugins/docker settings: + dockerfile: Dockerfile.arm64 username: from_secret: dockerhub_username password: From 8a2644e902862fc2e61218b11942b64e5c63ce05 Mon Sep 17 00:00:00 2001 From: andhreljaKern Date: Tue, 23 Jul 2024 13:06:19 +0200 Subject: [PATCH 3/3] ci: align to Dockerfile japanese language support --- .drone.yml | 2 -- Dockerfile | 6 ++++++ Dockerfile.arm64 | 19 ------------------- dev.Dockerfile | 6 ++++++ dev.Dockerfile.arm64 | 21 --------------------- 5 files changed, 12 insertions(+), 42 deletions(-) delete mode 100644 Dockerfile.arm64 delete mode 100644 dev.Dockerfile.arm64 diff --git a/.drone.yml b/.drone.yml index b3870f3..49d1814 100644 --- a/.drone.yml +++ b/.drone.yml @@ -80,7 +80,6 @@ steps: image: plugins/docker settings: registry: registry.dev.kern.ai - dockerfile: Dockerfile.arm64 username: from_secret: docker_username password: @@ -145,7 +144,6 @@ steps: - name: build and publish image: plugins/docker settings: - dockerfile: Dockerfile.arm64 username: from_secret: dockerhub_username password: diff --git a/Dockerfile b/Dockerfile index ed66ef5..b12e90c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,12 @@ FROM kernai/refinery-parent-images:v1.17.2-common WORKDIR /program +RUN apt-get update && apt-get install -y curl libc6-dev zlib1g gcc --no-install-recommends + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + +ENV PATH="/root/.cargo/bin:${PATH}" + COPY requirements.txt . RUN pip3 install --no-cache-dir -r requirements.txt diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 deleted file mode 100644 index 286f6cf..0000000 --- a/Dockerfile.arm64 +++ /dev/null @@ -1,19 +0,0 @@ -FROM kernai/refinery-parent-images:v1.17.2-common - -WORKDIR /program - -RUN apt update \ - && apt install curl build-essential -y \ - && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y - -ENV PATH="/root/.cargo/bin:${PATH}" - -COPY requirements.txt . - -RUN pip3 install --no-cache-dir -r requirements.txt -RUN python -m spacy download en_core_web_sm -RUN python -m spacy download de_core_news_sm - -COPY / . - -CMD [ "/usr/local/bin/uvicorn", "--host", "0.0.0.0", "--port", "80", "app:app" ] \ No newline at end of file diff --git a/dev.Dockerfile b/dev.Dockerfile index 1f65aa8..503f50a 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -4,6 +4,12 @@ WORKDIR /app VOLUME ["/app"] +RUN apt-get update && apt-get install -y curl libc6-dev zlib1g gcc --no-install-recommends + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + +ENV PATH="/root/.cargo/bin:${PATH}" + COPY requirements*.txt . RUN pip3 install --no-cache-dir -r requirements-dev.txt diff --git a/dev.Dockerfile.arm64 b/dev.Dockerfile.arm64 deleted file mode 100644 index ae92597..0000000 --- a/dev.Dockerfile.arm64 +++ /dev/null @@ -1,21 +0,0 @@ -FROM kernai/refinery-parent-images:v1.17.2-common - -WORKDIR /app - -VOLUME ["/app"] - -RUN apt update \ - && apt install curl build-essential -y \ - && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y - -ENV PATH="/root/.cargo/bin:${PATH}" - -COPY requirements*.txt . - -RUN pip3 install --no-cache-dir -r requirements-dev.txt -RUN python -m spacy download en_core_web_sm -RUN python -m spacy download de_core_news_sm - -COPY / . - -CMD [ "/usr/local/bin/uvicorn", "--host", "0.0.0.0", "--port", "80", "app:app", "--reload" ] \ No newline at end of file