harishaseebat92 commited on
Commit
c8de2be
·
1 Parent(s): f106663

Configured Dockerfile for aqc_venv and fixed Linux paths

Browse files
Files changed (2) hide show
  1. Dockerfile +20 -9
  2. utils/base_functions.py +4 -0
Dockerfile CHANGED
@@ -16,13 +16,9 @@ ENV DEBIAN_FRONTEND=noninteractive \
16
  VTK_SILENCE_GET_VOID_POINTER_WARNINGS=1
17
 
18
  # 3. Install System Dependencies
19
- # This is the most critical part for PyVista/VTK. We need the OS
20
- # graphics libraries (libosmesa, libgl1) and the X Virtual FrameBuffer (xvfb).
21
- #
22
- # *** UPDATED this section to use current package names (e.g., libgl1, libegl1) ***
23
- #
24
  RUN apt-get update && apt-get install -y --no-install-recommends \
25
- build-essential cmake wget xvfb nginx \
26
  libosmesa6 libosmesa6-dev \
27
  libgl1 libgl1-mesa-dev \
28
  libegl1 libegl1-mesa-dev \
@@ -49,9 +45,21 @@ RUN python3 -m pip install --upgrade pip setuptools wheel \
49
  COPY --chown=user:user . .
50
  COPY docker/nginx.conf /etc/nginx/nginx.conf
51
 
52
- # 7. Install the local adapt-aqc package
53
- # We do this after copying the files so the source code is available
54
- RUN python3 -m pip install ./utils/adapt-aqc
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  # Prepare writable directories for nginx (running as non-root later)
57
  RUN mkdir -p /tmp/nginx/body /tmp/nginx/proxy /tmp/nginx/fastcgi /tmp/nginx/uwsgi /tmp/nginx/scgi \
@@ -61,6 +69,9 @@ RUN mkdir -p /tmp/nginx/body /tmp/nginx/proxy /tmp/nginx/fastcgi /tmp/nginx/uwsg
61
  # 7. Switch to the non-root user
62
  USER user
63
 
 
 
 
64
  # Default runtime configuration for multiprocess layout
65
  ENV OMP_NUM_THREADS=1 \
66
  APP_HOST=127.0.0.1 \
 
16
  VTK_SILENCE_GET_VOID_POINTER_WARNINGS=1
17
 
18
  # 3. Install System Dependencies
19
+ # Added 'git' here because we need it to clone aqc-research
 
 
 
 
20
  RUN apt-get update && apt-get install -y --no-install-recommends \
21
+ build-essential cmake wget xvfb nginx git \
22
  libosmesa6 libosmesa6-dev \
23
  libgl1 libgl1-mesa-dev \
24
  libegl1 libegl1-mesa-dev \
 
45
  COPY --chown=user:user . .
46
  COPY docker/nginx.conf /etc/nginx/nginx.conf
47
 
48
+ # ---------------------------------------------------------------------------
49
+ # [NEW] Create the 'aqc_venv' and install dependencies exactly as requested
50
+ # ---------------------------------------------------------------------------
51
+ RUN python3 -m venv utils/aqc_venv && \
52
+ # 1. Upgrade pip inside the new venv
53
+ utils/aqc_venv/bin/pip install --upgrade pip setuptools wheel && \
54
+ # 2. Clone aqc-research inside utils
55
+ cd utils && \
56
+ git clone https://github.com/bjader/aqc-research.git && \
57
+ # 3. Install aqc-research into the venv
58
+ ../utils/aqc_venv/bin/pip install ./aqc-research && \
59
+ # # 4. Remove the cloned folder
60
+ # rm -rf aqc-research && \
61
+ # 5. Install adapt-aqc (editable mode) into the venv
62
+ ../utils/aqc_venv/bin/pip install -e ./adapt-aqc
63
 
64
  # Prepare writable directories for nginx (running as non-root later)
65
  RUN mkdir -p /tmp/nginx/body /tmp/nginx/proxy /tmp/nginx/fastcgi /tmp/nginx/uwsgi /tmp/nginx/scgi \
 
69
  # 7. Switch to the non-root user
70
  USER user
71
 
72
+ # Note: We do NOT set PYTHONPATH for adapt-aqc here because it is installed
73
+ # inside the 'aqc_venv' which your code calls via subprocess.
74
+
75
  # Default runtime configuration for multiprocess layout
76
  ENV OMP_NUM_THREADS=1 \
77
  APP_HOST=127.0.0.1 \
utils/base_functions.py CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  import numpy as np
2
  import scipy.sparse as sp
3
  import math
 
1
+ import sys
2
+ import os
3
+ from pathlib import Path
4
+
5
  import numpy as np
6
  import scipy.sparse as sp
7
  import math