Create Dockerfile
Browse files- Dockerfile +34 -0
Dockerfile
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Better use newer Python as generated code can use new features
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# install git, g++ and python3-tk
|
5 |
+
RUN apt-get update && apt-get install -y git g++ python3-tk zip unzip procps r-base
|
6 |
+
|
7 |
+
# upgrade to latest pip
|
8 |
+
RUN pip install --upgrade pip
|
9 |
+
|
10 |
+
# Add a new user "bigcodebenchuser"
|
11 |
+
RUN adduser --disabled-password --gecos "" bigcodebenchuser
|
12 |
+
|
13 |
+
RUN rm -rf /bigcodebench
|
14 |
+
|
15 |
+
# Acquire benchmark code to local
|
16 |
+
ADD "https://api.github.com/repos/bigcode-project/bigcodebench/commits?per_page=1" latest_commit
|
17 |
+
RUN git clone https://github.com/bigcode-project/bigcodebench.git /bigcodebench
|
18 |
+
|
19 |
+
RUN cd /bigcodebench && pip install .
|
20 |
+
|
21 |
+
# Pre-install the dataset
|
22 |
+
RUN python3 -c "from bigcodebench.data import get_bigcodebench; get_bigcodebench()"
|
23 |
+
|
24 |
+
RUN pip install -I --timeout 2000 -r https://github.com/bigcode-project/bigcodebench-annotation/releases/download/v0.1.0/requirements.txt
|
25 |
+
|
26 |
+
WORKDIR /app
|
27 |
+
|
28 |
+
RUN chown -R bigcodebenchuser:bigcodebenchuser /app
|
29 |
+
|
30 |
+
RUN chmod -R 777 /app
|
31 |
+
|
32 |
+
USER bigcodebenchuser
|
33 |
+
|
34 |
+
CMD ["sh", "-c", "pids=$(ps -u $(id -u) -o pid,comm | grep 'bigcodebench' | awk '{print $1}'); if [ -n \"$pids\" ]; then echo $pids | xargs -r kill; fi; rm -rf /tmp/*"]
|