Open Bug 1652123 Opened 5 years ago Updated 1 day ago

Replace voluptuous for schema validation in taskgraph.

Categories

(Firefox Build System :: Task Configuration, enhancement)

enhancement

Tracking

(firefox149 affected)

REOPENED
149 Branch
Tracking Status
firefox149 --- affected

People

(Reporter: tomprince, Assigned: abhishekmadan)

References

(Blocks 2 open bugs)

Details

(Keywords: leave-open)

Attachments

(58 files, 11 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

I've wanted to replace voluptuous for a while, due to https://github.com/alecthomas/voluptuous/issues/287.

While working on Bug 1648591, and rewritting a schema from taskgraph using json-schema for another project (in order to avoid adding voluptuous as a dependency). I realized that it would not be difficult to implement enough of voluptuous' API as a wrapper around jsonschema, and implemented a prototype.

Looking at Bug 1652086, I was curious what kind of performance impact it has.
On my machine, when skipping schema validation, my prototype is ~45s faster, and when not skipping validation, it is ~70s faster.

Correction, the json-schema version is validating in both cases, the comparison is total time with --fast vs without --fast, which disables schema validation for voluptuous (among other things).

Attached file Bug 1652123: fast-but-schema —
Attached file Bug 1652123: mozschema —

Note I replaced voluptuous with validx in another project, it looked like this:
https://github.com/mozilla/mozci/commit/ceab0279e7e0b0771c8d1ee3170ad3e0789971dc

It claims to be 11x faster than jsonschema (but only 3x faster than voluptuous), so I guess their benchmark is quite different than our use case.

While that project was much simpler, converting the format wasn't that big a deal. We'd need to re-implement our custom validators like optionally_keyed_by, but it should be do-able.

My preference would be to not bother with a wrapping layer to preserve the syntax, and lean on scripting to handle the conversion.

(In reply to Andrew Halberstadt [:ahal] from comment #4)

My preference would be to not bother with a wrapping layer to preserve the syntax, and lean on scripting to handle the conversion.

I think the tricky bit here is we may have schemas defined in-tree, e.g. in Fenix or in A-C, and if we change the format in taskgraph, they can't upgrade to a newer taskgraph unless they also change their schema definitions. Or we'd need to go and find all the consumers of standalone taskgraph and provide patches to use the new schema format. Neither are hard blockers to going this route; just something to consider.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → MOVED
Status: RESOLVED → REOPENED
Resolution: MOVED → ---
Assignee: nobody → amadan
Attachment #9513558 - Attachment description: WIP: Bug 1652123 - Converted all schemas in gecko and andriod taskgraph to msgspec. r?ahal → Bug 1652123 - Converted all schemas in gecko and andriod taskgraph to msgspec. r?ahal
Attachment #9524250 - Attachment description: Bug 1652123 - Refactored volutpous schemas to now be called LegacySchema. r=#releng-reviewers → Bug 1652123 - Part 1: Refactored volutpous schemas to now be called LegacySchema. r=#releng-reviewers
Attachment #9513558 - Attachment description: Bug 1652123 - Converted all schemas in gecko and andriod taskgraph to msgspec. r?ahal → Bug 1652123 - Part 2: Converted all schemas in gecko and andriod taskgraph to msgspec. r?ahal
Attachment #9524250 - Attachment description: Bug 1652123 - Part 1: Refactored volutpous schemas to now be called LegacySchema. r=#releng-reviewers → Bug 1652123 - Part 1: Refactored voluptuous schemas to now be called LegacySchema. r=#releng-reviewers
No longer blocks: 1652086
See Also: → 1652086
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cba8649b4086 https://hg.mozilla.org/integration/autoland/rev/e57e4c06a087 Part 1: Refactored voluptuous schemas to now be called LegacySchema. r=releng-reviewers,mach-reviewers,ahal

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/c73b25c97961
Port to Thunderbird - Part 1: Refactored voluptuous schemas to now be called LegacySchema. rs=bustage-fix DONTBUILD

Status: REOPENED → RESOLVED
Closed: 3 years ago1 month ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 1 month ago1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
Status: RESOLVED → REOPENED
Keywords: leave-open
Resolution: FIXED → ---
Regressions: 2016843
Attachment #9513558 - Attachment is obsolete: true
Attachment #9546289 - Attachment description: Bug 1652123 - Part 2: Converted GraphConfigSchema from voluptuous to msgspec. r=ahal → Bug 1652123 - Converted GraphConfigSchema from voluptuous to msgspec. r=ahal
Attachment #9546449 - Attachment description: Bug 1652123 - Part 3: Converted variant_description_schema from voluptuous to msgspec. r=ahal → Bug 1652123 - Converted variant_description_schema from voluptuous to msgspec. r=ahal
Attachment #9551047 - Attachment is obsolete: true
Attachment #9552783 - Attachment is obsolete: true
Attachment #9552784 - Attachment is obsolete: true
Attachment #9552785 - Attachment is obsolete: true
Attachment #9552787 - Attachment is obsolete: true
Attachment #9552788 - Attachment is obsolete: true
Attachment #9549458 - Attachment is obsolete: true
Attachment #9551130 - Attachment is obsolete: true
Attachment #9551131 - Attachment is obsolete: true
Attachment #9551132 - Attachment is obsolete: true
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3020378b20f3 https://hg.mozilla.org/integration/autoland/rev/0da0d4d0de7c Converted spilt-by-locale-schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a8ba590b94af https://hg.mozilla.org/integration/autoland/rev/899dff572ab5 Converted python_test_schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Attachment #9552811 - Attachment description: Bug 1652123 - Converted MsgspecOptimizationSchema from voluptuous to msgspec. r=ahal → Bug 1652123 - Converted OptimizationSchema from voluptuous to msgspec. r=ahal
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2db6a8729cf9 https://hg.mozilla.org/integration/autoland/rev/a22f1a963955 Converted OptimizationSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers https://github.com/mozilla-firefox/firefox/commit/a2a09019e192 https://hg.mozilla.org/integration/autoland/rev/641d307c954a Converted task_description_schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers https://github.com/mozilla-firefox/firefox/commit/615e00571669 https://hg.mozilla.org/integration/autoland/rev/ef153a334476 Converted run_task_schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers https://github.com/mozilla-firefox/firefox/commit/0dc6fe1591f5 https://hg.mozilla.org/integration/autoland/rev/25d192ef912e Converted job_description_schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers https://github.com/mozilla-firefox/firefox/commit/c5ab12321e55 https://hg.mozilla.org/integration/autoland/rev/1430895ee1be Converted test_description_schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b1b1af52f39e https://hg.mozilla.org/integration/autoland/rev/078ca952880b Converted variant_description_schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/754f9dadcfc1 https://hg.mozilla.org/integration/autoland/rev/277ea43e0c30 Converted toolchain schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ef8375069f2c https://hg.mozilla.org/integration/autoland/rev/6e394795a1bc Converted other.py schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by rperta@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/940189d451e6 https://hg.mozilla.org/integration/autoland/rev/1c6eaa58309b Revert "Bug 1652123 - Converted other.py schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers" for causing ci failures at test_mozilla_central.py

Backed out for causing ci failures at test_mozilla_central.py
Backout link
Push with failures
Failure log(s)
Failure line: taskcluster/test/test_mozilla_central.py::test_test_setting TEST-UNEXPECTED-FAIL

Flags: needinfo?(amadan)
Regressions: 2025630
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cc235493d6e4 https://hg.mozilla.org/integration/autoland/rev/69858a505fae Converted BeetmoverRepackagePartnerSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d4f66075900e https://hg.mozilla.org/integration/autoland/rev/d338ad50e297 Converted spidermoneky_schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e1e90cc6ab09 https://hg.mozilla.org/integration/autoland/rev/a564f577057c Converted MozharnessTestRunSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1d052279adb5 https://hg.mozilla.org/integration/autoland/rev/3d49cc86386a Converted other.py schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a397b40e35fc https://hg.mozilla.org/integration/autoland/rev/b66437debf69 Converted PackagingDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cf7cbd571c27 https://hg.mozilla.org/integration/autoland/rev/9abd867ebb7b Converted SourceTestDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Flags: needinfo?(amadan)
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/67157b81e29f https://hg.mozilla.org/integration/autoland/rev/6ff9ad11d750 Converted LangpackSignPushDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ff8d8446ff74 https://hg.mozilla.org/integration/autoland/rev/9c4dc8e4a4b1 Converted CondoprofDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0e3ddbfd624b https://hg.mozilla.org/integration/autoland/rev/6da635deaea1 Converted ChecksumsSigningDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/75de4bbfb63a https://hg.mozilla.org/integration/autoland/rev/eec2234003bc Converted L10nDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
No longer regressions: 2025630
See Also: → 2025630
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/793b1b4383e7 https://hg.mozilla.org/integration/autoland/rev/012d1e772900 Converted PushMsixDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5cb1d70dcec2 https://hg.mozilla.org/integration/autoland/rev/8b2efce84742 Converted ReleaseGenerateChecksumsSigningSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/75a8469f0b30 https://hg.mozilla.org/integration/autoland/rev/291517aa9ff5 Converted ReleaseGenerateChecksumsBeetmoverSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/abaedb0fcf3b https://hg.mozilla.org/integration/autoland/rev/4a31d1f55a36 Converted PushFlatpakDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/27fab7d9bf69 https://hg.mozilla.org/integration/autoland/rev/0b831b506164 Converted ReleaseBeetmoverSignedAddonsDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8cab6a4e174d https://hg.mozilla.org/integration/autoland/rev/6692a964a2e3 Converted RepackageSigningPartnerDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/fd0acdccdc87 https://hg.mozilla.org/integration/autoland/rev/c807d25a5425 Converted RepackageSigningDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1fc29df3a447 https://hg.mozilla.org/integration/autoland/rev/d1fb40adbd63 Converted RepackingPartnerDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c36edd0d53df https://hg.mozilla.org/integration/autoland/rev/4328cf4fec96 Converted PartnerBeetmoverDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f7298bf3df1f https://hg.mozilla.org/integration/autoland/rev/53251fc3b5cb Converted GeckodriverNotarizationDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b8d84cdc06ec https://hg.mozilla.org/integration/autoland/rev/b5b2c32e1721 Converted GeckodriverRepackageSigningDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/fc3e1565fa1d https://hg.mozilla.org/integration/autoland/rev/286dad38e22b Converted BeetmoverSourceChecksumsDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/911e85e72857 https://hg.mozilla.org/integration/autoland/rev/7ef1ddc39314 Converted BeetmoverRepackageRPMDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/903ad188fa34 https://hg.mozilla.org/integration/autoland/rev/f4e910a92bf1 Converted BeetmoverRepackageDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/355f440449d1 https://hg.mozilla.org/integration/autoland/rev/d6ae7646f90a Converted BeetmoverPushToReleaseDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c40617dcb759 https://hg.mozilla.org/integration/autoland/rev/c92e5f3b4314 Converted BeetmoverLangpackDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cbaba97489d1 https://hg.mozilla.org/integration/autoland/rev/34ed79e08785 Converted BeetmoverIntegrationDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/64de0f0ff073 https://hg.mozilla.org/integration/autoland/rev/c2dd579acbd0 Converted BeetmoverGeckoviewDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b802c4f1d05f https://hg.mozilla.org/integration/autoland/rev/f722880eff89 Converted BeetmoverEmeFreeChecksumsDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d0128319b328 https://hg.mozilla.org/integration/autoland/rev/dfb4646deb46 Converted BalrogDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/720758518fda https://hg.mozilla.org/integration/autoland/rev/ea780121b2de Converted SigningDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/047702ac6afe https://hg.mozilla.org/integration/autoland/rev/4ffc0ad4c983 Converted diffDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e8222730a34e https://hg.mozilla.org/integration/autoland/rev/346a550a2900 Converted BeetmoverChecksumDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers https://github.com/mozilla-firefox/firefox/commit/dfb125550bf8 https://hg.mozilla.org/integration/autoland/rev/591e3debf75b Converted Openh264SigningDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/08e291760672 https://hg.mozilla.org/integration/autoland/rev/402a20c3d98b Converted bootstrap-schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers https://github.com/mozilla-firefox/firefox/commit/3f369c56b0a9 https://hg.mozilla.org/integration/autoland/rev/226140306fd8 Converted RaptorDescriptionSchema from voluptuous to msgspec. r=ahal https://github.com/mozilla-firefox/firefox/commit/d8643afcc1ab https://hg.mozilla.org/integration/autoland/rev/3bb1581362d8 Converted BeetmoverDescriptionSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers,releng-reviewers https://github.com/mozilla-firefox/firefox/commit/b10db4d92b25 https://hg.mozilla.org/integration/autoland/rev/2feefbc30130 Converted docker-image-schema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
Pushed by amadan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0c145e2b1787 https://hg.mozilla.org/integration/autoland/rev/2af00ea1d3dd Converted GraphConfigSchema from voluptuous to msgspec. r=ahal,taskgraph-reviewers
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: