docker cleaner
This commit is contained in:
parent
0f38429ed9
commit
bd8eef9325
@ -109,7 +109,8 @@ class BaseTester:
|
|||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
self.solution.save()
|
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}"})
|
||||||
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:
|
for file in self.solution.task.dockerfiles:
|
||||||
add_name = file.filename[11:]
|
add_name = file.filename[11:]
|
||||||
send_to_queue("cleaner", {"type": "container", "name": f"solution_container_{self.solution.id}_{add_name}"})
|
send_to_queue("cleaner", {"type": "container", "name": f"solution_container_{self.solution.id}_{add_name}"})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from subprocess import call
|
from subprocess import call
|
||||||
|
|
||||||
from SprintLib.queue import MessagingSupport
|
from SprintLib.queue import MessagingSupport, send_to_queue
|
||||||
|
|
||||||
|
|
||||||
class Command(MessagingSupport):
|
class Command(MessagingSupport):
|
||||||
@ -30,3 +30,4 @@ class Command(MessagingSupport):
|
|||||||
print(f"Removed {type} {name}")
|
print(f"Removed {type} {name}")
|
||||||
else:
|
else:
|
||||||
print("Something went wrong")
|
print("Something went wrong")
|
||||||
|
send_to_queue(self.queue_name, payload)
|
||||||
|
@ -258,8 +258,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: global
|
||||||
replicas: 1
|
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: any
|
condition: any
|
||||||
update_config:
|
update_config:
|
||||||
|
Loading…
Reference in New Issue
Block a user