GithubHelp home page GithubHelp logo

toil_container's People

Contributors

ddomenico avatar jsmedmar avatar juanesarango avatar mflevine avatar multimeric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toil_container's Issues

Initial Update

Hi ๐Ÿ‘Š

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create separate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! ๐Ÿค–

Refactor the way options are provided

toil_container version: 1.1.6
Python version: 3.9.4
Operating System: Ubuntu 20.10

Description

Currently the most useful entry point to toil_container() is the call() function of ContainerJob. Unfortunately, it uses the options dictionary, which is defined at initialization time. This means that:

a) All options have to be known before the job actually runs. This is not always true, as bind mounts might be dynamic, and even the docker/singularity choice could be changed dynamically
b) We have to actually pass options every time we instantiate a job. This is verbose and not DRY.

New feature

I propose that we:

  • Extract containerJob.call out into a static function such as containerCall(). containerCall() then takes the "options" (docker/singularity, mounts etc) as an argument, and does not rely on self.options. This resolves my first point.
  • containerJob then uses containerCall() internally for backwards-compatibility (I have no intention to use containerJob myself, though)
  • Make containerCall() pull its default options directly from the Toil config object, accessed through self.jobStore.config from any given job. These can still be overridden by arguments. This system means that, if you have --singularity enabled, all jobs will automatically use singularity (by default) without having to pass options around (my second point above)

Unpin dependencies

Versions

  • toil_container version: 1.1.6
  • Python version: 3.9.4
  • Operating System: Ubuntu 20.10

Description

Currently all the versions of all dependencies are pinned:

"install_requires": [
"python-slugify==1.2.5",
"Click==6.7",
"docker==2.5.1",
"toil==3.18.0",
"requests==2.18.4"
],

This is unfortunate, as it means that it forces me to downgrade toil, docker etc just to install this library.

Good packaging practise [1], [2] dictates that library requirements should be as permissive/abstract as possible, to allow compatibility with other libraries. This can include an upper and lower bound, but pinning a specific version, and possibly even using ~=some_patch_version are problematic because they severely restrict the dependencies.

Do you think it might be possible to convert these pins to lower bounds? It may be necessary to also add upper bounds for things like Toil, but I'm willing to help fix this library to make it compatible if this is the case.

use `shell=True` in `subprocess.check_output`

Apparently there are some security issues by using shell=True. But without having it, we also lose a lot of features, like piping, wildcards (*), etc.

Example:

> !echo 'It Works' > tmp
> !cat tmp | xargs echo
It Works

> subprocess.check_output(['cat', 'tmp', '|', 'xargs', 'echo'])
CalledProcessError: Command '['cat', 'tmp', '|', 'xargs', 'echo']' returned non-zero exit status 1.

> subprocess.check_output('cat tmp | xargs echo', shell = True)
b'It Works\n'

A workaround can be done by using bash to run a script or command

> subprocess.check_output(['bash', '-c', 'cat tmp | xargs echo'])
b'It Works\n'

The question is if using bash -c <command> or bash <script> it's the same as shell=True. If it is, if we should add support as a param option.

Some good resource for this: https://stackoverflow.com/a/51950538/3949081

cc: @mflevine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.