Closed
Bug 1246643
Opened 9 years ago
Closed 9 years ago
Auto generate global config go struct using go-composite-schema
Categories
(Taskcluster :: Workers, defect)
Taskcluster
Workers
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: pmoore, Assigned: pmoore)
References
Details
Attachments
(1 file)
The global config will be built up something like this:
struct Config {
struct Global {
....
}
struct Engines {
struct Docker {
....
}
....
}
struct Plugins {
struct LiveLog {
....
}
....
}
}
We would build the go types with a buildtime discovery of plugins and engines.
Each engine and plugin will define its own config json schema which can be used to generate the static model for its configuration, ensuring static type compile-time compliance for code that references config settings.
Assignee | ||
Updated•9 years ago
|
Summary: Auto generate global config go struct based on buildtime discovery of plugins and engines → Auto generate global config go struct using go-composite-schema
Assignee | ||
Comment 1•9 years ago
|
||
(In reply to Pete Moore [:pmoore][:pete] from comment #0)
> The global config will be built up something like this:
>
> struct Config {
> struct Global {
> ....
> }
> struct Engines {
> struct Docker {
> ....
> }
> ....
> }
> struct Plugins {
> struct LiveLog {
> ....
> }
> ....
> }
> }
>
> We would build the go types with a buildtime discovery of plugins and
> engines.
>
> Each engine and plugin will define its own config json schema which can be
> used to generate the static model for its configuration, ensuring static
> type compile-time compliance for code that references config settings.
We've decided against this now, since this would create a dependency cycle. For example, plugins would depend on the package the config structure is defined in, but likewise the config package would depend on the plugin packages. Instead of doing this, we will use CompositeSchema (https://godoc.org/github.com/taskcluster/taskcluster-worker/runtime#CompositeSchema) to take care of Parsing json config, and provide this config back to the plugins/engines to manage themselves (e.g. the Payload member of https://godoc.org/github.com/taskcluster/taskcluster-worker/plugins#TaskPluginOptions).
Assignee | ||
Comment 2•9 years ago
|
||
There seem to be some race conditions showing up in the tests - let me take a look at this before final review.
Thanks,
Pete
Comment 3•9 years ago
|
||
Commits pushed to master at https://github.com/taskcluster/taskcluster-worker
https://github.com/taskcluster/taskcluster-worker/commit/e5eb4ac200bf3f7f2e36e05b464e7530280c4e8b
Bug 1246643 - auto generates global config struct from json schema yaml file
https://github.com/taskcluster/taskcluster-worker/commit/4ff4ee7a8950e7d3fb694825db8ed7a1a25ff2f3
Merge pull request #28 from taskcluster/bug1246643
Bug 1246643 - auto generate global config struct from json schema yaml file
Updated•9 years ago
|
Attachment #8722501 -
Flags: review?(garndt) → review+
Updated•9 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: Worker → Workers
You need to log in
before you can comment on or make changes to this bug.
Description
•