Skip to content

Commit

Permalink
Fixes for the example with MONAI (#229)
Browse files Browse the repository at this point in the history
  - debug mode - container use the host system’s IPC namespace
  - give more memory to the container
  - fix list fct in debug mode
  • Loading branch information
Esadruhn authored Oct 6, 2020
1 parent f87f6f2 commit 797ea3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion substra/sdk/backends/local/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def list(self, asset_type, filters=None):
Returns:
typing.List[models._BaseModel]: List of results
"""
db_assets = self._db.list(asset_type)
db_assets = self._db.list(asset_type, filters=filters)
# Parse the filters
parsed_filters = dict()
if filters is not None:
Expand Down
2 changes: 2 additions & 0 deletions substra/sdk/backends/local/compute/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def spawn(self, name, archive_path, command, volumes=None, envs=None):
detach=True,
tty=True,
stdin_open=True,
ipc_mode="host",
shm_size='8G',
)

execution_logs = []
Expand Down
10 changes: 8 additions & 2 deletions substra/sdk/backends/local/dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,18 @@ def get(self, type_, key: str, log: bool = True):
# TODO: better error that says do not have a remote ?
raise exceptions.NotFound(f"Wrong pk {key}", 404)

def list(self, type_):
def list(self, type_, filters):
""""List assets."""
local_assets = self._db.list(type_)
remote_assets = list()
if self._remote:
remote_assets = self._remote.list(type_)
try:
remote_assets = self._remote.list(type_, filters)
except Exception as e:
logger.info(
f"Could not list assets from the remote platform:\n{e}. \
\nIf you are not logged to a remote platform, ignore this message."
)
return local_assets + remote_assets

def save_file(self,
Expand Down

0 comments on commit 797ea3e

Please sign in to comment.