Commit
Β·
03fe486
1
Parent(s):
d7fe210
restore for deploy check
Browse files- Dockerfile +1 -16
- app.py +17 -32
Dockerfile
CHANGED
@@ -31,19 +31,4 @@ ENV LD_LIBRARY_PATH="${MZN_DIR}/lib:${LD_LIBRARY_PATH}"
|
|
31 |
# Expose the port Gradio runs on (default is 7860)
|
32 |
EXPOSE 7860
|
33 |
|
34 |
-
|
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)'"]
|
|
|
31 |
# Expose the port Gradio runs on (default is 7860)
|
32 |
EXPOSE 7860
|
33 |
|
34 |
+
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
@@ -1,34 +1,19 @@
|
|
1 |
-
|
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
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
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.")
|
|
|
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, timeout=10)
|
7 |
+
print(f"π§ MiniZinc version (from Docker env): {version.strip()}")
|
8 |
+
solvers = subprocess.check_output(["minizinc", "--solvers"], text=True, stderr=subprocess.STDOUT, timeout=10)
|
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()
|
|
|
|
|
|
|
|