Skip to content

Commit 8658338

Browse files
committed
More fixes for worker setup
1 parent d8e59ca commit 8658338

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

setup/worker_server_info.py.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ server_info = {{
66
"maps_path": "{map_dir}",
77
"compiled_path": "{compiled_dir}",
88
"logs_path": "{log_dir}",
9-
"api_base_url": "http://{api_url}/",
9+
"api_base_url": "{api_url}",
1010
"api_key": "{api_key}",
1111
"secure_jail": True,
1212
"memory_limit": 100,

setup/worker_setup.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ def setup_contest_files(options):
110110
if not os.path.exists(map_dir):
111111
os.mkdir(map_dir)
112112
run_cmd("chown {0}: {1}".format(options.username, map_dir))
113+
if not os.path.exists(options.log_dir):
114+
os.mkdir(options.log_dir)
115+
run_cmd("chown {0}: {1}".format(options.username, options.log_dir))
113116
worker_dir = os.path.join(contest_root, local_repo, "worker")
114117
si_filename = os.path.join(TEMPLATE_DIR, "worker_server_info.py.template")
115118
with open(si_filename, 'r') as si_file:
@@ -293,7 +296,7 @@ def get_options(argv):
293296
"log_dir": log_dir,
294297
"local_repo": top_level,
295298
"create_jails": True,
296-
"api_url": '.'.join(getfqdn().split('.')[1:]),
299+
"api_url": "http://"+ '.'.join(getfqdn().split('.')[1:]) +"/",
297300
"api_key": "",
298301
"install_cronjob": False,
299302
"run_worker": False,

worker/start_worker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
$ORIG_DIR = `pwd`
3+
ORIG_DIR=`pwd`
44
cd `dirname $0`
55
python release_stale_jails.py
66
python worker.py -t -n 0 &

0 commit comments

Comments
 (0)