Skip to content

[16.01] Allow override of job shell (for conda resolver).#1473

Merged
bgruening merged 3 commits intogalaxyproject:release_16.01from
jmchilton:job_shell
Jan 14, 2016
Merged

[16.01] Allow override of job shell (for conda resolver).#1473
bgruening merged 3 commits intogalaxyproject:release_16.01from
jmchilton:job_shell

Conversation

@jmchilton
Copy link
Member

common_startup assumes bashisms anyway. I'm making more things configurable in case someday the BSD user wants to use Galaxy - the default shell for jobs can be configured at the galaxy or job destination level now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/getattr(self.app.config, 'default_job_shell', DEFAULT_JOB_SHELL)/self.app.config.get('default_job_shell', DEFAULT_JOB_SHELL)/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    def get( self, key, default ):
        return self.config_dict.get( key, default )

I strongly prefer my version. I want the processed value on the config object itself. Also, I like my access pattern assumes less about config in terms of a required interface.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if they are not equivalent in this case, then that should be fixed. Isn't it the whole point of an interface to hide where the property is actually stored?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this particular case because the property is a string and the config property matches the name in galaxy.ini - these two are likely equivalent. But for booleans, numbers, etc... the config object attributes and not the dictionary contains the processed value - it is however for this reason that the canonical source of the information should be assumed to be the object attribute.

Most places in the code that I have seen access config options as attributes and via .get() - I don't think this is a problem and I don't think we promise get() does anything other than access the raw values in a dictionary like way. Instead of modifying get, I would rather see code that accesses config options this way access them via attributes instead.

@nsoranzo
Copy link
Member

It seems to me that scripts/common_startup.sh does not contain bashisms, and seems to work after s|/bin/bash|/bin/sh| under Ubuntu dash.

@jmchilton
Copy link
Member Author

@nsoranzo I'll rebase with a new comment - that was information @natefoo had passed along which I guess is wrong (... or is it possible dash implements some bashisms on top of sh)?

@jmchilton
Copy link
Member Author

Updated the comment.

I had to modify one test tool because this breaks backward compatiblity on how the literal \t characters are handled jmchilton@e8b6b9e. dash will replace these with a tab in strings - bash requires more work.

We could alternatively replace instances of \t in command with tab. Before doing that, I'll see if I can find a bash option to fix this.

Update: bash --posix doesn't fix this.

@jmchilton
Copy link
Member Author

@nsoranzo You care a good deal about backward compatibility - what do you think about the fact that we need to make the change. Are you okay with it, since the original shell foo I was using wasn't very portable?

Update: I'll switch to the printf version.

@nsoranzo
Copy link
Member

@jmchilton Isn't that just in a test?

@jmchilton
Copy link
Member Author

I mean the test is indicating the PR is changing the behavior of Galaxy tools in a backward incompatible way. Is it okay to change Galaxy because the tool was poorly written and not very portable.

@nsoranzo
Copy link
Member

Probably the default shell should remain '/bin/sh' since conda is not in real use yet and conda may be fixed to support other shells in the mean time.

@jmchilton
Copy link
Member Author

Ping @bgruening - do you thing we should delay the default switch one release or fix conda now?

@bgruening
Copy link
Member

Sorry was travelling. We ship conda with this release so I would welcome the switch, but I can understand the concerns from @nsoranzo.

@nsoranzo do you have any insider news about anaconda to support /bin/sh in the near future?

Following suggestion: We leave bash for this release but deprecate it and announce the switch for the next release. Hopefully a few galaxy-admins will test this during this release cycle and provide feedback.
If we do this we should include a small text to the conda_auto_install config entry and state that the shell should be set to /bin/bash.

I don't think this switch is will case much trouble as most of us already using bash but we probably don't know. This is a SL6.6:

[galaxy@cn066 ~]$ ls -l /bin/sh 
lrwxrwxrwx 1 root root 4  4. Feb 2015  /bin/sh -> bash
[galaxy@cn066 ~]$ uname -a
Linux cn066.bi.uni-freiburg.de 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 08:24:23 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
[galaxy@cn066 ~]$ cat /etc/lsb-release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

@jmchilton jmchilton changed the title [16.01] Switch to bash as default shell (for conda resolver). [16.01] Allow override of job shell (for conda resolver). Jan 12, 2016
@jmchilton
Copy link
Member Author

Okay - switched the default back but this fix is still required for conda to work so I think this PR should still be merged and I would propose docker-galaxy-stable and usegalaxy.org switch the default to /bin/bash for this release cycle.

@bgruening
Copy link
Member

Indeed! I will make this default in Docker!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/switched/not switched/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, sorry about that.

@nsoranzo
Copy link
Member

@bgruening No, I don't have any news, actually I've never used conda!

@nsoranzo
Copy link
Member

👍

@galaxybot galaxybot added this to the 16.04 milestone Jan 13, 2016
@hexylena hexylena removed the triage label Jan 13, 2016
jmchilton added a commit to galaxyproject/planemo that referenced this pull request Jan 14, 2016
Use user's conda environment for planemo - this way if conda_init, conda_install will setup subsequent test and serve calls. Also use /bin/bash as the default job shell - requires merging galaxyproject/galaxy#1473.
I'm making more things configurable in case someday the BSD user wants to use Galaxy - the default shell for jobs can be configured at the galaxy or job destination level now.
dash will convert the literal characters \t to a tab, bash doesn't seem to do this. Use portable printf as suggested by nicola.
@bgruening
Copy link
Member

@galaxybot test this

@bgruening
Copy link
Member

@erasche the assigned milestone is wrong
@jmchilton we need a rebase here

Thanks!

@jmchilton
Copy link
Member Author

@bgruening It has been rebased, thanks for the heads up.

bgruening added a commit that referenced this pull request Jan 14, 2016
[16.01] Allow override of job shell (for conda resolver).
@bgruening bgruening merged commit be4ddb2 into galaxyproject:release_16.01 Jan 14, 2016
@bgruening
Copy link
Member

Thanks @jmchilton and @nsoranzo!

@jmchilton
Copy link
Member Author

Thanks for the detailed review @nsoranzo and the merge @bgruening.

@jmchilton jmchilton deleted the job_shell branch January 14, 2016 12:36
@natefoo
Copy link
Member

natefoo commented Jan 14, 2016

Could you create an issue on usegalaxy-playbook noting the need for a config change on Test/Main please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants