Page MenuHomeDevCentral

Add to Jenkins a second unprivileged test container
Closed, ResolvedPublic

Description

When working on the Notifications Center, I queue changes by pair (one for Differential, one on commit). Two executors would be nice.

Revisions and Commits

Event Timeline

This comment was removed by dereckson.
/usr/local/bin/run-ci-slave
#!/bin/sh

docker run -dt -P -v /data/jenkins/slave_home:/home/app nasqueron/jenkins-slave-php

I don't see the point to mount this volume on an external repository for unprivileged containers (for privileged, that could be to store credentials).

Issue is the workspace folder shouldn't be shared as it contains current application code: if the two containers modify the same test folder, that would create conflicts.

Container name: naughty_nobel
SSH port: 32770


Operations log

On Dwellers:

$ docker run -dt -P nasqueron/jenkins-slave-php
8d1f9bee4fa7b2c7851cbfe45559af06d26dfd1187a50f7c6120bd116ea865db
$ docker ps | grep 8d1f9bee4fa7
8d1f9bee4fa7        nasqueron/jenkins-slave-php   "/usr/sbin/sshd -D"      12 seconds ago      Up Less than a second   0.0.0.0:32770->22/tcp                                                                                                                                                                                              naughty_nobel
$ docker cp /data/jenkins/slave_home/.ssh naughty_nobel:/home/app/.ssh
$ docker exec naughty_nobel chown -R app:app /home/app/

On Jenkins:

  1. Manage Jenkins > Manager Nodes > New Node
  2. Copy from silly_bardeen
  3. Put naughty_nobel name on name, host

By the way, I would suggest for next containers to discard totally -P.

We don't need execution from outside world and if it's handy to have access to a node to debug workspace updates issues (e.g. Composer library update issues in a PHP workspace), that could also be through a connection to the Docker Engine, then a docker exec.

[test-notifications-phab] $ arc patch --diff 654 --nocommit --nobranch ****
java.io.IOException: Cannot run program "arc" (in directory "/home/app/workspace/test-notifications-phab"): error=2, No such file or directory

dereckson closed this task as Resolved.EditedFeb 9 2016, 19:40

On the container

$ cd /opt
$ git clone https://github.com/phacility/libphutil.git
$ git clone https://github.com/phacility/arcanist.git
$ ln -s /opt/arcanist/bin/arc /usr/local/bin/arc

Test from Jenkins

Building remotely on naughty_nobel (php) in workspace /home/app/workspace/test-notifications-phab
[...]
[test-notifications-phab] $ arc patch --diff 654 --nocommit --nobranch ********
Checking patch tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php...
Applied patch tests/Analyzers/GitHub/GitHubPayloadAnalyzerTest.php cleanly.
 OKAY  Successfully applied patch.
[...]

XDebug missing too.

dereckson raised the priority of this task from Normal to High.Feb 10 2016, 01:56