Skip to contentSkip to conversation

docker: allow running "docker-travis" with arbitrary parallelism

PATCH In review Paolo Bonzini 2 participants 7 messages Jul 14, 2017

lore
Share & tools
lore
#0 lore raw

cover docker: allow running "docker-travis" with arbitrary parallelism

docker-travis is limited to the -j3 flag specified for running on the SaaS Travis CI infrastructure.

When running the test matrix locally with docker, however, we can run much more jobs at the same time on a suitably beefy server. Let people do that with the usual J=nn option already supported by the other docker-based tests.

Paolo

Paolo Bonzini (2):
docker: allow customizing Travis global_env variables
travis: move make -j flag out of script

 .travis.yml            | 3 ++-
 tests/docker/travis.py | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
2.13.0
#1 lore raw

PATCH 1/2 docker: allow customizing Travis global_env variables

This is useful so that we can do builds at higher than -j3 when running travis.py locally.

---
 tests/docker/travis.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/docker/travis.py +3 -3
index 8dcc964da4..703a7fde85 100755
@@ -21,13 +21,12 @@ def load_yaml(fname):
 def conf_iter(conf):
     def env_to_list(env):
         return env if isinstance(env, list) else [env]
-    global_env = conf["env"]["global"]
     for entry in conf["matrix"]["include"]:
-        yield {"env": global_env + env_to_list(entry["env"]),
+        yield {"env": env_to_list(entry["env"]),
                "compiler": entry["compiler"]}
     for entry in itertools.product(conf["compiler"],
                                    conf["env"]["matrix"]):
-        yield {"env": global_env + env_to_list(entry[1]),
+        yield {"env": env_to_list(entry[1]),
                "compiler": entry[0]}
 
 def main():
@@ -35,6 +34,7 @@ def main():
         sys.stderr.write("Usage: %s <travis-file>\n" % sys.argv[0])
         return 1
     conf = load_yaml(sys.argv[1])
+    print "\n".join((": ${%s}" % var for var in conf["env"]["global"]))
     for config in conf_iter(conf):
         print "("
         print "\n".join(config["env"])
Signature · 1 line
2.13.0
#2 lore raw

PATCH 2/2 travis: move make -j flag out of script

In reply to Paolo Bonzini

Because global environment variables can be overridden when .travis.yml is processed by the docker-travis target, the effect of this patch is that docker-travis now obeys the "J=n" option.

---
 .travis.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.travis.yml +2 -1
index 27a2d9cfb3..6809e25eca 100644
@@ -46,6 +46,7 @@ notifications:
 env:
   global:
     - TEST_CMD="make check"
+    - MAKEFLAGS="-j3"
   matrix:
     - CONFIG=""
     - CONFIG="--enable-debug --enable-debug-tcg --enable-trace-backends=log"
@@ -64,7 +65,7 @@ before_install:
 before_script:
   - ./configure ${CONFIG}
 script:
-  - make -j3 && ${TEST_CMD}
+  - make ${MAKEFLAGS} && ${TEST_CMD}
 matrix:
   include:
     # Test with CLang for compile portability
Signature · 1 line
2.13.0
#3 lore raw
In reply to Paolo Bonzini
Quoted 7 lines · Paolo Bonzini

docker-travis is limited to the -j3 flag specified for running on the SaaS Travis CI infrastructure.

When running the test matrix locally with docker, however, we can run much more jobs at the same time on a suitably beefy server. Let people do that with the usual J=nn option already supported by the other docker-based tests.

Eh, I was debugging stuff on our beefy server with J=20 and then I realised I was just running:

make docker-test-quick@travis J=20

So I guess some people do use the pseudo Travis expansion then?

Quoted 10 lines

Paolo

Paolo Bonzini (2):
docker: allow customizing Travis global_env variables
travis: move make -j flag out of script

 .travis.yml            | 3 ++-
 tests/docker/travis.py | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

--
Alex Bennée

#4 lore raw
Quoted 11 lines · Alex Bennée
Quoted 7 lines · Paolo Bonzini

docker-travis is limited to the -j3 flag specified for running on the SaaS Travis CI infrastructure.

When running the test matrix locally with docker, however, we can run much more jobs at the same time on a suitably beefy server. Let people do that with the usual J=nn option already supported by the other docker-based tests.

Quoted 6 lines

Eh, I was debugging stuff on our beefy server with J=20 and then I realised I was just running:

make docker-test-quick@travis J=20

So I guess some people do use the pseudo Travis expansion then?

How would that end up running tests/docker/travis?

Paolo

Quoted 15 lines
Quoted 10 lines

Paolo

Paolo Bonzini (2):
docker: allow customizing Travis global_env variables
travis: move make -j flag out of script

 .travis.yml            | 3 ++-
 tests/docker/travis.py | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

--
Alex Bennée

#5 lore raw
Quoted 12 lines · Paolo Bonzini
Quoted 11 lines · Alex Bennée
Quoted 7 lines · Paolo Bonzini

docker-travis is limited to the -j3 flag specified for running on the SaaS Travis CI infrastructure.

When running the test matrix locally with docker, however, we can run much more jobs at the same time on a suitably beefy server. Let people do that with the usual J=nn option already supported by the other docker-based tests.

Quoted 8 lines
Quoted 6 lines

Eh, I was debugging stuff on our beefy server with J=20 and then I realised I was just running:

make docker-test-quick@travis J=20

So I guess some people do use the pseudo Travis expansion then?

How would that end up running tests/docker/travis?

It runs the normal build and make check but in the Travis build environment. Essentially the .travis.yml is just a bunch of alternative configure invocations, there is nothing to stop you manually setting up a build with TARGET_LIST and EXTRA_CONFIGURE_OPTS which is what I do if there is a particular Travis test which is failing.

Quoted 18 lines

Paolo

Quoted 15 lines
Quoted 10 lines

Paolo

Paolo Bonzini (2):
docker: allow customizing Travis global_env variables
travis: move make -j flag out of script

 .travis.yml            | 3 ++-
 tests/docker/travis.py | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

--
Alex Bennée

--
Alex Bennée

#6 lore raw
Quoted 22 lines · Alex Bennée
Quoted 19 lines · Paolo Bonzini
Quoted 17 lines · Alex Bennée
Quoted 7 lines · Paolo Bonzini

docker-travis is limited to the -j3 flag specified for running on the SaaS Travis CI infrastructure.

When running the test matrix locally with docker, however, we can run much more jobs at the same time on a suitably beefy server. Let people do that with the usual J=nn option already supported by the other docker-based tests.

Eh, I was debugging stuff on our beefy server with J=20 and then I realised I was just running:

make docker-test-quick@travis J=20

So I guess some people do use the pseudo Travis expansion then?

Quoted 7 lines
Quoted 1 line

How would that end up running tests/docker/travis?

It runs the normal build and make check but in the Travis build environment. Essentially the .travis.yml is just a bunch of alternative configure invocations, there is nothing to stop you manually setting up a build with TARGET_LIST and EXTRA_CONFIGURE_OPTS which is what I do if there is a particular Travis test which is failing.

This is different, I want to run all Travis builds to ensure I don't break one before going on vacation. :)

Paolo