-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdind.Dockerfile
More file actions
76 lines (62 loc) · 2.42 KB
/
Copy pathdind.Dockerfile
File metadata and controls
76 lines (62 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Use a Docker-in-Docker base image with Ubuntu 24.04 (Noble Numbat)
FROM --platform=linux/amd64 cruizba/ubuntu-dind:noble-latest
# Install system dependencies
RUN apt-get update && \
apt-get install -y \
git \
build-essential \
python3-full \
&& rm -rf /var/lib/apt/lists/*
# Install network troubleshooting tools
RUN apt-get update && \
apt-get install -y \
dnsutils \
iputils-ping \
net-tools \
traceroute \
curl \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Create and activate virtual environment
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# Disable pip version warning and cache
ARG PIP_DISABLE_PIP_VERSION_CHECK=1
ARG PIP_NO_CACHE_DIR=1
# Upgrade pip and setuptools in the virtual environment
RUN /opt/venv/bin/pip install --upgrade pip setuptools wheel
# Copy requirements.txt first to leverage Docker cache
COPY requirements.txt /app/
# Install dependencies from requirements.txt
RUN /opt/venv/bin/pip install -r requirements.txt \
&& /opt/venv/bin/pip install huggingface_hub requests
# Copy source code
COPY . /app/
# Copy network diagnostics scripts
COPY aws/simple_network_check.py /app/aws/simple_network_check.py
COPY aws/network_diagnostics.py /app/aws/network_diagnostics.py
COPY aws/configure_aws_credentials.py /app/aws/configure_aws_credentials.py
COPY aws/run_with_iam_role.py /app/aws/run_with_iam_role.py
COPY aws/aws_diagnostics.py /app/aws/aws_diagnostics.py
COPY aws/check_hanging_processes.py /app/aws/check_hanging_processes.py
RUN chmod +x /app/aws/simple_network_check.py
RUN chmod +x /app/aws/network_diagnostics.py
RUN chmod +x /app/aws/configure_aws_credentials.py
RUN chmod +x /app/aws/run_with_iam_role.py
RUN chmod +x /app/aws/aws_diagnostics.py
RUN chmod +x /app/aws/check_hanging_processes.py
# Install the local package in development mode and clean up cache
RUN /opt/venv/bin/pip install -e . \
&& find /opt/venv -name '*.pyc' -delete
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH=/app
# Start Docker daemon when container starts
# The entrypoint script from the base image will be used
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Default command to run the evaluation
CMD ["/opt/venv/bin/python", "-m", "inspect_evals_scoring.cli.run_eval", "local", "--tasks", "inspect_evals/pubmedqa", "--model", "openai/gpt-4o-mini", "--limit", "1"]