Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Conversation

@SvenDowideit
Copy link
Contributor

@SvenDowideit SvenDowideit commented Dec 7, 2016

its alive. I'm hoping we can merge a version of this for rc2, and then refine afterwards, but idk - i've come across so many little corner cases already.

  • uses syslinux only,
  • installs a linux-current.cfg boot config, and
  • on upgrade, that will (not impled yet) be renamed to linux-previous.cfg and a new current cfg added
  • installer image is now alpine based
  • the iso contains an export of an installer base image that doesn't contain the vmlinux/initrd, besire the initrd
  • the installer tries to mount the bootiso, load the installer base, and then grab the bootiso's vmlinuz and initrd
  • GPT partitioning and booting - from GPT partition option #1448
  • integration-tests for the boot from iso, install, boot from HD -
  • also test running installer on a partitioned disk - make sure its not-destructive

for a later PR:

  • Raid tests and support - Install fails on raid1 (software)  #1250
  • GPT using of state (its not mounting for >3TB disks)
  • EFI boot
  • see if we can log the vm output to disk, rather than to screen
  • update and test arm installer image
  • logging cleanup - atm, it shows too much, and then too little to the user

Note, there are commented out bits that will need to be deferred til 0.9 - changes are needed to how we build and package kernels

@SvenDowideit SvenDowideit changed the title Convert installer to go WIP: Convert installer to go Dec 7, 2016
- /usr/bin/iptables:/sbin/iptables:ro
- /media:/media:shared
- /mnt:/mnt:shared
- /:/host
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this for debugging? Do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its used to get access to the /dev/vda1 partition that we create - udev works outside the container, but not inside

Copy link
Contributor

Choose a reason for hiding this comment

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

But isn't being run in the installer container and not the console? /dev in the console container should be the same as /dev on the host anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sadly, its not the same - if there are changes to /dev in the host after the container is started, then those changes are not mirrored inside the container. and in this case, its udev making /dev/vda1 which we use inside.

And then when we look at RAID and custom partitions in 0.9, there'll be even more dynamics (same thing if we start to have other devices with loaded modules)

Copy link
Contributor

Choose a reason for hiding this comment

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

But don't we already bind mount /dev:/host/dev in the console container? Why do we need to bind mount in the entire root filesystem too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh crud. this isn't the host volume I thought it was - removing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not that it matters much for just the installer container, but you could probably bind mount /dev:/host/dev and run ros entrypoint as the entrypoint instead of /:/host.

@SvenDowideit
Copy link
Contributor Author

wget https://raw.githubusercontent.com/RoastLink/roastlink.github.io/master/cloud-config.yml
sudo ros install -d /dev/vda -c cloud-config.yml --no-reboot --append rancher.password=rancher -t gptsyslinux -f 2>&1 | tee install.log

@SvenDowideit SvenDowideit force-pushed the convert-installer-to-go branch from e7b0558 to cd35087 Compare December 15, 2016 04:58
@SvenDowideit SvenDowideit added this to the v0.8.0 milestone Dec 15, 2016
}
}

useIso := false
Copy link
Contributor

Choose a reason for hiding this comment

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

Silly question... If the mount and "system-docker load" lines below come after the "system-docker run" lines above, won't that prevent the os/installer image from being made available at the start of the "ros install" command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the system-docker run commands above are when the user is requesting to install a version that is different to the one on the iso - so it will pull the image from the hub

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks. In my horrible hack, I was blindly mounting and loading the os image since I knew that whatever I packed on my ISO was what I needed to keep the Vagrant users happy and because I was hacking my junk on top of 0.7.1 without all your other nice changes (yet). LGTM.

@SvenDowideit SvenDowideit force-pushed the convert-installer-to-go branch 2 times, most recently from 43608c9 to aa0c6ad Compare December 16, 2016 12:03
if [ "$INSTALLER" != "0" ]; then
./package-installer
fi

Copy link
Contributor

Choose a reason for hiding this comment

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

I had to make the same change for my temporary workaround as well. Glad you did this too.

@tylert
Copy link
Contributor

tylert commented Dec 16, 2016

I didn't notice whether you were copying anything from the ISO into /var/lib/rancher/preload/{system-,}docker (if it exists) for these changes. Was this stuff part of your future plans/commits or not in scope?

For my own hack, I just ended up adding a couple if [ -f foo ]; then cp foo bar ; fi lines to scripts/installer/lay-down-os to copy the appropriate preload archives for system-docker and docker just before rebooting.

@joshwget
Copy link
Contributor

What do you think about moving runInstall and associated functions to a top-level installer package?

}
log.Debugf("installRancher done")

//unused by us? :)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is used for the --kexec flag for upgrading (https://github.com/rancher/os/blob/master/cmd/control/os.go#L54). Hopefully available for standard installs at some point too #1292 .

@joshwget
Copy link
Contributor

Is the image embedded in the ISO going to be the same image used for upgrades?

@joshwget joshwget closed this Dec 16, 2016
@joshwget
Copy link
Contributor

Oops, wrong button 😄

@joshwget joshwget reopened this Dec 16, 2016
return nil
}

// files is an array of 'sourcefile:destination' - but i've not seen any examples of it being used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably just historical. I vote to remove it 😄

gccgo \
genisoimage \
gettext \
git \

Choose a reason for hiding this comment

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

👋 may want to check your editor settings; looks like all new lines use tabs, but the existing file uses spaces (here and other files

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 hate spaces 🗡
tabs forever !!!!

Choose a reason for hiding this comment

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

Have you been talking with tianon? :trollface:

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 thought tianon preferred spaces 📦

"errors"
)

// ResolveDevice this isn't reliable - blkid -L LABEL works more often :(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is really important if it's true in general and we should investigate it. We use this function to resolve LABEL=RANCHER_STATE during boot. Where did these problems occur? Are you sure you weren't using a /dev that didn't match the host /dev?

I'm assuming that blkid is just a thin CLI around libblkid. Maybe this has to do with the versions of libblkid then. util.ResolveDevice uses libblkid from https://github.com/rancher/os/blob/master/Dockerfile.dapper#L16, whereas the blkid binary will be using libblkid from buildroot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

INCLUDE ../global.cfg

# each INCLUDEd file has a `DEFAULT mylabel` in it, and the last one wins
INCLUDE ../linux-previous.cfg
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we leave isolinux.cfg alone? rancher.autologin=tty1 rancher.autologin=ttyS0 is getting removed here and we don't really need current/previous when booting from ISO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what I want to do is use the same kernel&initrd cfg file for both iso and installed boot - and I am thinking of using previous on the iso as the recovery option

Copy link
Contributor

Choose a reason for hiding this comment

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

We set the autologin parameter on the ISO though, so I'm not sure how we'd share the config. I don't think I understand the recovery part either - why would an ISO have a recovery option?

@SvenDowideit
Copy link
Contributor Author

@tylert dare you to make a PR with your preload changes - yes, it'll get re-written in this PR, but it'll save me some time :)

@tylert
Copy link
Contributor

tylert commented Dec 16, 2016 via email

@SvenDowideit
Copy link
Contributor Author

@joshwget yeah, I think I'll defer refactoring until 0.9 though, I'm still not finished, and wanted to have an rc with it in already :/

cli.BoolFlag{
Name: "stage, s",
Usage: "Only stage the new upgrade, don't apply it",
Usage: "Only stage the new upgrade, don't apply it (ie, create the service, pull the image, then exit - upgrade will happen on next reboot?)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't upgrade on next boot. Can you take out the second half of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so when does it upgrade?

Copy link
Contributor

Choose a reason for hiding this comment

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

When you run ros os upgrade next. You'd just avoid the image pull by staging.

TTYCONS=${ttycons["${ARCH}"]}

DEFAULT_KERNEL_ARGS="quiet rancher.password=rancher console=${TTYCONS} rancher.autologin=${TTYCONS}"
DEFAULT_KERNEL_ARGS="rancher.debug=true rancher.password=rancher console=${TTYCONS} rancher.autologin=${TTYCONS}"
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 Author

Choose a reason for hiding this comment

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

yeah - it helps debug the weirdness - without bothering people at release time

@SvenDowideit SvenDowideit force-pushed the convert-installer-to-go branch 4 times, most recently from 5ead9cb to b2bc5db Compare January 13, 2017 05:10
joshwget and others added 18 commits January 15, 2017 23:39
Signed-off-by: Sven Dowideit <[email protected]>
…some details that will delay it

Signed-off-by: Sven Dowideit <[email protected]>
….. the iso only has the smaller os-installer image in it \o/

Signed-off-by: Sven Dowideit <[email protected]>
Signed-off-by: Sven Dowideit <[email protected]>
Signed-off-by: Sven Dowideit <[email protected]>
Signed-off-by: Sven Dowideit <[email protected]>
@SvenDowideit SvenDowideit force-pushed the convert-installer-to-go branch from b2bc5db to e5a7889 Compare January 15, 2017 23:43
@SvenDowideit
Copy link
Contributor Author

SvenDowideit commented Jan 16, 2017

the dhcp test failure was due to buildroot 2016.11 - which I've reverted.

now working to figure out why the TestUpgrade goes boom

----------------------------------------------------------------------
1858s
3464
FAIL: upgrade_test.go:9: QemuSuite.TestUpgrade
1858s
3466
upgrade_test.go:18:
1858s
3467
    s.CheckCall(c, "sudo ros -v | grep v0.5.0")
1858s
3468
common_test.go:151:
1858s
3469
    c.Assert(err, IsNil)
1858s
3470
... value *exec.ExitError = &exec.ExitError{ProcessState:(*os.ProcessState)(0xc420421bc0), Stderr:[]uint8(nil)} ("exit status 1")

@SvenDowideit SvenDowideit changed the title WIP: Convert installer to go Convert installer to go Jan 16, 2017
@SvenDowideit
Copy link
Contributor Author

OK, tests pass, I'm going to merge, and then continue work in new PR's, and hopefully mostly after 0.8.0rc3

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants