galaxyproject / ephemeris Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename shed-install to shed-tools install and add --latest and --revisions flag. Add shed-tools update subcommand. #64
Conversation
…og issue" This reverts commit ab6723f.
|
@jmchilton It would be nice if it could be included in the following ephemeris release. #61 . After someone reviews it of course. |
ephemeris/shed_install.py
Outdated
| itl = tsc.get_repositories() | ||
| for it in itl: | ||
| if it['status'] == 'Installed': | ||
| installed_tool_list = tool_shed_client.get_repositories() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you're at it, can we change this to installed_repository_list, to avoid any confusion, and to leave some wigglespace should we ever implement a more tool-centric installation approach?
In fact I think you can s/tool/repository/g and s/tools/repositories/g in this file, this should be much clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my way
|
Done with all the refactoring. |
caec176
to
808ea70
|
Oh wow - this is fantastic! |
Impressive work @rhpvorderman! I have included a few comments inline.
ephemeris/shed_install.py
Outdated
| tool panel that were installed on the target Galaxy instance | ||
| from the Tool Shed; | ||
| - `tool_panel_custom_tools` with a list of tools available in | ||
| - `tool_panel_custom_tools` with a list of repositories available in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repositories should here be tool, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I did some find -> replace (in selection) stuff. It worked better than just doing it for the entire file. But I still missed some things. Thanks for pointing them out.
ephemeris/shed_install.py
Outdated
| """ | ||
| if not omit: | ||
| omit = [] | ||
| tp_tools = [] # Tools available in the tool panel and installe via a TS | ||
| tool_panel_repos = [] # The repositories from tools available in the tool panel and installable via a TS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/from/of/
maybe the 'the Tool Shed repositories of tools available ...'
ephemeris/shed_install.py
Outdated
| default=None, | ||
| dest="revisions", | ||
| help="The revisions of the tool repository that will be installed. " | ||
| "Revisions must be specified in on the command line in YAML format:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/in//
But this is rather odd for the UX. Can we use nargs="" here instead?
ephemeris/shed_install.py
Outdated
| parser.add_argument("--update", | ||
| action="store_true", | ||
| dest="update_tools", | ||
| help="This updates all tools in the Galaxy to the latest revision. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/the//
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should make this a positional command.
Like shed_tools update and shed_tools install ...
|
|
||
| function start_new_container { | ||
| echo "Start new container" | ||
| docker rm -f $CID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting will this automatically stop the container? Or should we stop the container before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm -f automatically stops the container. That is what the -f flag is for.
| echo "Check tool installation with yaml on the commandline" | ||
| # CD Hit was chosen since it is old and seems to be unmaintained. Last update was 2015. | ||
| # Anyone know a smaller tool that could fit its place? | ||
| OLD_TOOL="{'owner':'jjohnson','name':'cdhit','revisions':['34a799d173f7'],'tool_panel_section_label':'CD_HIT'}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably create a dummy tool in the TS. As soon as this container gets updated we will have failing tests that are hard to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Better even to use the test toolshed for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is fine, the test toolshed is not a good idea. We do similar stuff in galaxy's tests, and even if the repository get's updated this will continue to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually we can just make sure that there is a new revision, we don't care which revision that is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvdbeek correct me, but if we test the latest repository as we do a few lines below, this test will fail as soon as the repo is updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but we can test that there is an additional revision in the tool list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but we can test that there is an additional revision in the tool list
Additional revisions are only installed if there are multiple versions. If the revision is of the same version, then it will override the previous revision and not show up with get-tool-list.
CD-HIT was chosen because it was last updated more than 2 years ago. The last update before that was 5 years ago. It seems to be pretty stable. If it changes, it is not too hard to figure out why the tests fail.
If we really want to do this right, we use a docker image to start up a custom toolshed, upload a custom tool to it, and then test it. But I am not sure this is worth the effort. Personally I think the test as it is now is sufficient.
This avoids iterating over the same listy twice and deleting items from the list. Also should be more robust to empty sections.
|
@rhpvorderman I added some minor tweaks here: rhpvorderman#2 This works really well for me! |
Minor tweaks to robustness of shed-install --update
|
Will now work on making update a subcommand. |
|
Done with everything except the dummy tool. I do not have time to work on this though. (I only have uploaded one tool in the toolshed and that was some time ago, so this will take quite some time for me to get right again) Can somebody else pick this up? Or we could file an issue and leave this for a later date. I have altered the message at the top to reflect the further changes. |
|
This is a great Christmas present for the Galaxy community. Thanks a bunch @rhpvorderman! xref: #66 |
|
Simply great, awesome contribution @rhpvorderman, thank you! |
Solves #63
Shed-install was diversified into an
installandupdatecommand. The syntax now is changed.:shed-install [flags]->shed-tools install [flags]shed-tools updateThis uses built in functionality:
shed-installshed-tools installalready defaulted to the latest installable revision when no revision is given for a tool. The--latestflag forces this behaviour on all tools in the tool list. The latest revision will be installed regardless of the revision in the tool list.shed-install --updateshed-tools updatenow uses get_tool_list_from_galaxy to get a tool list from the existing galaxy as a dictionary. Then it does the same asshed-tools install --latest.To test all three possible methods of tool specifying for
shed-installshed-tools install,--revisionswas added to allow revisions installation from the command line.Some other changes had to be made to enable this.
shed-installshed-tools variables to be more readableshed-installshed-tools to reduce the file length. This includes the loggingOther nice changes that resulted from the refactoring:
shed-installshed-tools now use the same logging method. Logging can now also be extended to other tools.get_galaxy_connectionfunction was updated so it can optionally also use a file (i.e. a tool_list) to determine connection parameters.EDIT: 2017-11-27, add changes to reflect further changes.
EDIT: 2017-12-27, clarify that --latest works on the whole tool list.
The text was updated successfully, but these errors were encountered: