Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
serve
command to serve daemon Galaxy process.
- Add a ``--daemon`` flag and a ``--pid-file`` option. - Refactor API interactions to be slightly higher-level and usable outside planemo.shed. - Implement test case for this.
- Loading branch information
Showing
7 changed files
with
101 additions
and
30 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,39 @@ | ||
"""A high-level interface to local Galaxy instances using bioblend.""" | ||
from planemo.bioblend import ensure_module | ||
from planemo.bioblend import galaxy | ||
|
||
DEFAULT_MASTER_API_KEY = "test_key" | ||
|
||
|
||
def gi(port, key=None): | ||
"""Return a bioblend ``GalaxyInstance`` for Galaxy on this port.""" | ||
ensure_module() | ||
if key is None: | ||
key = DEFAULT_MASTER_API_KEY | ||
return galaxy.GalaxyInstance( | ||
url="http://localhost:%d" % int(port), | ||
key=key | ||
) | ||
|
||
|
||
def user_api_key(admin_gi): | ||
"""Use an admin authenticated account to generate a user API key.""" | ||
ensure_module() | ||
# TODO: thread-safe | ||
users = admin_gi.users | ||
# Allow override with --user_api_key. | ||
user_response = users.create_local_user( | ||
"planemo", | ||
"planemo@galaxyproject.org", | ||
"planemo", | ||
) | ||
user_id = user_response["id"] | ||
|
||
return users.create_user_apikey(user_id) | ||
|
||
|
||
__all__ = [ | ||
"DEFAULT_MASTER_API_KEY", | ||
"gi", | ||
"user_api_key", | ||
] |
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
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
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