[152490] contrib/buildbot-test

Ryan Schmidt ryandesign at macports.org
Sun Sep 11 19:17:28 PDT 2016


> On Sep 11, 2016, at 7:34 AM, raimue at macports.org wrote:
> 
> Revision
> 152490
> Author
> raimue at macports.org
> Date
> 2016-09-11 05:34:55 -0700 (Sun, 11 Sep 2016)
> Log Message
> 
> buildbot: move build platforms to slaves.json
> Modified Paths
> 
> 	• contrib/buildbot-test/master.cfg
> 	• contrib/buildbot-test/slaves.json.sample
> Diff
> 
> Modified: contrib/buildbot-test/master.cfg (152489 => 152490)
> 
> --- contrib/buildbot-test/master.cfg	2016-09-11 11:07:27 UTC (rev 152489)
> +++ contrib/buildbot-test/master.cfg	2016-09-11 12:34:55 UTC (rev 152490)
> 
> @@ -43,9 +43,6 @@
> 
>  path_base  = "/usr/bin:/bin:/usr/sbin:/sbin"
> 
>  path_ports = os.path.join(toolsprefix, "bin") + ":" + path_base
> 
>  
> 
> -# TODO: the following list should be configured in slaves.json
> -build_platforms = ["10.6_x86_64", "10.6_x86_64_legacy", "10.6_i386", "10.6_i386_legacy", "10.7_x86_64", "10.7_x86_64_legacy", "10.8_x86_64", "10.8_x86_64_legacy", "10.9_x86_64", "10.10_x86_64", "10.11_x86_64"]
> -
> 
>  # Allow spaces and tabs in property values
> 
>  import re
> 
>  c['validation'] = {
> 
> @@ -64,7 +61,11 @@
> 
>  
> 
>  with open(_path('slaves.json')) as f:
> 
>      slavedata = json.load(f)
> 
> -for slave, pwd in slavedata.items():
> 
> +
> +# convert unicode to byte strings
> +build_platforms = [s.encode('utf-8') for s in slavedata['build_platforms']]
> +
> +for slave, pwd in slavedata['slaves'].items():
> 
>      c['slaves'].append(BuildSlave(slave, pwd))
> 
>  
> 
>  
> 
> @@ -438,7 +439,7 @@
> 
>  # XXX: slavenames assignment should be automatic and more generic
> 
>  portsslaves = {}
> 
>  baseslaves = {}
> 
> -slavenames = slavedata.keys()
> 
> +slavenames = slavedata['slaves'].keys()
> 
>  for plat in build_platforms:
> 
>      baseslaves[plat]  = filter(lambda x: x.endswith(plat+"-base"),  slavenames)
> 
>      portsslaves[plat] = filter(lambda x: x.endswith(plat+"-ports"), slavenames)
> 
> Modified: contrib/buildbot-test/slaves.json.sample (152489 => 152490)
> 
> --- contrib/buildbot-test/slaves.json.sample	2016-09-11 11:07:27 UTC (rev 152489)
> +++ contrib/buildbot-test/slaves.json.sample	2016-09-11 12:34:55 UTC (rev 152490)
> 
> @@ -1,19 +1,34 @@
> 
>  {
> 
> -    "base-10.6_x86_64": "",
> -    "ports-10.6_i386": "",
> -    "ports-10.6_i386_legacy": "",
> -    "ports-10.6_x86_64": "",
> -    "ports-10.6_x86_64_legacy": "",
> -    "base-10.7_x86_64": "",
> -    "ports-10.7_x86_64": "",
> -    "ports-10.7_x86_64_legacy": "",
> -    "base-10.8_x86_64": "",
> -    "ports-10.8_x86_64": "",
> -    "ports-10.8_x86_64_legacy": "",
> -    "base-10.9_x86_64": "",
> -    "ports-10.9_x86_64": "",
> -    "base-10.10_x86_64": "",
> -    "ports-10.10_x86_64": "",
> -    "base-10.11_x86_64": "",
> -    "ports-10.11_x86_64": ""
> 
> +    "build_platforms": [
> +        "10.6_x86_64",
> +        "10.6_x86_64_legacy",
> +        "10.6_i386",
> +        "10.6_i386_legacy",
> +        "10.7_x86_64",
> +        "10.7_x86_64_legacy",
> +        "10.8_x86_64",
> +        "10.8_x86_64_legacy",
> +        "10.9_x86_64",
> +        "10.10_x86_64",
> +        "10.11_x86_64"
> +    ],
> +    "slaves": {
> +        "base-10.6_x86_64": "",
> +        "ports-10.6_i386": "",
> +        "ports-10.6_i386_legacy": "",
> +        "ports-10.6_x86_64": "",
> +        "ports-10.6_x86_64_legacy": "",
> +        "base-10.7_x86_64": "",
> +        "ports-10.7_x86_64": "",
> +        "ports-10.7_x86_64_legacy": "",
> +        "base-10.8_x86_64": "",
> +        "ports-10.8_x86_64": "",
> +        "ports-10.8_x86_64_legacy": "",
> +        "base-10.9_x86_64": "",
> +        "ports-10.9_x86_64": "",
> +        "base-10.10_x86_64": "",
> +        "ports-10.10_x86_64": "",
> +        "base-10.11_x86_64": "",
> +        "ports-10.11_x86_64": ""
> +    }

This is repetitive. I had been thinking of doing this in a nested way instead. Maybe:



{
    "workers": {
        "10.5_ppc": {
            "base": ""
        },
        "10.5_ppc_legacy": {
            "ports": ""
        },
        "10.6_x86_64": {
            "base": "",
            "ports": ""
        },
        "10.6_x86_64_legacy": {
            "ports": ""
        },
        "10.6_i386": {
            "ports": ""
        },
        "10.6_i386_legacy": {
            "ports": ""
        },
        "10.7_x86_64": {
            "base": "",
            "ports": ""
        },
        "10.7_x86_64_legacy": {
            "ports": ""
        },
        "10.8_x86_64": {
            "base": "",
            "ports": ""
        },
        "10.8_x86_64_legacy": {
            "ports": ""
        },
        "10.9_x86_64": {
            "base": "",
            "ports": ""
        },
        "10.10_x86_64": {
            "base": "",
            "ports": ""
        },
        "10.11_x86_64": {
            "base": "",
            "ports": ""
        },
        "10.12_x86_64": {
            "base": "",
            "ports": ""
        },
        "master": {
            "docs-guide": "",
            "docs-www": ""
        }
    }
}



There are currently too many places in master.cfg that have knowledge of which worker runs on which platform. I'd like to get all of that information confined to the config file.




More information about the macports-dev mailing list