Skip to content

Commit

Permalink
Allow running directory to be on local disk
Browse files Browse the repository at this point in the history
Downgrade the running directory check to a
warning, since if we use LocalRunner there
is no need for the directory to be on
network storage.
  • Loading branch information
benmwebb committed Jun 25, 2021
1 parent e90daba commit 4a61c8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions python/saliweb/build/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ def _check_directory_locations(env):
running = env['config'].directories['RUNNING']
if not running.startswith('/wynton'):
print("""
** The RUNNING directory is set to %s.
** It must be on a cluster-accessible disk (i.e. /wynton).
** WARNING: The RUNNING directory is set to %s.
** It must be on a cluster-accessible disk (i.e. /wynton)
** unless you are using LocalRunner to run jobs.
""" % running, file=sys.stderr)
env.Exit(1)


def _check_directory_permissions(env):
Expand Down
13 changes: 7 additions & 6 deletions test/build/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,19 +363,20 @@ def make_env(install, incoming, running):
'.\n** It must be on a local disk '
'(e.g. /modbase1).\n\n')

# Running on a non-Wynton disk is NOT OK
# Running on a non-Wynton disk will trigger a warning
for disk in ('/var', '/usr', '/home', '/modbase1', '/modbase2',
'/modbase3', '/modbase4', '/modbase5', '/guitar1',
'/salilab'):
env = make_env('/modbase1', '/modbase1', disk)
ret, stderr = run_catch_stderr(
saliweb.build._check_directory_locations, env)
self.assertEqual(ret, None)
self.assertEqual(env.exitval, 1)
self.assertEqual(stderr, '\n** The RUNNING directory is set to '
+ disk +
'.\n** It must be on a cluster-accessible disk '
'(i.e. /wynton).\n\n')
self.assertIsNone(env.exitval)
self.assertEqual(
stderr,
'\n** WARNING: The RUNNING directory is set to ' + disk + '.\n'
'** It must be on a cluster-accessible disk (i.e. /wynton)\n'
'** unless you are using LocalRunner to run jobs.\n\n')

@testutil.run_in_tempdir
def test_check_directory_permissions(self):
Expand Down

0 comments on commit 4a61c8d

Please sign in to comment.