Jayant-Kernel commited on
Commit ·
11baf5d
1
Parent(s): 1058c6b
fix: find deceit_env package location and copy data correctly
Browse files- Dockerfile +23 -4
Dockerfile
CHANGED
|
@@ -4,7 +4,7 @@ ENV PYTHONUNBUFFERED=1
|
|
| 4 |
ENV HF_HOME=/tmp/huggingface
|
| 5 |
ENV HOME=/tmp
|
| 6 |
ENV TORCHINDUCTOR_CACHE_DIR=/tmp/torch_cache
|
| 7 |
-
ENV PYTHONPATH=/usr/local/lib/python3.10/site-packages
|
| 8 |
|
| 9 |
RUN apt-get update && apt-get install -y git build-essential && rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
@@ -25,11 +25,30 @@ RUN pip install --no-cache-dir \
|
|
| 25 |
RUN pip install --no-cache-dir \
|
| 26 |
git+https://github.com/Jayant-kernel/DECEIT-the-ai-truth-environment-.git
|
| 27 |
|
| 28 |
-
RUN python -c "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
RUN mkdir -p /usr/local/lib/python3.10/site-packages/deceit_env/data/
|
| 31 |
-
COPY data/ /usr/local/lib/python3.10/site-packages/deceit_env/data/
|
| 32 |
COPY data/ /app/data/
|
|
|
|
| 33 |
COPY train.py .
|
| 34 |
COPY evaluate.py .
|
| 35 |
|
|
|
|
| 4 |
ENV HF_HOME=/tmp/huggingface
|
| 5 |
ENV HOME=/tmp
|
| 6 |
ENV TORCHINDUCTOR_CACHE_DIR=/tmp/torch_cache
|
| 7 |
+
ENV PYTHONPATH=/app:/usr/local/lib/python3.10/site-packages:/home/trainer/.local/lib/python3.10/site-packages
|
| 8 |
|
| 9 |
RUN apt-get update && apt-get install -y git build-essential && rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
| 25 |
RUN pip install --no-cache-dir \
|
| 26 |
git+https://github.com/Jayant-kernel/DECEIT-the-ai-truth-environment-.git
|
| 27 |
|
| 28 |
+
RUN python -c "
|
| 29 |
+
import subprocess
|
| 30 |
+
result = subprocess.run(['find', '/', '-name', 'environment.py', '-path', '*/deceit_env/*'],
|
| 31 |
+
capture_output=True, text=True)
|
| 32 |
+
print(result.stdout)
|
| 33 |
+
"
|
| 34 |
+
|
| 35 |
+
RUN python -c "
|
| 36 |
+
import importlib.util, os
|
| 37 |
+
spec = importlib.util.find_spec('deceit_env')
|
| 38 |
+
if spec:
|
| 39 |
+
pkg_dir = os.path.dirname(spec.origin)
|
| 40 |
+
data_dst = os.path.join(pkg_dir, 'data')
|
| 41 |
+
print(f'Package at: {pkg_dir}')
|
| 42 |
+
os.makedirs(data_dst, exist_ok=True)
|
| 43 |
+
print(f'Data dir created: {data_dst}')
|
| 44 |
+
" || echo "deceit_env not found"
|
| 45 |
+
|
| 46 |
+
RUN mkdir -p /usr/local/lib/python3.10/site-packages/deceit_env/data/ && \
|
| 47 |
+
mkdir -p /usr/local/lib/python3.10/site-packages/deceit_env/server/ && \
|
| 48 |
+
touch /usr/local/lib/python3.10/site-packages/deceit_env/server/__init__.py || true
|
| 49 |
|
|
|
|
|
|
|
| 50 |
COPY data/ /app/data/
|
| 51 |
+
COPY data/ /usr/local/lib/python3.10/site-packages/deceit_env/data/
|
| 52 |
COPY train.py .
|
| 53 |
COPY evaluate.py .
|
| 54 |
|