Spaces:
Sleeping
Sleeping
push cfg_db
Browse files- .ipynb_checkpoints/Dockerfile-checkpoint +124 -0
- Dockerfile +1 -1
.ipynb_checkpoints/Dockerfile-checkpoint
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:jammy
|
| 2 |
+
WORKDIR /root
|
| 3 |
+
|
| 4 |
+
ENV DEBIAN_FRONTEND noninteractive
|
| 5 |
+
ENV TZ Etc/UTC
|
| 6 |
+
|
| 7 |
+
RUN apt-get update && \
|
| 8 |
+
apt-get install -y \
|
| 9 |
+
gnupg ca-certificates apt-utils \
|
| 10 |
+
build-essential curl unzip && \
|
| 11 |
+
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
|
| 12 |
+
|
| 13 |
+
RUN echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list
|
| 14 |
+
|
| 15 |
+
RUN apt-get update && \
|
| 16 |
+
apt-get install -y tzdata
|
| 17 |
+
|
| 18 |
+
RUN apt-get install -y mono-devel \
|
| 19 |
+
gcc-12 g++-12
|
| 20 |
+
|
| 21 |
+
RUN apt-get update && \
|
| 22 |
+
apt-get install -y software-properties-common python3.11-dev
|
| 23 |
+
|
| 24 |
+
RUN apt-get update && \
|
| 25 |
+
apt-get install -y -f libasound2 libc6-i386 libc6-x32 libxi6 libxtst6
|
| 26 |
+
|
| 27 |
+
ENV JAVA_PKG=https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz \
|
| 28 |
+
JAVA_HOME=/usr/java/jdk-21
|
| 29 |
+
|
| 30 |
+
RUN set -eux; \
|
| 31 |
+
JAVA_SHA256=$(curl "$JAVA_PKG".sha256) ; \
|
| 32 |
+
curl --output /tmp/jdk.tgz "$JAVA_PKG" && \
|
| 33 |
+
echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c; \
|
| 34 |
+
mkdir -p "$JAVA_HOME"; \
|
| 35 |
+
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1
|
| 36 |
+
|
| 37 |
+
RUN curl -OL https://github.com/JetBrains/kotlin/releases/download/v1.7.20/kotlin-compiler-1.7.20.zip
|
| 38 |
+
RUN unzip kotlin-compiler-1.7.20.zip -d /usr/local && \
|
| 39 |
+
rm kotlin-compiler-1.7.20.zip
|
| 40 |
+
|
| 41 |
+
RUN apt-get install -y python2
|
| 42 |
+
|
| 43 |
+
RUN curl -OL https://go.dev/dl/go1.19.2.linux-amd64.tar.gz
|
| 44 |
+
RUN tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz && \
|
| 45 |
+
rm go1.19.2.linux-amd64.tar.gz
|
| 46 |
+
|
| 47 |
+
RUN curl -OL https://downloads.python.org/pypy/pypy3.9-v7.3.9-linux64.tar.bz2
|
| 48 |
+
RUN tar -C /usr/local -xf pypy3.9-v7.3.9-linux64.tar.bz2 && \
|
| 49 |
+
rm pypy3.9-v7.3.9-linux64.tar.bz2
|
| 50 |
+
|
| 51 |
+
RUN curl -OL https://downloads.python.org/pypy/pypy2.7-v7.3.9-linux64.tar.bz2
|
| 52 |
+
RUN tar -C /usr/local -xf pypy2.7-v7.3.9-linux64.tar.bz2 && \
|
| 53 |
+
rm pypy2.7-v7.3.9-linux64.tar.bz2
|
| 54 |
+
|
| 55 |
+
RUN apt-get install -y clang-14
|
| 56 |
+
|
| 57 |
+
ARG NODE_VERSION=v16.17.1
|
| 58 |
+
ARG NODE_DISTRO=linux-x64
|
| 59 |
+
ARG NODE_ZIP=node-$NODE_VERSION-$NODE_DISTRO.tar.xz
|
| 60 |
+
RUN curl -OL https://nodejs.org/dist/$NODE_VERSION/$NODE_ZIP
|
| 61 |
+
RUN tar -C /usr/local -xJvf $NODE_ZIP && \
|
| 62 |
+
rm $NODE_ZIP
|
| 63 |
+
|
| 64 |
+
ENV RUSTUP_HOME /opt/rust
|
| 65 |
+
ENV CARGO_HOME /opt/rust
|
| 66 |
+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path
|
| 67 |
+
RUN apt-get install -y ruby-full
|
| 68 |
+
|
| 69 |
+
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing php8.1
|
| 70 |
+
RUN apt-get install -y libgmp-dev libmpfr-dev
|
| 71 |
+
|
| 72 |
+
ENV PATH $PATH:/usr/local/go/bin:/usr/local/kotlinc/bin:/usr/local/node-v16.17.1-linux-x64/bin:/opt/rust/bin
|
| 73 |
+
|
| 74 |
+
WORKDIR /root
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
RUN update-alternatives --install /usr/bin/java java "$JAVA_HOME"/bin/java 100 && \
|
| 78 |
+
update-alternatives --install /usr/bin/javac javac "$JAVA_HOME"/bin/javac 100 && \
|
| 79 |
+
update-alternatives --install /usr/bin/jar jar "$JAVA_HOME"/bin/jar 100 && \
|
| 80 |
+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 && \
|
| 81 |
+
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 && \
|
| 82 |
+
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 100 && \
|
| 83 |
+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100 && \
|
| 84 |
+
update-alternatives --install /usr/bin/pypy2 pypy2 /usr/local/pypy2.7-v7.3.9-linux64/bin/pypy2 100 && \
|
| 85 |
+
update-alternatives --install /usr/bin/pypy3 pypy3 /usr/local/pypy3.9-v7.3.9-linux64/bin/pypy3 100
|
| 86 |
+
|
| 87 |
+
RUN apt-get install -y python3-pip gperf
|
| 88 |
+
RUN pip install flask gunicorn flask-cors gmpy2 Cython jsonlines fire
|
| 89 |
+
|
| 90 |
+
RUN curl -o libseccomp.tar.gz -L https://github.com/seccomp/libseccomp/releases/download/v2.5.4/libseccomp-2.5.4.tar.gz
|
| 91 |
+
RUN tar -xzvf libseccomp.tar.gz && cd libseccomp-2.5.4 && chmod +x configure
|
| 92 |
+
WORKDIR /root/libseccomp-2.5.4
|
| 93 |
+
RUN ./configure --prefix=/usr --enable-python && make
|
| 94 |
+
RUN make install
|
| 95 |
+
WORKDIR /root/
|
| 96 |
+
RUN rm -rf libseccomp*
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
ENV RUN_UID 1586
|
| 100 |
+
ENV RUN_UID2 1587
|
| 101 |
+
ENV RUN_GID 1586
|
| 102 |
+
ENV RUN_GID2 1587
|
| 103 |
+
ENV NUM_WORKERS 2
|
| 104 |
+
ENV GUNICORN_PORT 7860
|
| 105 |
+
ENV LOG_LEVEL info
|
| 106 |
+
|
| 107 |
+
RUN groupadd -g ${RUN_GID} runner${RUN_GID} && useradd -M runner${RUN_UID} -g ${RUN_GID} -u ${RUN_UID}
|
| 108 |
+
RUN groupadd -g ${RUN_GID2} runner${RUN_GID2} && useradd -M runner${RUN_UID2} -g ${RUN_GID2} -u ${RUN_UID2}
|
| 109 |
+
|
| 110 |
+
# EXPOSE ${GUNICORN_PORT} !!!
|
| 111 |
+
EXPOSE 7860
|
| 112 |
+
RUN useradd -m -u 1000 user
|
| 113 |
+
|
| 114 |
+
RUN mkdir -p /home/user/execution_engine
|
| 115 |
+
COPY --chown=user ./execution_engine /home/user/execution_engine
|
| 116 |
+
RUN chmod -R 777 /home/user/execution_engine
|
| 117 |
+
|
| 118 |
+
USER user
|
| 119 |
+
RUN touch /home/user/worker_cfg_db.csv
|
| 120 |
+
ENV WORKER_CFG_DB /home/user/worker_cfg_db.csv
|
| 121 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 122 |
+
WORKDIR /home/user/execution_engine
|
| 123 |
+
|
| 124 |
+
CMD ["bash", "start_engine.sh"]
|
Dockerfile
CHANGED
|
@@ -101,7 +101,7 @@ ENV RUN_UID2 1587
|
|
| 101 |
ENV RUN_GID 1586
|
| 102 |
ENV RUN_GID2 1587
|
| 103 |
ENV NUM_WORKERS 2
|
| 104 |
-
|
| 105 |
ENV LOG_LEVEL info
|
| 106 |
|
| 107 |
RUN groupadd -g ${RUN_GID} runner${RUN_GID} && useradd -M runner${RUN_UID} -g ${RUN_GID} -u ${RUN_UID}
|
|
|
|
| 101 |
ENV RUN_GID 1586
|
| 102 |
ENV RUN_GID2 1587
|
| 103 |
ENV NUM_WORKERS 2
|
| 104 |
+
ENV GUNICORN_PORT 7860
|
| 105 |
ENV LOG_LEVEL info
|
| 106 |
|
| 107 |
RUN groupadd -g ${RUN_GID} runner${RUN_GID} && useradd -M runner${RUN_UID} -g ${RUN_GID} -u ${RUN_UID}
|