Skip to content
Open
Show file tree
Hide file tree
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
18 changes: 17 additions & 1 deletion spinn_front_end_common/interface/abstract_spinnaker_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,24 @@ def __group_collab_or_job(self):
return self.__get_collab_id_from_folder(
match_obj.group(SHARED_WITH_GROUP))

# Allow this too as it helps in testing; it doesn't matter if it is
# spoofed since the user has to have the right permissions for it to
# work.
collab_id = os.getenv("COLLAB_ID")
if collab_id is not None:
logger.info(f"Requesting job in collaboratory {collab_id}")
return {"collab": collab_id}

# Another way to get a collab id
collab_id = get_config_str("Machine", "spalloc_collab")
if collab_id is not None:
logger.info(f"Requesting job in collaboratory {collab_id}")
return {"collab": collab_id}

# Try to use the config to get a group
group = get_config_str("Machine", "spalloc_group")
if group is not None:
logger.info(f"Requesting job in group {group}")
return {"group": group}

# Nothing ventured, nothing gained
Expand All @@ -314,7 +329,8 @@ def __get_collab_id_from_folder(self, folder):
""" Currently hacky way to get the EBRAINS collab id from the
drive folder, replicated from the NMPI collab template.
"""
ebrains_drive_client = ebrains_drive.connect(token=self.__bearer_token)
ebrains_drive_client = ebrains_drive.connect(
token=self.__bearer_token, env=os.getenv("EBRAINS_ENV", ""))
repo_by_title = ebrains_drive_client.repos.get_repos_by_name(folder)
if len(repo_by_title) != 1:
logger.warning(f"The repository for collab {folder} could not be"
Expand Down
2 changes: 1 addition & 1 deletion spinn_front_end_common/interface/java_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _find_java_jar(self):
f"No jar file at {auto_jar_file} "
"nor is java_jar_path set.")
elif os.path.exists(java_jar_path):
self._jar_file = auto_jar_file
self._jar_file = java_jar_path
else:
raise ConfigurationException(
f"No file found at java_jar_path: {java_jar_path}")
Expand Down
1 change: 1 addition & 0 deletions spinn_front_end_common/interface/spinnaker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ machine_spec_file = None
spalloc_port = 22244
spalloc_user = None
spalloc_group = None
spalloc_collab = None
spalloc_machine = None
spalloc_use_proxy = True
# A comma seperated list of ip addresses to avoid.
Expand Down