docker cleaner

This commit is contained in:
Egor Matveev 2022-05-07 12:25:10 +03:00
parent 0f38429ed9
commit bd8eef9325
3 changed files with 5 additions and 4 deletions

View File

@ -109,7 +109,8 @@ class BaseTester:
def cleanup(self):
self.solution.save()
send_to_queue("cleaner", {"type": "container", "name": f"solution_{self.solution.id}"})
send_to_queue("cleaner", {"type": "container", "name": f"solution_{self.solution.id}_checker"})
if self.checker_code:
send_to_queue("cleaner", {"type": "container", "name": f"solution_{self.solution.id}_checker"})
for file in self.solution.task.dockerfiles:
add_name = file.filename[11:]
send_to_queue("cleaner", {"type": "container", "name": f"solution_container_{self.solution.id}_{add_name}"})

View File

@ -1,6 +1,6 @@
from subprocess import call
from SprintLib.queue import MessagingSupport
from SprintLib.queue import MessagingSupport, send_to_queue
class Command(MessagingSupport):
@ -30,3 +30,4 @@ class Command(MessagingSupport):
print(f"Removed {type} {name}")
else:
print("Something went wrong")
send_to_queue(self.queue_name, payload)

View File

@ -258,8 +258,7 @@ services:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
mode: replicated
replicas: 1
mode: global
restart_policy:
condition: any
update_config: