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

Standardize python setup, ensure homu gets python3 #148

Merged
merged 3 commits into from Feb 11, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -19,16 +19,16 @@ regardless of the number of packages.
*Unsafe*:

```salt
buildbot-dependencies:
pip.installed:
- name: buildbot == 0.8.12
essential-dependencies:
pkg.installed:
- name: cowsay

This comment has been minimized.

Copy link
@Manishearth

Manishearth Feb 11, 2016

Member
 _____________________________________ 
< a very essential dependency, indeed >
 ------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
```

*Better*:

```salt
buildbot-dependencies:
pip.installed:
essential-dependencies:
pkg.installed:
- pkgs:
- buildbot == 0.8.12
- cowsay
```
@@ -23,7 +23,10 @@ android-dependencies:
- libgl1-mesa-dev
- refresh: True
pip.installed:
- name: s3cmd
- pkgs:
- s3cmd
- require:
- pkg: pip

android-sdk:
archive.extracted:
@@ -1,20 +1,18 @@
buildbot:
buildbot-master:
pip.installed:
- pkgs:
- buildbot == 0.8.12
- service_identity == 14.0.0

txgithub:
pip.installed

boto:
pip.installed

buildbot-master:
- txgithub == 15.0.0
- boto == 2.38.0
- require:
- pkg: pip
service.running:
- enable: True
- require:
- pip: buildbot
- watch:
- pip: buildbot-master
- file: /home/servo/buildbot/master
- file: /etc/init/buildbot-master.conf

/home/servo/buildbot/master:
file.recurse:
@@ -24,30 +22,20 @@ buildbot-master:
- group: servo
- dir_mode: 755
- file_mode: 644
- watch_in:
- service: buildbot-master

/etc/init/buildbot-master.conf:
file.managed:
- source: salt://buildbot/buildbot-master.conf
- user: root
- group: root
- mode: 644
- watch_in:
- service: buildbot-master

buildbot-github-listener:
service.running:
- enable: True

/usr/local/bin/github_buildbot.py:
file.managed:
- source: salt://buildbot/github_buildbot.py
- user: root
- group: root
- mode: 755
- watch_in:
- service: buildbot-github-listener

/etc/init/buildbot-github-listener.conf:
file.managed:
@@ -56,5 +44,10 @@ buildbot-github-listener:
- user: root
- group: root
- mode: 644
- watch_in:
- service: buildbot-github-listener

buildbot-github-listener:
service.running:
- enable: True
- watch:
- file: /usr/local/bin/github_buildbot.py
- file: /etc/init/buildbot-github-listener.conf
@@ -1,9 +1,11 @@
{% from 'common/map.jinja' import config as common with context %}
buildbot-slave.pip:
buildbot-slave-dependencies:
pip.installed:
- pkgs:
- buildbot-slave == 0.8.12
- require:
- pkg: pip
{{ common.servo_home }}/buildbot/slave:
file.recurse:
@@ -1,13 +1,35 @@
{% from tpldir ~ '/map.jinja' import config with context %}
{% if grains['kernel'] != 'Darwin' %}
python-pkgs:
python2:
pkg.installed:
- pkgs:
- python
{% if grains['os'] == 'Ubuntu' %}
python2-dev:
pkg.installed:
- pkgs:
- python-pip
- python-dev
{% endif %}
pip:
pkg.installed:
- pkgs:
{% if grains['os'] == 'Ubuntu' %}
- python-pip
{% elif grains['os'] == 'MacOS' %}
- python # pip is included with python in homebrew
{% endif %}
- reload_modules: True
# Virtualenv package creates virtualenv and virtualenv-3.4 executables
virtualenv:
pip.installed:
- pkgs:
- virtualenv
- require:
- pkg: pip
servo:
user.present:
- fullname: Tom Servo
@@ -1,44 +1,47 @@
https://github.com/servo/homu:
python3:
pkg.installed:
- pkgs:
- python3

homu:
git.latest:
- name: https://github.com/servo/homu
- rev: e07f74e7a3a185768e71639d6a328ef8ea234f92
- target: /home/servo/homu
- user: servo
- require_in:
- pip: install_homu

/home/servo/homu/cfg.toml:
file.managed:
- source: salt://homu/cfg.toml
- template: jinja
- user: servo
- group: servo
- mode: 644
- watch_in:
- service: homu

/home/servo/homu/_venv:
virtualenv.managed:
- name: /home/servo/homu/_venv
- venv_bin: virtualenv-3.4
- python: python3

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Nov 4, 2015

Author Member

@Manishearth the venv_bin option is what tells salt to use virtualenv-3.4, and the python option tells virtualenv to install python3 (and pip3) inside the virtualenv.

This comment has been minimized.

Copy link
@Manishearth

Manishearth Nov 4, 2015

Member

Oh, right, I didn't notice that, sorry 😄

- system_site_packages: False
- require_in:
- pip: install_homu

install_homu:
- require:
- pkg: python3
- pip: virtualenv
pip.installed:
- bin_env: /home/servo/homu/_venv
- editable: /home/servo/homu

homu:
- require:
- git: homu
- virtualenv: /home/servo/homu/_venv
service.running:
- enable: True
- require:
- pip: install_homu
- pip: homu
- watch:
- file: /home/servo/homu/cfg.toml
- file: /etc/init/homu.conf

/home/servo/homu/cfg.toml:
file.managed:
- source: salt://homu/cfg.toml
- template: jinja
- user: servo
- group: servo
- mode: 644

/etc/init/homu.conf:
file.managed:
- source: salt://homu/homu.conf
- user: root
- group: root
- mode: 644
- watch_in:
- service: homu
@@ -2,7 +2,7 @@ nginx:
pkg.installed: []
service.running:
- enable: True
- require:
- watch:
- pkg: nginx

/etc/nginx/sites-available/default:
@@ -28,8 +28,10 @@ servo-dependencies:
{% endif %}
pip.installed:
- pkgs:
- virtualenv
- ghp-import
- require:
- pkg: pip
- pip: virtualenv
{% if grains['kernel'] == 'Darwin' %}
# Workaround for https://github.com/saltstack/salt/issues/26414
@@ -9,7 +9,6 @@ xvfb:
pkg.installed: []
service.running:
- enable: True
- require:
- pkg: xvfb
- watch:
- pkg: xvfb
- file: /etc/init/xvfb.conf
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.