Compare commits

...
3 Commits
Author SHA1 Message Date
brb c19fc58a25 deleted unused code 2023-09-04 14:43:19 +02:00
brb bd5dc8fbc4 changed function to execute commands from runner script 2023-07-07 09:46:12 +02:00
brb f4a81b4b9b added and commented out code for passing through gpu 2023-07-07 09:45:45 +02:00
2 changed files with 9 additions and 4 deletions
+1 -3
View File
@@ -5,7 +5,6 @@ from dotenv import load_dotenv
import logging import logging
from typing import List from typing import List
import os import os
from subprocess import run
from utils import clone_repository, load_runner_script from utils import clone_repository, load_runner_script
from setup_logging import setup_logging from setup_logging import setup_logging
@@ -81,13 +80,12 @@ def handle_event(request: GiteaRequest):
os.system(f'pip install -r {requirements_path}') os.system(f'pip install -r {requirements_path}')
for cmd in pipeline.script: for cmd in pipeline.script:
try: try:
run(cmd) os.system(cmd)
except Exception as e: except Exception as e:
raise HTTPException( raise HTTPException(
status_code=503, status_code=503,
detail=f'failed running {cmd}: {e}' detail=f'failed running {cmd}: {e}'
) )
# send response # send response
raise HTTPException( raise HTTPException(
status_code=202, status_code=202,
+7
View File
@@ -11,3 +11,10 @@ services:
- LISTEN_IP=0.0.0.0 - LISTEN_IP=0.0.0.0
- LISTEN_PORT=8000 - LISTEN_PORT=8000
- REPO_DIR=/home/app/repo/ - REPO_DIR=/home/app/repo/
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# device_ids: ['0']
# capabilities: [gpu]