Skip to content

provide info before docker commands #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pynvml
import csv
import queue
import sys

from runtime.rpc import scheduler_server
from task import Task, JobInfo
Expand Down Expand Up @@ -238,7 +239,10 @@ def close(self):
parser.add_argument('--log_path', type=str, required=True) # default='results/test_tgs_results.csv')
parser.add_argument('--need_throughput', action='store_true', default=False)
args = parser.parse_args()

p = input('Containers will be stopped and maybe deleted. Press y and then enter: ')
if p != 'y':
print('Abort.')
sys.exit(-1)
subprocess.call('docker stop $(docker ps -q)', shell=True)
subprocess.call('docker rm $(docker ps -aq)', shell=True)

Expand Down Expand Up @@ -307,4 +311,4 @@ def close(self):
sleep_time = min(sleep_time, (worker._start_time + worker._submit_queue[0]['submit_time'] - time.time()))
time.sleep(sleep_time)

worker.close()
worker.close()