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

1.12.62: location related templates cannot be used #104

Open
jouvin opened this issue Jul 6, 2018 · 4 comments
Open

1.12.62: location related templates cannot be used #104

jouvin opened this issue Jul 6, 2018 · 4 comments

Comments

@jouvin
Copy link
Contributor

jouvin commented Jul 6, 2018

This issue is a spinoff of #91. related to timezone information passed to the plenary templates. I

t appeared that the timezone information declared in the database is in a generated templates associated with the host location but that the plenary object template doesn't have enough information passed by the broker to locate it. The first part of the issue discussion reflect this misunderstanding... The issue is focused on how to fix the namespace used for the location related templates and what is the missing information that the broker should put into the object template (somewhat related to #90).

@jouvin
Copy link
Contributor Author

jouvin commented Jul 6, 2018

Copying #91 (comment) from @ned21 which is a detailed analysis of the issue...

So I think we've identified two bugs here:

  1. using fullname instead of the code for hub
  1. hub is not exposed in the machine plenary so it's not possible to load the city plenary containing the TIMEZONE

We haven't fixed 1 because it would break our existing install, and presumably RAL too. (2) could be fixed more easily but first requires an update to structure_sysloc which currently looks this this:

type structure_sysloc = {
  "room"       ? string
  "bunker"     ? string
  "building"   ? string
  "city"       ? string
  "country"    ? string
  "region"     ? string
  "continent"  ? string
  "campus"     ? string
};

And unless (1) is fixed, it's not possible to actually use it. Or we have to do something odd and put the fullname in the sysloc structure not the code. (And full names are free text so may not be valid PAN=>can of worms).

tbh I am not sure using hub in the directory path makes sense at all since it's a logical construct. The plenary ought to be under country or some other geographical hierarchy. I found the original commit from @njwilliams in 2010 and from reading the commit message I am guessing he used the lowercase case fullname as a hack to get backwards compatibility with the directory schema that was already in use in template-king. (Aside: detailed commit messages FTW!)

I don't think changing this for any site is impossible but it does require a co-ordinated template-king update which we have previously found difficult as we have multiple active domains and tens of template developers who must update their sandboxes before hosts can compile again. I therefore would not like to assume it is easy for any existing Aquilon site to make this sort of change.

Having said that, it would be nice to have a config setting that fixed this for new sites. However before we do that we need to decide what "fixed" looks like. City names are globally unique (the name is really an identifier, fullname is free text). I suspect most sites do not have too many either so the hierarchy should not need to be deep. But it probably should not be flat either. Continent most closely matches what we use today and would keep the hierarchy the same depth. It also appears in the machine plenary.

@jouvin
Copy link
Contributor Author

jouvin commented Jul 6, 2018

Can we try to progress on this issue? I'm ready to work on it during my spare time but I agree with @ned21 that we first need to agree what a "fixed implementation" would be. Once we agreed, this is probably not very difficult to implement it with an option as suggested to ensure that only new sites use the new namespace by default.

I had a quick look at the hub issue where the fullname rather than the name is used to build pan namespace in 2 places, machine and site in plenary. I understand that it had to be kept initially at MS for some backward compatibility reason but it is clearly not a very good choice if the fullname is really a descriptive name with spaces... It can make life just harder I guess...

I also agree that having an unnecessary deep namespace is another thing that makes the life more complicated. It's true that city object names are in fact just IDs: you cannot have two entries in the DB with the same name/ID even if the actual name of the city (in 2 different countries) may actually be the same. @ned21, from your comment I understand that you lean towards continent/city rather than just city because you'll have too many of them at the same level. Am I right? This is fine with me.

If we agree on this for site, do we also agree that for consistency (and to fix the hub fullname misuse), we also replace hub fullname under machine by the same 2 levels, continent/city?

jouvin added a commit to jouvin/aquilon that referenced this issue Jul 13, 2018
- Used to be hub fullname previously which is not exported to the object
plenary, making impossible to locate the site template (not included
by default in the object plenary)
- Hosts must be rebuilt to use the new namespace

Fixes quattor#104

Change-Id: I71e59ffa750a264b88ecf35ae3e6ebecd73f98e2
jouvin added a commit to jouvin/aquilon that referenced this issue Jul 13, 2018
- Contributes to quattor#104

Change-Id: I061147728c376e722b1ffd67665921416e1291d8
jouvin added a commit to jouvin/aquilon that referenced this issue Jul 13, 2018
- Used to be hub fullname previously which is not exported to the object
plenary, making impossible to locate the site template (not included
by default in the object plenary)
- Hosts must be rebuilt to use the new namespace

Fixes quattor#104

Change-Id: I71e59ffa750a264b88ecf35ae3e6ebecd73f98e2
jouvin added a commit to jouvin/aquilon that referenced this issue Jul 13, 2018
- Contributes to quattor#104

Change-Id: I061147728c376e722b1ffd67665921416e1291d8
jouvin added a commit to jouvin/aquilon that referenced this issue Aug 16, 2018
- Used to be hub fullname previously which is not exported to the object
plenary, making impossible to locate the site template (not included
by default in the object plenary)
- Hosts must be rebuilt to use the new namespace

Fixes quattor#104

Change-Id: I71e59ffa750a264b88ecf35ae3e6ebecd73f98e2
jouvin added a commit to jouvin/aquilon that referenced this issue Aug 16, 2018
- Contributes to quattor#104

Change-Id: I061147728c376e722b1ffd67665921416e1291d8
jouvin added a commit to jouvin/aquilon that referenced this issue Oct 22, 2018
- Used to be hub fullname previously which is not exported to the object
plenary, making impossible to locate the site template (not included
by default in the object plenary)
- Hosts must be rebuilt to use the new namespace

Fixes quattor#104

Change-Id: I71e59ffa750a264b88ecf35ae3e6ebecd73f98e2
jouvin added a commit to jouvin/aquilon that referenced this issue Oct 22, 2018
- Contributes to quattor#104

Change-Id: I061147728c376e722b1ffd67665921416e1291d8
jouvin added a commit to jouvin/aquilon that referenced this issue Nov 2, 2018
- Used to be hub fullname previously which is not exported to the object
plenary, making impossible to locate the site template (not included
by default in the object plenary)
- Hosts must be rebuilt to use the new namespace

Fixes quattor#104

Change-Id: I71e59ffa750a264b88ecf35ae3e6ebecd73f98e2
jouvin added a commit to jouvin/aquilon that referenced this issue Nov 2, 2018
- Contributes to quattor#104

Change-Id: I061147728c376e722b1ffd67665921416e1291d8
@XaF
Copy link

XaF commented Nov 2, 2018

I'm fine with both the following changes:

  • Adding hub to the sysloc template; I think hub are to be considered as logical locations, and should appear in the templates informations as we might need them to perform some actions or checks
  • Using the continent in the path instead of the region

I think that both could be done (in separate commits) as they both make sense. Or any of those.
@ned21 care to comment ?

@ned21
Copy link
Contributor

ned21 commented Nov 4, 2018

Using the continent in the path instead of the region

Did you mean, "using continent in the path instead of hub" ?

I am fine with this change but as I noted, it's not a trivial change to deploy since you need to make a simultaneously change to files in template-king across every active domain and flush all the plenaries. (People's sandboxes will also break but they should be updating them regularly anyway.)

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

No branches or pull requests

3 participants