-
Notifications
You must be signed in to change notification settings - Fork 28
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
Conversation
@jouvin i'm not going to review this, since i'm clueless wrt aquilon |
@stdweird but you are not clueless about the schema! Thus my choice to have you in the reviewers in case of something I missed... |
As explained in #142, |
There was a problem hiding this 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.
@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. |
The problem of keeping the broker's view of the validation in step with the schema is a problem which still needs solving. |
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! |
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. |
@jrha good point! In the meantime, I added a commit that defines as mandatory all the resources of |
Yes? It seems like a good idea. |
3cfd61f
to
ead9da3
Compare
Done! |
quattor/types/aquilon/hardware.pan
Outdated
@@ -0,0 +1,43 @@ | |||
# This template extends the base schema with Aquilon-provied resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provied => provided
quattor/types/aquilon/hardware.pan
Outdated
"room" : string | ||
"bunker" ? string | ||
"region" ? string | ||
"dns_search_domains" ? string[] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
quattor/types/aquilon/system.pan
Outdated
@{ Details of operating system as defined by aquilon broker } | ||
"os" ? structure_archetype_os | ||
"os" : structure_archetype_os |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
quattor/types/aquilon/system.pan
Outdated
@@ -55,9 +55,11 @@ type structure_archetype_os = { | |||
}; | |||
|
|||
type structure_archetype = { | |||
"name" : string # e.g. "aquilon" | |||
"name" ? string # e.g. "aquilon" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
quattor/types/aquilon/system.pan
Outdated
"os" ? structure_archetype_os | ||
"os" : structure_archetype_os | ||
"os_lifecycle" : string | ||
"model" ? string |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
quattor/types/aquilon/system.pan
Outdated
@{ Details of operating system as defined by aquilon broker } | ||
"os" ? structure_archetype_os | ||
"os" : structure_archetype_os | ||
"os_lifecycle" : string |
There was a problem hiding this comment.
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)$")
quattor/types/aquilon/system.pan
Outdated
@@ -112,7 +114,7 @@ type structure_personality = { | |||
"description" ? string | |||
"class" ? string with match(SELF, '(INFRASTRUCTURE|APPLICATION)') | |||
"users" ? string[] | |||
"systemgrn" : string[] | |||
"systemgrn" ? string[] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
quattor/types/aquilon/system.pan
Outdated
"stage" ? string | ||
"host_environment" : string with match(SELF, "^(dev|qa|uat|prod|infra|legacy)$") | ||
"owner_eon_id" : long | ||
"stage" : string |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #177 (comment)
There was a problem hiding this comment.
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.
e4efe90
to
76c0a85
Compare
I think that at this stage this PR is complete and addressing all the @ned21 concerns, except the |
- Rack room made optional (optional in Aquilon rack object) - country added as an optional property to sysloc Contributes to quattor/aquilon#90
…support 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
Rebased on #181... Please check! Not yet tested at LAL... |
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... |
@jouvin my feeling is that the schema should follow the broker. |
@jrha agreed. But @ned21 mentioned in one of his comment that he was expecting the archetype |
There was a problem hiding this 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 = { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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 😞.
quattor/types/aquilon/system.pan
Outdated
"stage" ? string | ||
"host_environment" : string with match(SELF, "^(dev|qa|uat|prod|infra|legacy)$") | ||
"owner_eon_id" : long | ||
"stage" : string |
There was a problem hiding this comment.
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.
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. |
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.