kostis-init commited on
Commit
d7fe210
Β·
1 Parent(s): c64e2fc

debug app cont.

Browse files
Files changed (2) hide show
  1. Dockerfile +15 -1
  2. app.py +32 -17
Dockerfile CHANGED
@@ -32,4 +32,18 @@ ENV LD_LIBRARY_PATH="${MZN_DIR}/lib:${LD_LIBRARY_PATH}"
32
  EXPOSE 7860
33
 
34
  #CMD ["python", "app.py"]
35
- CMD ["python", "-c", "import os; import time; print(f'[{time.time()}] Python interpreter is ALIVE from CMD in Dockerfile. CWD: {os.getcwd()}. Test print.')"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  EXPOSE 7860
33
 
34
  #CMD ["python", "app.py"]
35
+ # ... (rest of your Dockerfile, including EXPOSE 7860) ...
36
+
37
+ # Revert the previous CMD test:
38
+ # CMD ["python", "-c", "import os; import time; print(f'[{time.time()}] Python interpreter is ALIVE from CMD in Dockerfile. CWD: {os.getcwd()}. Test print.')"]
39
+
40
+ # New diagnostic CMD:
41
+ CMD ["sh", "-c", "echo '==== Shell diagnostic from CMD starting ====' && \
42
+ echo 'Current directory:' && pwd && \
43
+ echo 'Listing /app contents:' && ls -la /app && \
44
+ echo '==== Contents of /app/app.py: ====' && \
45
+ cat /app/app.py && \
46
+ echo '==== End of /app/app.py contents ====' && \
47
+ echo 'Attempting to execute: python /app/app.py' && \
48
+ python /app/app.py && \
49
+ echo '==== Shell diagnostic from CMD finished ==== (If python app.py failed, this might not show)'"]
app.py CHANGED
@@ -1,19 +1,34 @@
1
- from src.ui import create_ui
2
- import os
3
- import subprocess
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- try:
6
- version = subprocess.check_output(["minizinc", "--version"], text=True, stderr=subprocess.STDOUT)
7
- print(f"🧠 MiniZinc version (from Docker env): {version.strip()}")
8
- solvers = subprocess.check_output(["minizinc", "--solvers"], text=True, stderr=subprocess.STDOUT)
9
- print(f"πŸ’‘ MiniZinc solvers (from Docker env):\n{solvers.strip()}")
10
- except FileNotFoundError:
11
- print("❌ MiniZinc command not found. Check PATH in Dockerfile and setup.sh.")
12
- except subprocess.CalledProcessError as e:
13
- print(f"❌ MiniZinc command failed. Output: {e.output}")
14
- except Exception as e:
15
- print(f"❌ Error checking MiniZinc: {e}")
16
 
17
- if __name__ == "__main__":
18
- demo = create_ui()
19
- demo.queue().launch()
 
 
 
 
 
 
 
 
 
 
1
+ # from src.ui import create_ui
2
+ # import os
3
+ # import subprocess
4
+ #
5
+ # try:
6
+ # version = subprocess.check_output(["minizinc", "--version"], text=True, stderr=subprocess.STDOUT)
7
+ # print(f"🧠 MiniZinc version (from Docker env): {version.strip()}")
8
+ # solvers = subprocess.check_output(["minizinc", "--solvers"], text=True, stderr=subprocess.STDOUT)
9
+ # print(f"πŸ’‘ MiniZinc solvers (from Docker env):\n{solvers.strip()}")
10
+ # except FileNotFoundError:
11
+ # print("❌ MiniZinc command not found. Check PATH in Dockerfile and setup.sh.")
12
+ # except subprocess.CalledProcessError as e:
13
+ # print(f"❌ MiniZinc command failed. Output: {e.output}")
14
+ # except Exception as e:
15
+ # print(f"❌ Error checking MiniZinc: {e}")
16
+ #
17
+ # if __name__ == "__main__":
18
+ # demo = create_ui()
19
+ # demo.queue().launch()
20
+
21
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
+ # app.py (TEMPORARY MINIMAL VERSION for testing)
24
+ import os
25
+ import time
26
+ import sys
27
+
28
+ print(f"[{time.time()}] MINIMAL app.py is RUNNING! CWD: {os.getcwd()}")
29
+ print(f"Python version: {sys.version}")
30
+ # print(f"Arguments: {sys.argv}") # You can uncomment this if needed
31
+ print("This is the minimal app.py content.")
32
+ # Add a small delay to ensure logs might flush if it's a quick exit
33
+ time.sleep(2) # Keep this to ensure logs have a chance to appear
34
+ print(f"[{time.time()}] MINIMAL app.py finished.")