Exemplo n.º 1
0
def cli(ctx, uris, **kwds):
    """Launch Galaxy instance with specified tools.

    The Galaxy tool panel will include just the referenced tool or tools (by
    default all the tools in the current working directory) and the upload
    tool.

    planemo will search parent directories to see if any is a Galaxy instance
    - but one can pick the Galaxy instance to use with the ``--galaxy_root``
    option or force planemo to download a disposable instance with the
    ``--install_galaxy`` flag.

    ``planemo`` will run the Galaxy instance in an existing virtualenv if one
    exists in a ``.venv`` directory in the specified ``--galaxy_root``.
    Otherwise, the Galaxy instance will run in a clean virtualenv created in
    ``/tmp``.

    ``planemo`` uses temporarily generated config files and environment
    variables to attempt to shield this execution of Galaxy from manually
    launched runs against that same Galaxy root - but this may not be bullet
    proof yet, so please be careful and do not try this against a production
    Galaxy instance.
    """
    paths = uris_to_paths(ctx, uris)
    runnables = for_paths(paths)
    galaxy_serve(ctx, runnables, **kwds)
Exemplo n.º 2
0
    def test_serve_daemon(self):
        """Test serving a galaxy tool via a daemon Galaxy process."""
        port = network_util.get_free_port()
        cat_path = os.path.join(TEST_REPOS_DIR, "single_tool", "cat.xml")
        config = galaxy_serve(
            self.test_context,
            [for_path(cat_path)],
            install_galaxy=True,
            port=port,
            daemon=True,
            no_dependency_resolution=True,
        )

        assert network_util.wait_net_service(
            "localhost",
            config.port,
            timeout=.1,
        )
        config_dict = config.gi.config.get_config()
        assert "allow_user_dataset_purge" in config_dict
        config.kill()
        assert not network_util.wait_net_service(
            "localhost",
            config.port,
            timeout=.1,
        )
Exemplo n.º 3
0
    def test_serve_daemon(self):
        """Test serving a galaxy tool via a daemon Galaxy process."""
        port = network_util.get_free_port()
        cat_path = os.path.join(TEST_REPOS_DIR, "single_tool", "cat.xml")
        config = galaxy_serve(
            self.test_context,
            [for_path(cat_path)],
            install_galaxy=True,
            port=port,
            daemon=True,
            no_dependency_resolution=True,
        )

        assert network_util.wait_net_service(
            "localhost",
            config.port,
            timeout=.1,
        )
        config_dict = config.gi.config.get_config()
        assert "allow_user_dataset_purge" in config_dict
        config.kill()
        assert not network_util.wait_net_service(
            "localhost",
            config.port,
            timeout=.1,
        )
Exemplo n.º 4
0
 def test_serve_daemon(self):
     """Test serving a galaxy tool via a daemon Galaxy process."""
     port = network_util.get_free_port()
     cat_path = os.path.join(TEST_REPOS_DIR, "single_tool", "cat.xml")
     config = galaxy_serve(
         self.test_context,
         [for_path(cat_path)],
         install_galaxy=True,
         galaxy_branch=target_galaxy_branch(),
         port=port,
         daemon=True,
         no_dependency_resolution=True,
     )
     _assert_service_up(config)
     config.kill()
     _assert_service_down(config)
Exemplo n.º 5
0
 def test_serve_workflow(self):
     """Test serving a galaxy workflow via a daemon Galaxy process."""
     port = network_util.get_free_port()
     random_lines = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "randomlines.xml")
     cat = os.path.join(PROJECT_TEMPLATES_DIR, "demo", "cat.xml")
     worklfow = os.path.join(TEST_DATA_DIR, "wf1.gxwf.yml")
     extra_tools = [random_lines, cat]
     config = galaxy_serve(
         self.test_context,
         [for_path(worklfow)],
         install_galaxy=True,
         port=port,
         daemon=True,
         extra_tools=extra_tools,
     )
     user_gi = config.user_gi
     assert user_gi.tools.get_tools(tool_id="random_lines1")
     assert len(user_gi.workflows.get_workflows()) == 1
     config.kill()
Exemplo n.º 6
0
    def test_serve_daemon(self):
        port = network_util.get_free_port()
        cat_path = os.path.join(TEST_REPOS_DIR, "single_tool", "cat.xml")
        config = galaxy_serve(
            self.test_context,
            cat_path,
            install_galaxy=True,
            port=port,
            daemon=True,
        )

        assert network_util.wait_net_service(
            "localhost",
            config.port,
            timeout=.1,
        )
        config_dict = config.gi.config.get_config()
        assert "allow_user_dataset_purge" in config_dict
        config.kill()
        assert not network_util.wait_net_service(
            "localhost",
            config.port,
            timeout=.1,
        )