Spaces:
Runtime error
Runtime error
Commit
Β·
7da26a7
1
Parent(s):
e685fff
moved the main.y outside the backend directory:
Browse files- Dockerfile +2 -1
- __pycache__/main.cpython-310.pyc +0 -0
- backend/main.py β main.py +7 -7
Dockerfile
CHANGED
|
@@ -28,9 +28,10 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 28 |
|
| 29 |
COPY backend /app/backend
|
| 30 |
COPY prisma /app/prisma
|
|
|
|
| 31 |
|
| 32 |
RUN prisma db push --schema=prisma/schema.prisma
|
| 33 |
|
| 34 |
EXPOSE 8000
|
| 35 |
|
| 36 |
-
CMD ["python3", "-m", "uvicorn", "
|
|
|
|
| 28 |
|
| 29 |
COPY backend /app/backend
|
| 30 |
COPY prisma /app/prisma
|
| 31 |
+
COPY main.py /app/main.py
|
| 32 |
|
| 33 |
RUN prisma db push --schema=prisma/schema.prisma
|
| 34 |
|
| 35 |
EXPOSE 8000
|
| 36 |
|
| 37 |
+
CMD ["python3", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--reload-dir", "/app/backend"]
|
__pycache__/main.cpython-310.pyc
ADDED
|
Binary file (28 kB). View file
|
|
|
backend/main.py β main.py
RENAMED
|
@@ -176,7 +176,7 @@ async def placement(data: PlacementRequest):
|
|
| 176 |
]
|
| 177 |
}, indent=4)
|
| 178 |
|
| 179 |
-
command = "g++ -std=c++20 final_cpp_codes/priorityCalculationEngine.cpp -o final_cpp_codes/priorityCalculationEngine && ./final_cpp_codes/priorityCalculationEngine"
|
| 180 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 181 |
stdout, stderr = process.communicate(input=input_data)
|
| 182 |
|
|
@@ -224,7 +224,7 @@ async def placement(data: PlacementRequest):
|
|
| 224 |
"containers": [c.dict() for c in containers]
|
| 225 |
}, indent=4)
|
| 226 |
|
| 227 |
-
command = "g++ -std=c++20 final_cpp_codes/3dBinPakckingAlgo.cpp -o final_cpp_codes/3dBinPakckingAlgo && ./final_cpp_codes/3dBinPakckingAlgo"
|
| 228 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 229 |
stdout, stderr = process.communicate(input=final_json)
|
| 230 |
|
|
@@ -405,7 +405,7 @@ async def search(data:SearchRequest):
|
|
| 405 |
"itemId": itemId
|
| 406 |
}, indent=4)
|
| 407 |
|
| 408 |
-
command = "g++ -std=c++20 final_cpp_codes/retrievalPathPlanning.cpp -o final_cpp_codes/retrievalPathPlanning && ./final_cpp_codes/retrievalPathPlanning"
|
| 409 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 410 |
stdout, stderr = process.communicate(input=input_json)
|
| 411 |
|
|
@@ -623,7 +623,7 @@ async def place(data:PlaceRequest):
|
|
| 623 |
}, indent=4)
|
| 624 |
|
| 625 |
print(input_json)
|
| 626 |
-
command = "g++ -std=c++20 final_cpp_codes/placingItem.cpp -o final_cpp_codes/placingItem && ./final_cpp_codes/placingItem"
|
| 627 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 628 |
stdout, stderr = process.communicate(input=input_json)
|
| 629 |
|
|
@@ -821,7 +821,7 @@ async def waste_return_plan(data: WasteReturnPlanRequest):
|
|
| 821 |
"containers": container_data
|
| 822 |
}, indent=4)
|
| 823 |
print("*", input_json)
|
| 824 |
-
command = "g++ -std=c++20 final_cpp_codes/
|
| 825 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 826 |
stdout, stderr = process.communicate(input=input_json)
|
| 827 |
|
|
@@ -875,7 +875,7 @@ async def waste_return_plan(data: WasteReturnPlanRequest):
|
|
| 875 |
|
| 876 |
print("*" * 50, "\nInput JSON:", input_json)
|
| 877 |
|
| 878 |
-
command = "g++ -std=c++20 final_cpp_codes/retrievalPathPlanning.cpp -o final_cpp_codes/retrievalPathPlanning && ./final_cpp_codes/retrievalPathPlanning"
|
| 879 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 880 |
stdout, stderr = process.communicate(input=input_json)
|
| 881 |
|
|
@@ -1247,4 +1247,4 @@ async def get_containers(zoneName: str = Query(..., title="Zone Name")):
|
|
| 1247 |
|
| 1248 |
|
| 1249 |
if __name__ == "__main__":
|
| 1250 |
-
uvicorn.run(app,host="0.0.0.0",port=8000)
|
|
|
|
| 176 |
]
|
| 177 |
}, indent=4)
|
| 178 |
|
| 179 |
+
command = "g++ -std=c++20 backend/final_cpp_codes/priorityCalculationEngine.cpp -o backend/final_cpp_codes/priorityCalculationEngine && ./backend/final_cpp_codes/priorityCalculationEngine"
|
| 180 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 181 |
stdout, stderr = process.communicate(input=input_data)
|
| 182 |
|
|
|
|
| 224 |
"containers": [c.dict() for c in containers]
|
| 225 |
}, indent=4)
|
| 226 |
|
| 227 |
+
command = "g++ -std=c++20 backend/final_cpp_codes/3dBinPakckingAlgo.cpp -o backend/final_cpp_codes/3dBinPakckingAlgo && ./backend/final_cpp_codes/3dBinPakckingAlgo"
|
| 228 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 229 |
stdout, stderr = process.communicate(input=final_json)
|
| 230 |
|
|
|
|
| 405 |
"itemId": itemId
|
| 406 |
}, indent=4)
|
| 407 |
|
| 408 |
+
command = "g++ -std=c++20 backend/final_cpp_codes/retrievalPathPlanning.cpp -o backend/final_cpp_codes/retrievalPathPlanning && ./backend/final_cpp_codes/retrievalPathPlanning"
|
| 409 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 410 |
stdout, stderr = process.communicate(input=input_json)
|
| 411 |
|
|
|
|
| 623 |
}, indent=4)
|
| 624 |
|
| 625 |
print(input_json)
|
| 626 |
+
command = "g++ -std=c++20 backend/final_cpp_codes/placingItem.cpp -o backend/final_cpp_codes/placingItem && ./backend/final_cpp_codes/placingItem"
|
| 627 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 628 |
stdout, stderr = process.communicate(input=input_json)
|
| 629 |
|
|
|
|
| 821 |
"containers": container_data
|
| 822 |
}, indent=4)
|
| 823 |
print("*", input_json)
|
| 824 |
+
command = "g++ -std=c++20 backend/final_cpp_codes/3dBinPackingAlgo.cpp -o backend/final_cpp_codes/3dBinPackingAlgo && ./backend/final_cpp_codes/3dBinPackingAlgo"
|
| 825 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 826 |
stdout, stderr = process.communicate(input=input_json)
|
| 827 |
|
|
|
|
| 875 |
|
| 876 |
print("*" * 50, "\nInput JSON:", input_json)
|
| 877 |
|
| 878 |
+
command = "g++ -std=c++20 backend/final_cpp_codes/retrievalPathPlanning.cpp -o backend/final_cpp_codes/retrievalPathPlanning && ./backend/final_cpp_codes/retrievalPathPlanning"
|
| 879 |
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
|
| 880 |
stdout, stderr = process.communicate(input=input_json)
|
| 881 |
|
|
|
|
| 1247 |
|
| 1248 |
|
| 1249 |
if __name__ == "__main__":
|
| 1250 |
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|