-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow use of external pipelines with Control.py #390
Conversation
…/CGATPipelines into AJBT-pipeline-control minor changes to config template
…/CGATPipelines into AJBT-pipeline-control cgatflow updates for external pieplines
…al pipelines through entry_point
CGATPipelines/Pipeline/Control.py
Outdated
f = sys._getframe(1) | ||
#caller = f.f_globals["__file__"] # cgatflow config | ||
# globals will get Control.py | ||
caller = f.f_locals["__file__"] # TO DO: cgatflow |
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.
@AndreasHeger
Do we need globals here instead of locals?
The module's namespace will get Control.py and breaks the rest of the changes.
locals seems to work OK but needs more tests.
If globals is needed let me know if you can think of a better way of calling external code.
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.
Not sure. There might have been python2/python3 issues here, but can't remember. Now with python3 only, not a problem any more.
CGATPipelines/Pipeline/Control.py
Outdated
for path in config_paths: | ||
if os.path.exists(path) and os.path.isdir(path): | ||
for f in os.listdir(os.path.abspath(path)): | ||
if fnmatch.fnmatch(f, 'pipeline*ini'): |
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.
This will pick up two pipeline.ini files e.g.:
https://github.com/CGATOxford/CGATPipelines/blob/master/CGATPipelines/pipeline_readqc/pipeline.ini
https://github.com/CGATOxford/CGATPipelines/blob/master/CGATPipelines/configuration/pipeline.ini
The specific pipeline ini file is picked up first though, might cause unintended issues elsewhere.
PS @sebastian-luna-valero |
Many thanks @antoniojbt The tests on travis do not run pipelines since the resources over there are quite limited (only a tiny virtual machine). However, we do so internally in our cluster with Jenkins but the testing results are not publicly accessible yet (only people with CGAT accounts can see it if they want to). I am planning to open it up at some point anyway. I have rerun the Jenkins tests for this branch. To make it work internally I had to create a
and all the tests passed. Having said that, rather than merging these changes into the master now, I would wait for the CGAT core code to come out, since all pipelines would need refactoring anyway after we move in that direction. |
@sebastian-luna-valero suggestions is sensible. |
Hi @sebastian-luna-valero and @AndreasHeger, What about merging only changes to Control.py and Cluster.py? That should mean that .cgat and .ini file defaults should run without the need to change anything. More generally, what's are the thoughts/plans at the moment for refactoring? Would switching this PR to CGATCore be better for instance? We could hold a second meeting if easier. I'd be keen on being able to continue working on CGAT code and external pipelines without too much worry. Happy to wait otherwise and run off a branch though. Antonio |
I think we could merge right now the changes for:
and leave out the changes for Are you happy with this @antoniojbt ? @AndreasHeger will announce it in due course -- pretty soon by the looks of it! ;) |
…/CGATPipelines into AJBT-pipeline-control conflicts in cluster.py
@sebastian-luna-valero |
…elines into AJBT-pipeline-control
Great, thanks @antoniojbt Before merging into the master branch, I just thought that adding Is that helpful? |
Hi @sebastian-luna-valero |
Hi @sebastian-luna-valero and @antoniojbt , in the past we used |
Thanks @AndreasHeger I have replaced |
Hi @sebastian-luna-valero, @Acribbs, @AndreasHeger,
I've made a few changes to Control.py in order to:
Changes are potentially breaking.
Could you please check carefully when possible?
Currently, we run pipelines with:
And possibly as:
This last one can be done easily if it is a python package with the correct entry point in its setup.py
I've tested changes with readqc and an external pipeline I'm working on:
pipeline_QTL
in a CentOS HPC and locally in a Mac.
The external pipeline can be installed with pip and ran as e.g.:
Most of its dependencies are already included in CGATPipelines. You might be missing r-docopt only. See:
https://raw.githubusercontent.com/EpiCompBio/pipeline_QTL/master/installation/Dockerfile
for detailed instructions. The Dockerfile itself is untested though.
Additionally, there are some very minor changes to make configuration files slightly more generic. These can be discarded. It may be a thought to have generic conf.py and pipeline.ini files if later transferring to CGAT core for instance.
Any thoughts, changes, errors, etc. please let me know.
Thanks!
Antonio