{"action":"created","issue":{"url":"https://api.github.com/repos/avocado-framework/avocado/issues/324","labels_url":"https://api.github.com/repos/avocado-framework/avocado/issues/324/labels{/name}","comments_url":"https://api.github.com/repos/avocado-framework/avocado/issues/324/comments","events_url":"https://api.github.com/repos/avocado-framework/avocado/issues/324/events","html_url":"https://github.com/avocado-framework/avocado/pull/324","id":53849525,"number":324,"title":"avocado.multiplexer: Support for multiplex domains [v0]","user":{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-09T09:39:46Z","updated_at":"2015-01-14T19:32:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/avocado-framework/avocado/pulls/324","html_url":"https://github.com/avocado-framework/avocado/pull/324","diff_url":"https://github.com/avocado-framework/avocado/pull/324.diff","patch_url":"https://github.com/avocado-framework/avocado/pull/324.patch"},"body":"Hello guys, another v0 multiplexer patch follows. It completely changes to multiplexer behavior similar to https://www.redhat.com/archives/virt-test-devel/2014-November/msg00004.html and https://www.redhat.com/archives/virt-test-devel/2014-November/msg00006.html . This version doesn't support multiple yaml files (tree merging), because there is a decision to be made, which strongly affects the code. So what we can do:\r\n\r\n1. mark node, whose children will be all in separate multiplex domain\r\n2. mark each multiplex domain\r\n\r\nThe biggest difference is, that ad1) it's simpler to define and IMO less prone to upstream-downstream modifications (once you define node to be `mux-domain`, all following nodes will be in separate mux-domains. ad2) is slightly easier to read (for humans) in the `yaml` file, but can lead to accidentally non-mux domain nodes. Let me show you the difference in `yaml`:\r\n\r\n\r\n```yaml\r\n# version 1 (mark parent)\r\nhw: !mux-doman\r\n    cpu:\r\n        intel:\r\n        amd:\r\n    disk:\r\n        virtio:\r\n        scsi:\r\n    machine:\r\n        host:\r\n\r\n# version 2 (mark each node)\r\nhw:\r\n    cpu: !mux\r\n        intel:\r\n        amd:\r\n    disk: !mux\r\n        virtio:\r\n        scsi:\r\n    machine: !mux\r\n        host:\r\n```\r\nAs you can see, version 1 doesn't support mixed `mux`/`nomux` nodes, so when you extend it, all children are marked either `mux` or `nomux`.\r\n\r\nIn version 2 when you don't mark node as `mux`, it's `nomux` and will extend the upper-level mux domain leaf list. This is slightly more flexible, but at the same time can lead to very weird results:\r\n```\r\n# cpu/disk/machine mux\r\n1. intel, virtio, host\r\n2. intel, scsi, host\r\n3. amd, virtio, host\r\n4. amd, scsi, host\r\n\r\n# cpu/machine mux; disk nomux\r\n1. intel, virtio, scsi, host\r\n2. amd, virtio, scsi, host\r\n```\r\nAnyway booth are valid versions so I'd like to ask you to think about it and help me decide.\r\n\r\nAlso as this is just v0 I haven't bother with documentation. There is an example yaml file:\r\n```yaml\r\n!mux-domain\r\nvirt:\r\n    hw: !mux-domain\r\n        cpu:\r\n            intel:\r\n                32:\r\n                64:\r\n            amd:\r\n        disk:\r\n            virito:\r\n            scsi:\r\n        machine:\r\n            host:\r\nos:\r\n    fedora:\r\ntests:\r\n    test1:\r\n    test2:\r\n    test3:\r\n```\r\nWhich multiplexes all root nodes and all hw nodes (as you'd expect). Note that this example is impossible to do with current multiplexer (you can do it, but you'd have to manually move some nodes into the global namespace and duplicate the intel32/intel64 nodes).\r\n\r\nI also tested the performance (even thought it's way too early for that). At first I was humiliated as original version was 10times faster. Then I realized, that due to implementation the expensive product part happens during the listing of the variants. So if you want to compare the speed, it's necessarily to put:\r\n```py\r\nfor _ in variants:\r\n    pass\r\n```\r\nwhich forces the real variants generation. Then the original `any_sibling` version took 50s and `mux-domain` version only 0.0045s (the yaml file containe `!mux-domain` at every branch so the results were identical - 531441 variants flat structure, similar results with deep structure). Partial example of the huge tree:\r\n```\r\n# Flat\r\n!mux-domain\r\na:\r\n    1:\r\n...\r\n    9:\r\nb:\r\n    1:\r\n...\r\n    9:\r\n...\r\nf:\r\n    1:\r\n...\r\n   9:\r\n# deep\r\n!mux-domain\r\na: !mux-domain\r\n    b: !mux-domain\r\n        c: !mux-domain\r\n            d: !mux-domain\r\n                e: !mux-domain\r\n                    i:\r\n                        1:\r\n...\r\n                        9:\r\n                    1:\r\n...\r\n                    9:\r\n...\r\nn:\r\n    1:\r\n...\r\n    9:\r\n\r\n```\r\n\r\nI also thought about the 2nd level filters, they should be quite easy to implement in this structure. Also the support for multiple files (tree merging) is quite simple, it only depends on the version (1 or 2) we choose so I didn't waste time putting it here."},"comment":{"url":"https://api.github.com/repos/avocado-framework/avocado/issues/comments/69976325","html_url":"https://github.com/avocado-framework/avocado/pull/324#issuecomment-69976325","issue_url":"https://api.github.com/repos/avocado-framework/avocado/issues/324","id":69976325,"user":{"login":"lmr","id":296807,"avatar_url":"https://avatars.githubusercontent.com/u/296807?v=3","gravatar_id":"","url":"https://api.github.com/users/lmr","html_url":"https://github.com/lmr","followers_url":"https://api.github.com/users/lmr/followers","following_url":"https://api.github.com/users/lmr/following{/other_user}","gists_url":"https://api.github.com/users/lmr/gists{/gist_id}","starred_url":"https://api.github.com/users/lmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmr/subscriptions","organizations_url":"https://api.github.com/users/lmr/orgs","repos_url":"https://api.github.com/users/lmr/repos","events_url":"https://api.github.com/users/lmr/events{/privacy}","received_events_url":"https://api.github.com/users/lmr/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T19:32:51Z","updated_at":"2015-01-14T19:32:51Z","body":"I recommend proceeding with the option you chose (let's label it as option 1). As for the name, I'd consider asking @adereis for ideas, as he frequently presents some good insights on naming and structure decisions. My vote goes for `!multiplex`, to set the record straight."}}