Skip to content

Conversation

@DavidjohnBlodgett
Copy link
Contributor

@RackHD/corecommitters @tldavies @VulpesArtificem @rolandpoulter this is one of a 2 part PR (also in RackHD/on-imagebuilder#31) to support the new micro kernel.

@benbp
Copy link
Contributor

benbp commented Mar 28, 2016

@benbp
Copy link
Contributor

benbp commented Mar 28, 2016

Please don't merge until ^^ are updated.

@anhou
Copy link
Member

anhou commented Mar 29, 2016

👍 after update with @benbp 's comments

basefs: 'common/base.trusty.3.16.0-25-generic.squashfs.img',
overlayfs: 'common/discovery.overlay.cpio.gz',
basefs: 'common/base.trusty.3.19.0-56-generic.squashfs.img',
overlayfs: 'common/discovery.3.19.0-56-generic.overlay.cpio.gz',
Copy link
Contributor

Choose a reason for hiding this comment

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

How about to refactor the code using the task rendering? so it is more easy to change all micorkernel files to a new one by only change the options version:

options: {
        version: '3.19.0-56-generic',
        kernelFile: 'vmlinuz-{{options.version}}',
        initrdFile: 'initrd.img-{{options.version}}',
        kernelUri: '{{ api.server }}/common/{{ options.kernelFile }}',
        initrdUri: '{{ api.server }}/common/{{ options.initrdFile }}',
        basefs: 'common/base.trusty.{{options.version}}.squashfs.img',
        overlayfs: 'common/discovery.{{options.version}}.overlay.cpio.gz',
        profile: 'linux.ipxe',
        comport: 'ttyS0'
    },

Copy link
Contributor

Choose a reason for hiding this comment

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

Great idea! I second this, though maybe call it kernelVersion instead of version?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why just version? Why not the entire path/filename?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jlongever because the version value is shared across 4 variables, if I understand your question correctly?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@benbp as long as we're rendering option values why not pass each full filename and path in as an option? What if I want to boot my own custom overlay (or initrd, kernel, etc) called my.custom.overlay.version.1.cpio.gz put in my_overlays/ instead of /common; my graph would pass overlayfs and rendered as:
overlayfs: {{options.overlayfs}} = my_overlays/my.custom.overlay.version.1.cpio.gz.

Are we intentionally enforcing a file naming convention? Just throwing it out there.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the extra options are just for convenience on our end when changing the code, but for a use case like yours, yeah I would encourage just overwriting the whole overlayfs value from the graph.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, my proposal just wants to simplify our future change on this task definition, you can still override all options with your customized values regardless of the version.
Furthermore, maybe the common/ can also be extracted as a option, such as baseUrl or baseDir .

Copy link
Member

Choose a reason for hiding this comment

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

Talking about refactoring, I suggest more. the URI/URL could be independent with kernel/initrd/basefs/overlayfs so that the static file server could be independent, it's very useful when a separate service for static file is used(also may benefit to RackHD in switch), it's also flexible for the customized case @jlongever mentioned. so just like this.
{
version: ***
baseUri: {{api.server}/common
kernelFile: ***
initrdFil: ***
basefs: ***
overlayfs: ***
prifile:***
comport: ***
}
and for ipxe profile https://github.com/RackHD/on-http/blob/master/data/profiles/linux.ipxe also need to be refactored, like below

kernel <%=baseUri%>/<%=kernelFile%>
initrd <%=baseUri%>/<%=initrdFile%>
imgargs imgargs <%=kernelFile%> initrd=<%=initrdFile%> ****** BASEFS=<%=baseUri%>/<%=basefs%> OVERLAYFS=<%=baseUri%>/<%=overlayfs%> ***

so the hardcoded 'http' could be removed from
https://github.com/RackHD/on-imagebuilder/blob/master/roles/initrd/provision_initrd/files/local#L109-L121

I know there will be more changes and this is out of the original purpose of this PR, so it could be refactored in another PR, so still 👍 from me for this PR with another refactoring PR

@yyscamper
Copy link
Contributor

Still 👍 with a refactor suggestion.

initrdFile: 'initrd.img-3.16.0-25-generic',
kernelVersion: '3.19.0-56-generic'
kernelFile: 'vmlinuz-{{ options.kernelVersion}}',
initrdFile: 'initrd.img-{{ options.kernelVersion}}',

Choose a reason for hiding this comment

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

Missing semicolon.
Unrecoverable syntax error. (40% scanned).

@JenkinsRHD
Copy link
Contributor

*** BUILD #517 ***

@JenkinsRHD
Copy link
Contributor

*** BUILD #518 ***

@JenkinsRHD
Copy link
Contributor

*** BUILD #519 ***

@benbp benbp merged commit b876df5 into RackHD:master Apr 15, 2016
@DavidjohnBlodgett DavidjohnBlodgett deleted the kernelBump3.19 branch April 15, 2016 18:37
kellylu2sym pushed a commit to kellylu2sym/on-tasks that referenced this pull request Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants