-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from galaxyproject/add_sample
Add sample vortex config and map to first available destination
- Loading branch information
Showing
6 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
global: | ||
default_inherits: default | ||
|
||
tools: | ||
default: | ||
cores: 2 | ||
mem: cores * 2 | ||
params: | ||
local_slots: "{cores}" | ||
|
||
destinations: | ||
local: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,11 @@ def test_map_inherit_no_default(self): | |
self.assertEqual(destination.id, "local") | ||
self.assertFalse([env['value'] for env in destination.env if env['name'] == 'TEST_JOB_SLOTS']) | ||
self.assertEqual(destination.params['another_spec'], '--gpus 4') | ||
|
||
def test_map_inherit_no_default_no_tool_def(self): | ||
tool = mock_galaxy.Tool('some_random_tool') | ||
user = mock_galaxy.User('gargravarr', '[email protected]') | ||
vortex_config_path = os.path.join(os.path.dirname(__file__), 'fixtures/mapping-inheritance-no-default.yml') | ||
|
||
destination = self._map_to_destination(tool, user, datasets=[], vortex_config_path=vortex_config_path) | ||
self.assertEqual(destination.id, "local") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import os | ||
import unittest | ||
from vortex.rules import gateway | ||
from . import mock_galaxy | ||
|
||
|
||
class TestMapperSample(unittest.TestCase): | ||
|
||
@staticmethod | ||
def _map_to_destination(tool): | ||
galaxy_app = mock_galaxy.App() | ||
job = mock_galaxy.Job() | ||
user = mock_galaxy.User('gargravarr', '[email protected]') | ||
vortex_config = os.path.join(os.path.dirname(__file__), 'fixtures/mapping-sample.yml') | ||
gateway.ACTIVE_DESTINATION_MAPPER = None | ||
return gateway.map_tool_to_destination(galaxy_app, job, tool, user, vortex_config_files=[vortex_config]) | ||
|
||
def test_map_sample_tool(self): | ||
tool = mock_galaxy.Tool('sometool') | ||
destination = self._map_to_destination(tool) | ||
self.assertEqual(destination.id, "local") | ||
self.assertEqual(destination.params['local_slots'], '2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters