Skip to content

Commit

Permalink
make the default conditional for when there is no local job registration
Browse files Browse the repository at this point in the history
  • Loading branch information
Miserlou committed Dec 4, 2018
1 parent 915e53c commit 610e97c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/data_refinery_common/test_utils.py
Expand Up @@ -94,7 +94,7 @@ def test_get_normalized_platform(self):

def test_volume_index(self):
"""Test that supported RNASeq platforms setting is set correctly."""
self.assertEqual(utils.get_volume_index(), "-1")
self.assertEqual(utils.get_volume_index(), "0")
with open('/tmp/VOLUME_INDEX', 'wb') as f:
f.write("123".encode())
self.assertEqual(utils.get_volume_index(path='/tmp/VOLUME_INDEX'), "123")
6 changes: 5 additions & 1 deletion common/data_refinery_common/utils.py
Expand Up @@ -15,6 +15,10 @@
SUPPORTED_MICROARRAY_PLATFORMS = None
SUPPORTED_RNASEQ_PLATFORMS = None
READABLE_PLATFORM_NAMES = None
if settings.RUNNING_IN_CLOUD:
VOLUME_INDEX_DEFAULT = "-1"
else:
VOLUME_INDEX_DEFAULT = "0"


def get_env_variable(var_name: str, default: str=None) -> str:
Expand Down Expand Up @@ -60,7 +64,7 @@ def get_worker_id() -> str:
return get_instance_id() + "/" + current_process().name


def get_volume_index(default="-1", path='/home/user/data_store/VOLUME_INDEX') -> str:
def get_volume_index(default=VOLUME_INDEX_DEFAULT, path='/home/user/data_store/VOLUME_INDEX') -> str:
""" Reads the contents of the VOLUME_INDEX file, else returns default """

try:
Expand Down
2 changes: 1 addition & 1 deletion nomad_client.config
Expand Up @@ -8,7 +8,7 @@ client {
}

meta {
volume_index = "-1"
volume_index = "0"
is_smasher = "false"
}
}

0 comments on commit 610e97c

Please sign in to comment.