Skip to content
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

A number of fixes and best-practice tweaks. #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dev_user_name: "{{ galaxy_user_name }}"
dev_user_group: "{{ galaxy_user_name }}"
dev_user_home: "/home/{{ dev_user_name }}"
dev_user_shellrc: "{{ dev_user_home }}/.bashrc"
dev_user_localrc: "{{ dev_user_home }}/.planemo-machine"

galaxy_vcs: git
galaxy_git_repo: https://github.com/galaxyproject/galaxy.git
Expand Down
113 changes: 61 additions & 52 deletions roles/galaxyprojectdotorg.devbox/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
# TODO: replace unneeded sudo and sudo_user attributes with user and group
# permissions
# TODO: break into smaller tasks - such as configuring all X stuff with a
# single command.

Expand Down Expand Up @@ -31,27 +29,17 @@
- supervisor
- nodejs
- npm
- r-base-core
- r-cran-getopt
- r-bioc-biocinstaller

# Setup atom (https://atom.io/) ppa and install.
- name: Add custom Galaxy PPA (used for atom package)
apt_repository: repo="ppa:webupd8team/atom" update_cache=yes
- name: Add custom PPAs
apt_repository: repo={{ item }} update_cache=yes
when: galaxy_devbox_include_x

# Setup komodo-edit ppa and install.
- name: Add custom PPA (used for komodo-edit package)
apt_repository: repo="ppa:mystic-mirage/komodo-edit" update_cache=yes
when: galaxy_devbox_include_x

- name: Install the debs (X11 environment)
apt: name={{ item }} state=latest update_cache=yes
with_items:
- atom
- komodo-edit
- xfce4-xkb-plugin
- gedit
- xubuntu-core
- firefox
when: galaxy_devbox_include_x
- "ppa:webupd8team/atom"
- "ppa:mystic-mirage/komodo-edit"

- name: Add Google key for Chrome installation
apt_key:
Expand All @@ -65,10 +53,16 @@
state: present
when: galaxy_devbox_include_x

- name: Install Chrome Stable
apt:
name: google-chrome-stable
state: latest
- name: Install the debs (X11 environment)
apt: name={{ item }} state=latest update_cache=yes
with_items:
- google-chrome-stable
- komodo-edit
- atom
- xfce4-xkb-plugin
- gedit
- xubuntu-core
- firefox
when: galaxy_devbox_include_x

- name: Ensures /etc/lightdm/lightdm.conf.d/ dir exists
Expand All @@ -83,10 +77,15 @@
become_user: "{{ dev_user_name }}"
shell: "ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)\""

- name: Download vim extras
get_url: url=http://j.mp/spf13-vim3 dest={{ dev_user_home }}/vimextras.sh
become: True
become_user: "{{ dev_user_name }}"

- name: Install vim extras
become: True
become_user: "{{ dev_user_name }}"
shell: "curl http://j.mp/spf13-vim3 -L -o - | sh"
shell: "sh {{ dev_user_home }}/vimextras.sh"

- name: Tap galaxyproject recipes
become: True
Expand Down Expand Up @@ -129,34 +128,17 @@
become_user: "{{ dev_user_name }}"
shell: "{{ dev_user_home }}/.linuxbrew/bin/brew install -v bash-completion"

# TODO: MANPATH, INFOPATH
- name: Add linuxbrew to dev users PATH
lineinfile: "dest={{ dev_user_shellrc }} line='export PATH={{ dev_user_home }}/.linuxbrew/bin:$PATH'"

- name: Source linuxbrew bash completions
lineinfile: "dest={{ dev_user_shellrc }} line='. {{ dev_user_home }}/.linuxbrew/etc/bash_completion'"

- name: Install the dev tools
apt: name={{ item }} state=latest update_cache=yes
with_items:
- emacs24-nox

- name: Install node and npm
apt: name={{ item }} state=latest update_cache=yes
with_items:
- nodejs
- npm

- name: Start supervisord on boot
service: name=supervisor enabled=yes

- name: activate supervisor on boot, the shell way
- name: Start supervisord on boot.
become: True
shell: "systemctl enable supervisor.service"

- name: Link nodejs to node
become: True
shell: "ln -f -s /usr/bin/nodejs /usr/bin/node"
file: path=/usr/bin/node state=link src=/usr/bin/nodejs

- name: Install more locales
locale_gen: name={{ item }} state=present
Expand Down Expand Up @@ -188,11 +170,16 @@
become: True
shell: "rm -f /etc/update-motd.d/9*"

- name: "Ensure that planemo-machine's environment settings are applied."
lineinfile: dest={{ dev_user_home }}/.bashrc line='[[ -f $HOME/.planemo-machine ]] && . $HOME/.planemo-machine'

- name: "Add the local environment settings."
template: src=planemo-machine.sh.j2 dest={{ dev_user_home }}/.planemo-machine
template: src=planemo-machine.sh.j2 dest={{ dev_user_localrc }}

# TODO: INFOPATH
- name: Update the shell environment
lineinfile: "{{ item }}"
with_items:
- "dest={{ dev_user_shellrc }} line='[[ -f {{ dev_user_localrc }} ]] && . {{ dev_user_localrc }}'"
- "dest={{ dev_user_localrc }} line='export PATH={{ dev_user_home }}/miniconda2/bin:{{ dev_user_home }}/.linuxbrew/bin:$PATH'"
- "dest={{ dev_user_localrc }} line='. {{ dev_user_home }}/.linuxbrew/etc/bash_completion'"

- name: "Update login notifications."
become: True
Expand All @@ -205,15 +192,37 @@
file: path={{ dev_user_home }}/.config/xfce4/xfconf/xfce-perchannel-xml state=directory owner={{ dev_user_name }} group={{ dev_user_group }}

- name: Download miniconda
get_url: url=https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh dest={{ dev_user_home }}/Miniconda-latest-Linux-x86_64.sh
become: True
become_user: "{{ dev_user_name }}"
shell: "cd {{ dev_user_home }} && curl https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -L -o miniconda.sh && bash miniconda.sh -b"

- name: Add miniconda bin to PATH.
lineinfile: "dest={{ dev_user_shellrc }} line='export PATH=$PATH:{{ dev_user_home }}/miniconda2/bin/'"
- name: Install miniconda
become: True
become_user: "{{ dev_user_name }}"
shell: "bash {{ dev_user_home }}/Miniconda-latest-Linux-x86_64.sh -b"

- name: "Add the keyboard layout switcher to the panel."
template: src=xfce4-panel.xml.j2 dest={{ dev_user_home }}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
become: True
become_user: "{{ dev_user_name }}"
when: galaxy_devbox_include_x

- name: "Install R libraries"
become: True
shell: "R -e 'library(BiocInstaller); biocLite(c(\"{{ item }}\"))'"
with_items:
- Rgraphviz
- motifbreakR

- name: "Clean up temporary files"
become: True
file: path={{ item }} state=absent
with_items:
- "{{ dev_user_home }}/Miniconda-latest-Linux-x86_64.sh"
- "{{ dev_user_home }}/vimextras.sh"

- name: "Autoremove apt packages"
become: True
shell: "apt-get -y autoremove"

- name: "Clean the apt cache"
become: True
shell: "apt-get -y clean"
14 changes: 13 additions & 1 deletion roles/galaxyprojectdotorg.devbox/templates/planemo-machine.sh.j2
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
export GALAXY={{ galaxy_root }}
export GALAXY={{ galaxy_root }}

if [[ -z $PYTHONPATH ]] ; then
export PYTHONPATH={{ dev_user_home }}/miniconda2/lib/python2.7
else
export PYTHONPATH={{ dev_user_home }}/miniconda2/lib/python2.7:$PYTHONPATH
Copy link
Member

Choose a reason for hiding this comment

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

This is scary - why this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So that it doesn't stomp previously defined PYTHONPATH additions.

Copy link
Member

Choose a reason for hiding this comment

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

I don't get why we are doing anything with the Python path at all I mean. Also you are putting conda ahead of system Python on the path - this breaks things. I'd just stick with adding conda to the path, but at the end and not touch Python path (unless there is a documented reason).

fi

if [[ -z $MANPATH ]] ; then
export MANPATH={{ dev_user_home }}/.linuxbrew/share/man
else
export MANPATH={{ dev_user_home }}/.linuxbrew/share/man:$MANPATH
fi