Page MenuHomePhabricator

Expand conftool to support multiple objects via a schema definition.
Closed, ResolvedPublic

Description

In its current incarnation, conftool only supports two object types:

  • nodes, describing single applications in a service pool
  • service, describing the corresponding service

What we want is to extend its behaviour so that any generic object type can be added programmaticaly, via a schema file.

Schema files should allow to add objects with different characteristics, and also allow the same syncronization mechanism that we use now: define which objects are present from yaml files, and - for specific objects - also the content of objects themselves.

The objects in the schema will have the following format:

<object-name>:
   path: <base-path>
   tags: [tag1, tag2]
  schema:
     field1: { type: string, default: <field1-default-value> }

So we need to define the base path on the kvstore for an object class, the tags needed to describe the object itself, and a schema with a dict of fields, their type and default value.

As far as types are concerned, I think we can limit ourselves to a series of simple ones, namely:

  • integer
  • string
  • boolean
  • list
  • dictionary/hash

relationships between such objects can be described as dependencies: for example, nodes depend on a corresponding service being defined. Those can be listed as well., and will determine the order of syncronization between the on disc structures and the live data.

Event Timeline

Change 288609 had a related patch set uploaded (by Giuseppe Lavagetto):
Generalize entities definitions

https://gerrit.wikimedia.org/r/288609

Change 288881 had a related patch set uploaded (by Giuseppe Lavagetto):
Add schema support

https://gerrit.wikimedia.org/r/288881

Change 288609 merged by jenkins-bot:
Generalize entities definitions

https://gerrit.wikimedia.org/r/288609

Change 288881 merged by jenkins-bot:
Add schema support

https://gerrit.wikimedia.org/r/288881

The code is done and a package has been created, although still only in experimental. This task can be considered resolved though.