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

Provide real-world example with Ubuntu LTS #91

Closed
alexellis opened this issue May 1, 2020 · 6 comments
Closed

Provide real-world example with Ubuntu LTS #91

alexellis opened this issue May 1, 2020 · 6 comments
Assignees
Labels
priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.

Comments

@alexellis
Copy link
Contributor

alexellis commented May 1, 2020

As an end-user I want to provision a known OS such as Ubuntu LTS, 18.04.

This should be documented in the first steps instead of or as well as hello-world.

For each step in the task to install, there should be sources for the Dockerfiles so that these can be hacked on and adjusted.

I see this referenced in the documentation as an example of what could be done, but it's not in the examples folder, so I am not sure if the source is published for it.

It would also be extremely useful to have an example using cloud-init and the Ubuntu cloud image - https://cloud-images.ubuntu.com/bionic/current/

To recap, when completed, the following would be available on GitHub, with instructions:

  1. Working Ubuntu workflow with sources for each dockerfile step for a Packet host (preferably the one used in the Terraform setup on the www site)
  2. cloud-init example workflow for the worker in the Terraform setup from the www setup.
@alexellis
Copy link
Contributor Author

There's an example in the docs, which doesn't yet have sources to be used by an end-user, it looks a bit like this:

version: '0.1'
name: ubuntu_provisioning
global_timeout: 6000
tasks:
- name: "os-installation"
  worker: "{{index .Targets "machine1" "mac_addr"}}"
  volumes:
    - /dev:/dev
    - /dev/console:/dev/console
    - /lib/firmware:/lib/firmware:ro
  environment:
    MIRROR_HOST: 192.168.1.2
  actions:
  - name: "disk-wipe"
    image: disk-wipe
    timeout: 90
  - name: "disk-partition"
    image: disk-partition
    timeout: 600
    environment:
       MIRROR_HOST: 192.168.1.3
    volumes:
      - /statedir:/statedir
  - name: "install-root-fs"
    image: install-root-fs
    timeout: 600
  - name: "install-grub"
    image: install-grub
    timeout: 600
    volumes:
      - /statedir:/statedir

@gauravgahlot also shared what I understand is a slightly older, WIP example: https://github.com/tinkerbell/tink/tree/first-good-workflow/workflow-samples/ubuntu

Having reviewed the example, I saw some concepts embedded like Packet machine types and regions. I wonder if we could create something very minimal which achieves a similar effect?

I would expect it to look something like this, after booting OSIE over the network on the worker:

  1. Load RAID / LVM / SATA drivers
  2. Wipe the partitions / disks
  3. Fetch a disk image or tarball such as Ubuntu or Centos
  4. Apply the image as a root filesystem
  5. Detect the partition offsets and install GRUB
  6. Reboot

A simpler flow could involve using Packer from Hashicorp to create complete disk images with GRUB pre-installed, an idea that I hear a VMware team are using with CAPI.

  1. Load RAID / LVM / SATA drivers
  2. Wipe the partitions / disks
  3. Fetch a disk image or tarball such as Ubuntu or Centos
  4. Write the image to disk which already includes GRUB.
    5) Detect the partition offsets and install GRUB
  5. Reboot

Other than the main flow, what options are there and which do we want to use in the examples for the OS image?

  1. Ubuntu Cloud images for instance are designed to boot on cloud instances, they come in QCow format, so they use a sparse disk and may waste space.
  2. Create an image with GRUB already installed to make the workflow simpler
  3. Format a partition, untar a root-filesystem and install GRUB manually

@kewang-equinix
Copy link

I was tried to provision Ubuntu OS to BM server, and I have the same pain, hello-world doesn’t make too much sense, for the end user point of view they need provision a REAL OS on the server, and some example template for ubuntu doesn’t work either, because it's not available in public registry, it would be great we can public it, so end user only need follow the step by step guide to provision a baremetal server with real OS, and it would be good add some example on how to set the cloud-init script, thanks

@Ottovsky
Copy link

Ottovsky commented May 8, 2020

Totally agreed, the hello-world example is just a teaser and it does not bring much value, the example from first-good-workflow makes more sense, but it is hard to make it work without looking into source code and overwriting packet specific parameters with mock data. In the terms of an example workflow, I think the examples you listed are very good, it may be worth also to include steps for configuring init services (systemd, initd) , so the machine boots with all the required services up and running.

@alexellis
Copy link
Contributor Author

I believe this link is from @kewang-equinix (from community Slack):

"basically this is just workflow, you need build disk-wipe, disk-partition, install-root-fs, install-grub and cloud-init containers, and then create workflow based on the ubuntu.tmpl"

https://github.com/wangxin311/tink-workflow

I think I saw another repo floating around, I'll capture it here if I find it again in Slack.

@kqdeng
Copy link
Contributor

kqdeng commented Jun 24, 2020

After the data model update, the way to retrieve metadata from the hardware data has also changed. A suggested patch from Xin Wang is as follows:

declare class && set_from_metadata class 'metadata.facility.plan_slug' <"$metadata"
declare facility && set_from_metadata facility 'metadata.facility.facility_code' <"$metadata"
declare os && set_from_metadata os 'metadata.instance.OS.os_slug' <"$metadata"
declare preserve_data && set_from_metadata preserve_data 'preserve_data' false <"$metadata"

@gianarb
Copy link
Contributor

gianarb commented Mar 25, 2021

@gianarb gianarb closed this as completed Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
Development

No branches or pull requests

7 participants