Project

General

Profile

Bug #16118

Avatar?id=14398&size=50x50

Allow setting git branches via environment variables

Added by Kris Moore about 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Nice to have
Assignee:
Suraj Ravichandran
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

To be done after TN 9.10 drops:

Update freenas-build to do the following:

Allow setting various git repo branches to build via environment variables.

This is done so we can create jenkins jobs on the fly, and adjust which developers branch they build, without having to modify freenas-build each time.

Associated revisions

Revision 80453d81 (diff)
Added by Suraj Ravichandran about 4 years ago

Add general purpose mechanism to build system to allow config var override via environment variables. Example usage: `env dsl.config.repos.middleware.branch=update_diffreduc_and_flakefix make update` Things to note: 1. `dsl.config.` is a general purpose prefix to identify build system config related env vars amidst the rest of them 2. This mechanism is not additive and will not allow you to add new config config vars instead just edit existing ones. 3. It will inform you via a log of a misformed env var that has `dsl.config.` prefix. 4. It will also log a successful override of a var. Feel free to review/comment for correctness and/or complexity. Ticket: #16118

History

#1 Updated by Suraj Ravichandran about 4 years ago

  • Status changed from Unscreened to Screened

#2 Updated by Suraj Ravichandran about 4 years ago

  • Target version set to Unspecified

Wanted to discuss my ideas of going about implementing this with jakub since he wrote the build system in the first place.

We came to the following conclusion:
1. Instead of just having a hacky fix for repo branches we instead should implement a generic dsl config var overriding mechanism via env vars.
2. This overriding mechanism would not be additive (as in it will only let you alter previously defined config vars from any .pyd file)
3. We would prefix the env vars with dsl just for identification purposes.
4. The format of the env var would be prefix.namespace.[subnamespace.]var format where namespace is section of the dsl
example of this is:

export repos.samba.branch=9.10-STABLE

5. While we are here and dealing with all this might as well deal with the redundancies here: https://github.com/freenas/freenas-build/blob/master/build/profiles/freenas9/repos.pyd.
We decided to have a generic profile inheritance scheme where in all .pyd files owuld be inherited unless explicitly defined (to diverge from parent) in the child.
Entire profile b inherits profile a completely with the exception of files found in profile b's root which preempt profile a's inheritance for just those files.

#3 Updated by Suraj Ravichandran about 4 years ago

  • Status changed from Screened to 19
  • % Done changed from 0 to 90

Have pushed the commit to a feature branch (see: https://github.com/freenas/freenas-build/commit/80453d81242384e7dad8611dd15a963c42e300fc)

Since this affects FN9, TN9 and FN10 all at the same time and they are all currently built from just the master branch of freenas-build I did not want to put it in master without review (have asked folks to do so)

Will merge it in post their replies with any modifications if suggested.

#4 Updated by Suraj Ravichandran about 4 years ago

  • Status changed from 19 to Resolved
  • % Done changed from 90 to 100

Merged it in.

#5 Avatar?id=14398&size=24x24 Updated by Kris Moore about 4 years ago

Fantastic! Thanks Suraj. I think these changes should probably be doc'd somewhere. Do we have a build doc to do that now, or who would be best to assist one of the doc team in writing something up?

#6 Avatar?id=14398&size=24x24 Updated by Kris Moore about 4 years ago

  • Target version changed from Unspecified to N/A

Also available in: Atom PDF