-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
140 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
__pycache__ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM centos:7.9.2009 AS base | ||
|
||
# install base packages | ||
RUN yum -y install glibc-langpack-en glibc-langpack-ko python3 python3-pip | ||
RUN pip3 install --upgrade pip wheel | ||
|
||
# branch to build khaiii | ||
FROM base AS build | ||
RUN yum -y groupinstall "Development Tools" && \ | ||
yum -y install centos-release-scl && \ | ||
yum -y install devtoolset-7 | ||
RUN pip3 install cmake | ||
COPY . /khaiii | ||
WORKDIR /khaiii/build | ||
RUN source /opt/rh/devtoolset-7/enable && \ | ||
cmake .. && \ | ||
make -j && \ | ||
make resource && \ | ||
test/khaiii && \ | ||
make install && \ | ||
make package_python | ||
WORKDIR /khaiii/build/package_python | ||
RUN source /opt/rh/devtoolset-7/enable && \ | ||
pip3 install . | ||
|
||
# branch to run khaiii | ||
FROM base AS runtime | ||
COPY --from=build /usr/local/bin/khaiii /usr/local/bin/ | ||
COPY --from=build /usr/local/lib/libkhaiii.* /usr/local/lib/ | ||
COPY --from=build /usr/local/share/khaiii/ /usr/local/share/khaiii/ | ||
COPY --from=build /usr/local/include/khaiii/ /usr/local/include/khaiii/ | ||
|
||
ENV PYTHON_VER=3.6 | ||
ARG KHAIII_VER | ||
RUN echo "KHAIII_VER: ${KHAIII_VER}" | ||
RUN if [ "${KHAIII_VER}" = "" ]; then echo "build argument KHAIII_VER is not provided" && exit 1; fi | ||
COPY --from=build /usr/local/lib/python${PYTHON_VER}/site-packages/khaiii/ /usr/local/lib/python${PYTHON_VER}/site-packages/khaiii/ | ||
COPY --from=build /usr/local/lib/python${PYTHON_VER}/site-packages/khaiii-${KHAIII_VER}.dist-info/ /usr/local/lib/python${PYTHON_VER}/site-packages/khaiii-${KHAIII_VER}.dist-info/ | ||
|
||
ENV LANG=en_US.UTF-8 | ||
WORKDIR / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM centos:8.3.2011 AS base | ||
|
||
# install base packages | ||
RUN yum -y install glibc-langpack-en glibc-langpack-ko python3 python3-pip | ||
RUN pip3 install --upgrade pip wheel | ||
|
||
# branch to build khaiii | ||
FROM base AS build | ||
RUN yum -y groupinstall "Development Tools" | ||
RUN pip3 install cmake | ||
COPY . /khaiii | ||
WORKDIR /khaiii/build | ||
RUN cmake .. && \ | ||
make -j && \ | ||
make resource && \ | ||
test/khaiii && \ | ||
make install && \ | ||
make package_python | ||
WORKDIR /khaiii/build/package_python | ||
RUN pip3 install . | ||
|
||
# branch to run khaiii | ||
FROM base AS runtime | ||
COPY --from=build /usr/local/bin/khaiii /usr/local/bin/ | ||
COPY --from=build /usr/local/lib/libkhaiii.* /usr/local/lib/ | ||
COPY --from=build /usr/local/share/khaiii/ /usr/local/share/khaiii/ | ||
COPY --from=build /usr/local/include/khaiii/ /usr/local/include/khaiii/ | ||
|
||
ENV PYTHON_VER=3.6 | ||
ARG KHAIII_VER | ||
RUN echo "KHAIII_VER: ${KHAIII_VER}" | ||
RUN if [ "${KHAIII_VER}" = "" ]; then echo "build argument KHAIII_VER is not provided" && exit 1; fi | ||
COPY --from=build /usr/local/lib/python${PYTHON_VER}/site-packages/khaiii/ /usr/local/lib/python${PYTHON_VER}/site-packages/khaiii/ | ||
COPY --from=build /usr/local/lib/python${PYTHON_VER}/site-packages/khaiii-${KHAIII_VER}.dist-info/ /usr/local/lib/python${PYTHON_VER}/site-packages/khaiii-${KHAIII_VER}.dist-info/ | ||
|
||
ENV LANG=ko_KR.UTF-8 | ||
WORKDIR / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM pytorch/pytorch:1.7.0-cuda11.0-cudnn8-runtime | ||
|
||
RUN pip install tensorboardX tqdm | ||
COPY . /khaiii | ||
WORKDIR /khaiii/train | ||
ENV PYTHONPATH=/khaiii/src/main/python | ||
RUN python split_corpus.py --input corpus/sample.txt --out-pfx corpus/sample --dev 4 --test 4 | ||
RUN python train.py --in-pfx corpus/sample --batch-size 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
ARG UBUNTU_VER="18.04" | ||
FROM ubuntu:${UBUNTU_VER} AS base | ||
# supported ubuntu versions are 20.04, 18.04 and 16.04 | ||
# you can build with passing --build-arg argument, such as "--build-arg UBUNTU_VER=20.04" | ||
|
||
# install base packages | ||
RUN apt -y update && \ | ||
apt -y install language-pack-ko python3 python3-pip | ||
RUN locale-gen en_US.UTF-8 && \ | ||
update-locale LANG=en_US.UTF-8 | ||
RUN pip3 install --upgrade pip | ||
|
||
# branch to build khaiii | ||
FROM base AS build | ||
RUN apt -y install build-essential | ||
RUN pip3 install cmake | ||
COPY . /khaiii | ||
WORKDIR /khaiii/build | ||
RUN cmake .. && \ | ||
make -j && \ | ||
make resource && \ | ||
test/khaiii && \ | ||
make install && \ | ||
make package_python | ||
WORKDIR /khaiii/build/package_python | ||
RUN pip3 install . | ||
|
||
# branch to run khaiii | ||
FROM base AS runtime | ||
COPY --from=build /usr/local/bin/khaiii /usr/local/bin/ | ||
COPY --from=build /usr/local/lib/libkhaiii.* /usr/local/lib/ | ||
COPY --from=build /usr/local/share/khaiii/ /usr/local/share/khaiii/ | ||
COPY --from=build /usr/local/include/khaiii/ /usr/local/include/khaiii/ | ||
|
||
FROM runtime AS ubuntu-16.04 | ||
ENV PYTHON_VER=3.5 | ||
|
||
FROM runtime AS ubuntu-18.04 | ||
ENV PYTHON_VER=3.6 | ||
|
||
FROM runtime AS ubuntu-20.04 | ||
ENV PYTHON_VER=3.8 | ||
|
||
FROM ubuntu-${UBUNTU_VER} | ||
ARG KHAIII_VER | ||
RUN echo "KHAIII_VER: ${KHAIII_VER}" | ||
RUN if [ "${KHAIII_VER}" = "" ]; then echo "build argument KHAIII_VER is not provided" && exit 1; fi | ||
COPY --from=build /usr/local/lib/python${PYTHON_VER}/dist-packages/khaiii/ /usr/local/lib/python${PYTHON_VER}/dist-packages/khaiii/ | ||
COPY --from=build /usr/local/lib/python${PYTHON_VER}/dist-packages/khaiii-${KHAIII_VER}.dist-info/ /usr/local/lib/python${PYTHON_VER}/dist-packages/khaiii-${KHAIII_VER}.dist-info/ | ||
|
||
ENV LANG=ko_KR.UTF-8 | ||
WORKDIR / |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cmake>=3.10 | ||
cmake>=3.12 |