Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema fixes required for Aquilon support #177

Merged
merged 5 commits into from
Jul 12, 2018

Conversation

jouvin
Copy link
Contributor

@jouvin jouvin commented Jun 3, 2018

As explained in quattor/aquilon#90, current schema is not consistent with plenary templates generated by Aquilon (1.12.58). This PR reconciles them, preserving backward compatibility

This PR also improves the schema layout by factoring out of the base file hardware resources specific to Aquilon. And all the properties mandatory in the Aquilon DB and passed by the broker into the generated templates have been defined as mandatory.

@stdweird
Copy link
Member

stdweird commented Jun 3, 2018

@jouvin i'm not going to review this, since i'm clueless wrt aquilon

@jouvin
Copy link
Contributor Author

jouvin commented Jun 3, 2018

@stdweird but you are not clueless about the schema! Thus my choice to have you in the reviewers in case of something I missed...

@jouvin
Copy link
Contributor Author

jouvin commented Jun 3, 2018

As explained in #142, /system/archetype/os type definition has been changed to a dict to avoid nasty regexp in configuration modules to find the OS name or version. This is not changed by this PR but ncm-cron configuration template was found buggy with respected to this schema change. quattor/configuration-modules-core#1282 fixes it and is also required for the Aquilon support. I did a quick search and it seems the only affected configuration module.

Copy link
Member

@jrha jrha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. My only worry is that with the large number of optional entries it is impossible to rely upon any information being present, but I do understand that we are the mercy of the broker here.

@jouvin
Copy link
Contributor Author

jouvin commented Jun 4, 2018

@jrha I also agree and probably we should make the schema a little bit more strict, in particular having all the values required by the broker (there are quite a lot) mandatory in the schema. We probably need to complete the discussion on things in the Aquilon DB not exported by the broker in the object template.

@jrha
Copy link
Member

jrha commented Jun 4, 2018

The problem of keeping the broker's view of the validation in step with the schema is a problem which still needs solving.

@jouvin
Copy link
Contributor Author

jouvin commented Jun 4, 2018

Agreed! But I think this is more a problem of process than a technical issue. And the incentive to address it may be boosted by a larger adoption of Aquilon by the community!

@jrha
Copy link
Member

jrha commented Jun 4, 2018

There is a technical aspect too, any given version of the broker may be managing builds with any (or many) versions of the template library, so ideally the aquilon types should be provided by the broker itself.

@jouvin
Copy link
Contributor Author

jouvin commented Jun 4, 2018

@jrha good point! In the meantime, I added a commit that defines as mandatory all the resources of aquilon.pan defined by the Aquilon (1.12.58) broker in the plenary templates.
This doesn't address the Aquilon-provided fields in hardware.pan (country, organisation...). As I don't think they are used by any non Aquilon site, should we factor them out of the main file in the same way this is done for system.pan so that we could define as mandatory everything provided by the broker?

@jrha
Copy link
Member

jrha commented Jun 4, 2018

Yes? It seems like a good idea.

@jouvin jouvin force-pushed the aquilon_schema branch 3 times, most recently from 3cfd61f to ead9da3 Compare June 4, 2018 14:55
@jouvin
Copy link
Contributor Author

jouvin commented Jun 4, 2018

Done!

@@ -0,0 +1,43 @@
# This template extends the base schema with Aquilon-provied resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provied => provided

"room" : string
"bunker" ? string
"region" ? string
"dns_search_domains" ? string[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember seeing this in the structure_sysloc I sent you? This wouldn't really belong here I think? Nor location.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I made a mistake trying to merge everything... In fact I wanted to delete them but incorrectly assume if was coming from you... Fixed!

@{ Details of operating system as defined by aquilon broker }
"os" ? structure_archetype_os
"os" : structure_archetype_os
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this to "os" : string # e.g. "linux" since the broker has been generating this prior to the the change that introduced this dict.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the complementary PR quattor/aquilon#94 for the broker...

@@ -55,9 +55,11 @@ type structure_archetype_os = {
};

type structure_archetype = {
"name" : string # e.g. "aquilon"
"name" ? string # e.g. "aquilon"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be mandatory to match ours.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it should... But as of Aquilon 1.12.60 it is not added to the hostdata by the broker... Should be fixed IMO... See quattor/aquilon#90

"os" ? structure_archetype_os
"os" : structure_archetype_os
"os_lifecycle" : string
"model" ? string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be mandatory to match ours

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the broker proposed change, it is probably difficult to make it mandatory.

@{ Details of operating system as defined by aquilon broker }
"os" ? structure_archetype_os
"os" : structure_archetype_os
"os_lifecycle" : string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing validation:
string with match(SELF, "^(evaluation|pre_prod|early_prod|production|pre_decommission|inactive|withdrawn|decommissioned)$")

@@ -112,7 +114,7 @@ type structure_personality = {
"description" ? string
"class" ? string with match(SELF, '(INFRASTRUCTURE|APPLICATION)')
"users" ? string[]
"systemgrn" : string[]
"systemgrn" ? string[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recent versions of the broker no longer generate this but I guess you need it for people on old broker versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think we should require the last version of the broker for people wanting to use this version of the template library. I think we are only 3 sites running a broker and two of us probably up-to-date! Fixed.

"stage" ? string
"host_environment" : string with match(SELF, "^(dev|qa|uat|prod|infra|legacy)$")
"owner_eon_id" : long
"stage" : string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making some of the mandatory could cause issues for users on an older version of the broker

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@ned21 ned21 Jun 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! In that case then we should also remove infra and legacy options because they are no longer valid.

@jouvin jouvin force-pushed the aquilon_schema branch 4 times, most recently from e4efe90 to 76c0a85 Compare June 5, 2018 09:36
@jouvin
Copy link
Contributor Author

jouvin commented Jun 5, 2018

I think that at this stage this PR is complete and addressing all the @ned21 concerns, except the archetype/os. But for this issue, as it is not a changed made by this PR but a one year old change (17.7.0) missed by @ned21, I would prefer that it is not discussed as part of this PR (and doesn't block it) and that an issue is opened to rediscuss the change introduced by #142 if needed.

- Rack room made optional (optional in Aquilon rack object)
- country added as an optional property to sysloc

Contributes to quattor/aquilon#90
…e template

- Every type definition related to Aquilon moved to quattor/types/aquilon directory
- Some Aquilon-specific made mandatory to reflect their status in the Aquilon DB
@jouvin
Copy link
Contributor Author

jouvin commented Jun 5, 2018

Rebased on #181... Please check! Not yet tested at LAL...

@jouvin
Copy link
Contributor Author

jouvin commented Jun 5, 2018

Tested successfully at LAL with last broker version (1.12.60). The main broker problem not yet addressed is the missing archetype name in the hostdata that prevents marking this property required in the schema. @ned21 do you want the schema to be updated and a broker fix to be submitted or do we stay with the current situation in this PR (my preference) and will change it later once the broker does the appropriate thing...

@jrha
Copy link
Member

jrha commented Jun 5, 2018

@jouvin my feeling is that the schema should follow the broker.

@jouvin
Copy link
Contributor Author

jouvin commented Jun 5, 2018

@jrha agreed. But @ned21 mentioned in one of his comment that he was expecting the archetype name to be required which is in fact not possible with the current broker. Thus my remark that we could decide to fix the broker to support the expected schema, even if I think it is not a good practice to create some sort of circular dependencies between issues and I'd prefer this to be addressed later, even if related to the original goal of this PR.

Copy link
Contributor

@ned21 ned21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor changes you could make to bring us back into alignment but happy to approve this if you don't want to make them.

On the subject of archetype/name: it's currently mandatory for us. However the broker doesn't specify it and it's a matter of philosophy as to how much we want the broker to dictate the schema since the tighter the coupling the more pain we'll feel with upgrades, etc. So I think it's fine to keep it as optional for now.

@documentation{
system location definition
}
type structure_sysloc = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our version all fields of this structure are optional. I think it might be best to stay in sync.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fields changed to mandatory are those who are mandatory at the broker-level... See my answer to your comment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jouvin changing these to mandatory has broken builds with our (admittedly ancient) broker 😞.

"stage" ? string
"host_environment" : string with match(SELF, "^(dev|qa|uat|prod|infra|legacy)$")
"owner_eon_id" : long
"stage" : string
Copy link
Contributor

@ned21 ned21 Jun 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! In that case then we should also remove infra and legacy options because they are no longer valid.

@jouvin
Copy link
Contributor Author

jouvin commented Jun 6, 2018

On the broker-schema coupling, you are right that the tighter the more pain potentially... except if we find a way to remove these templates from the template library and have them distributed/generated by the broker.

The reason for the changes proposed here is to allow sites who want to rely on these properties to know which ones are always present and avoid too much testing in every template. So my preference would be to keep the proposed modifications.

@jrha jrha modified the milestones: 18.6, 18.9 Jun 29, 2018
@jouvin jouvin mentioned this pull request Jul 12, 2018
@jrha
Copy link
Member

jrha commented Jul 12, 2018

@jouvin this can be merged if @ned21 is happy now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants