Page MenuHomePhabricator

Install composer on tools-login
Closed, ResolvedPublic

Description

This makes installation of web services written in PHP a lot easier since right now one can't do "git clone .." followed by "composer install".

"npm", for example, is installed. Would be nice to have composer as well.

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added projects: Toolforge, Cloud-Services.
Krinkle added subscribers: Krinkle, yuvipanda.

Is there a Debian package for it?

Krinkle renamed this task from Install composer on tools-bation to Install composer on tools-login.Aug 11 2015, 5:41 AM
Krinkle set Security to None.

Work around:

$ ssh tools-login
$ become mytool
# https://getcomposer.org/download/
$ mkdir bin
$ curl -sS https://getcomposer.org/installer | php -- --install-dir=bin --filename=composer
# Now installed in ~/bin/composer
# Make sure your bash PATH includes "$HOME/bin". Set in .bashrc if needed.
$ which composer
# /data/project/:tool/bin/composer

Now composer is available to e.g.

(mytool at tools-login in ~)$ cd my-repo
(mytool at tools-login in ~/my-repo)$ composer install --no-dev

After discussing with @Joe and @hashar:

  • backporting the package to precise and trusty is probably difficult.
  • to solve the issue on the integration cluster, https://github.com/wikimedia/integration-composer is used (git checkout, then use /srv/deployment/integration/composer/vendor/bin/composer)

We could use the latter method for tool labs as well. See https://github.com/wikimedia/operations-puppet/blob/00c433345214115e5a5b05eb6d83eedabfbf7110/modules/contint/manifests/slave-scripts.pp#L29 and https://github.com/wikimedia/operations-puppet/blob/acacf97e2df962fef83487a461f3559fa07e4d6f/modules/extdist/manifests/init.pp#L74 for current usage.

A few things I tried.

  • building an fpm package from the integration/composer repo works: https://gerrit.wikimedia.org/r/#/c/240451/
    • but might not be an improvement over just using git co, unless we can automate it
  • backporting is more of an issue

Backporting log for @hashar:

  • sudo apt-get install devscripts debian-keyring equivs

jsonlint:

after hacking the debian/rules, changing the version parsing to

| sed 's/.*(//' | sed 's/).*//')
  • fakeroot debian/rules binary

works, but

  • dpkg-buildpackage -us -uc

fails

  • After rm bin/jsonlint-php, I can build (but of course not sign). But lintian jsonlint_1.3.1-2~toollabs1+1_all.deb passes! Good.

(this is after ca. 50 minutes of fiddling...)

php-cli-prompt:

worked immediately.

json-schema: same sed issue, but works with the same hack

composer:

This took me > 1 hour, so I gave up at this point.

Let's just do the git checkout + symlink option via puppet? We can make it a composer::install class or something and include it in both tools and integration

Change 246072 had a related patch set uploaded (by Merlijn van Deen):
toollabs: add composer to dev hosts

https://gerrit.wikimedia.org/r/246072

Change 246072 merged by Yuvipanda:
toollabs: add composer to dev hosts

https://gerrit.wikimedia.org/r/246072

valhallasw claimed this task.
Notice: /Stage[main]/Toollabs::Composer/File[/srv/composer]/ensure: created
Notice: /Stage[main]/Toollabs::Composer/Git::Clone[composer]/Exec[git_clone_composer]/returns: executed successfully
Notice: /Stage[main]/Toollabs::Composer/File[/usr/local/bin/composer]/ensure: created
valhallasw@tools-bastion-01:~$ composer --version
Composer version @package_branch_alias_version@ (@package_version@) @release_date@

uuuuh. According to the git log it's version 1.0.0-alpha10.