Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Alpine 3.12 #72

Merged
merged 34 commits into from
Aug 18, 2020
Merged

Alpine 3.12 #72

merged 34 commits into from
Aug 18, 2020

Conversation

mmlb
Copy link
Contributor

@mmlb mmlb commented Jul 17, 2020

Description

Update our x86_64 alpine to v3.12, upgrade kernel to latest lts (5.4.52) and add Pensando NIC drivers. Also lift the rules from installer/alpine/Makefile into rules.mk.j2 so that the top-level make can handle building the alpine files itself.

Why is this needed

Fixes: #1

How Has This Been Tested?

Tested via the qemu based tests, also in production on various hardware.

How are existing users impacted? What migration steps/scripts do we need?

Newer kernel means better hardware support. A supported Alpine base means bug fixes, especially ca-certificates updates :D.

@mmlb mmlb marked this pull request as draft July 17, 2020 21:42
@mmlb mmlb requested a review from ScottGarman July 17, 2020 22:03
Comment on lines 34 to 36
# remove edge when linux-vanilla is > 4.14.8 and has the nfp driver enabled,
# likely alpine v3.8
apk add --no-scripts --no-cache --update --upgrade --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we see if this is no longer needed? I believe this was to get around some old packages.

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 comment doesn't make any more sense but we still want latest and greatest linux-firmare. I tried building off of the pinned aports config but it wasn't working for me yesterday. Checked again today and it looks like the dev.alpinelinux.org host is back up again. Will use that then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now installing linux-firmware from the checked out aports

rules.mk.j2 Outdated
build/osie-aarch64.tar.gz: SED=/FROM/ s|.*|FROM multiarch/ubuntu-debootstrap:arm64-xenial|
build/osie-x86_64.tar.gz: SED=
build/osie-x86_64.tar.gz: SED=
Copy link
Contributor

Choose a reason for hiding this comment

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

extra space?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was on purpose for alignment ;p. Doesn't hurt.

rules.mk.j2 Outdated
build/osie-runner-aarch64.tar.gz: SED=/FROM/ s|.*|FROM multiarch/alpine:arm64-v3.7|
build/osie-runner-x86_64.tar.gz: SED=
build/osie-runner-x86_64.tar.gz: SED=
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same

rules.mk.j2 Outdated
build/osie-%.tar.gz: docker/Dockerfile ${osiesrcs}
$(E)"DOCKER $@"
$(Q)sed '${SED}' $< > $<.$*
$(Q)docker build -t osie:$* -f $<.$* $(<D) 2>&1 | tee $@.log >/dev/$T
$(Q)docker save osie:$* > $@.tmp
$(Q)mv $@.tmp $@

build/osie-runner-aarch64.tar.gz: /proc/sys/fs/binfmt_misc/qemu-aarch64
build/osie-runner-aarch64.tar.gz: SED=/FROM/ s|.*|FROM multiarch/alpine:arm64-v3.7|
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to wrap these in an if statement like line 180?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope because this is hard coded to aarch64, and so we don't need the if.

@mrmrcoleman mrmrcoleman added this to In Progress in Issues List Jul 21, 2020
mergify bot added a commit that referenced this pull request Aug 11, 2020
## Description

Lift the rules from installer/alpine/Makefile into rules.mk.j2 so that the top-level make can handle building the alpine files itself. Also cleanup/fix the Dockerfile & build.sh files that are responsible for building the Alpine boot files.

## Why is this needed

Extracted out of #72 for better reviewability.


## How Has This Been Tested?
Builds kernel, initramfs, and modloop files as needed.
Needed to upgrade deps since `six` is a disutils package and pip was
having trouble with it. I manually held `grpcio` back since it fails to
build in Alpine 3.12 [1].

[1]: grpc/grpc#23742

Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Going to need a newer kernel for the Pensando NICs and might as well use
the latest LTS release.

Signed-off-by: Manuel Mendez <manny@packet.com>
Its not great for reproducibility to install from edge at any random
point in time of the repo. Since we already have a checkout of aports,
might as well use that.

Signed-off-by: Manuel Mendez <manny@packet.com>
Similar to linux-firmware its not great for reproducibility to install
from edge at any random point in time of the repo. Since we already have
a checkout of aports, might as well use that.

Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
@mmlb mmlb marked this pull request as ready for review August 18, 2020 16:12
@mmlb mmlb requested review from a team and mikemrm August 18, 2020 16:12
@mmlb mmlb added the ready-to-merge Signal to Mergify to merge the PR. label Aug 18, 2020
mikemrm
mikemrm previously approved these changes Aug 18, 2020
Copy link
Contributor

@mikemrm mikemrm left a comment

Choose a reason for hiding this comment

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

lgtm!

mmlb and others added 5 commits August 18, 2020 14:40
For better caching/re-runs. There is no point in agonizing over docker
layers as we do not ship this image anywhere.

Signed-off-by: Manuel Mendez <manny@packet.com>
We don't really need to install kexec-tools, was being done so we can
have the package cached so its embedded in the initramfs. The packages
we do need installed are done at the end so we can minimize keeping
track of the cache dir.

Signed-off-by: Manuel Mendez <manny@packet.com>
Makes sense to build kexec-tools after the kernel has been built and
installed instead of the other way around. This will also be needed to
make using the build output as a local repo.

Signed-off-by: Manuel Mendez <manny@packet.com>
I could not figure out how to make it so apk will recognize the
kexec-tools apk files in the cache dir as valid. Luckily abuild sets up
a local repo and we can copy it into the initramfs and setup a new local
repo for it.

Signed-off-by: Manuel Mendez <manny@packet.com>
mkintfs is installed from v3.4.5 in the Dockefile, which maps to
https://gitlab.alpinelinux.org/alpine/mkinitfs/-/raw/v3.4.5/initramfs-init.in

Signed-off-by: Manuel Mendez <manny@packet.com>
mmlb added 21 commits August 18, 2020 14:40
Fetched from https://raw.githubusercontent.com/alpinelinux/mkinitfs/v3.4.5/initramfs-init.in and replaced
@Version@ with tag as is done in the Makefile.

Signed-off-by: Manuel Mendez <manny@packet.com>
Makes a bunch of tools happier, shfmt, vim syntax highlighting.

Signed-off-by: Manuel Mendez <manny@packet.com>
Avoids spraying console with uninteresting progress output.

Signed-off-by: Manuel Mendez <manny@packet.com>
Otherwise docker won't start up.

Signed-off-by: Manuel Mendez <manny@packet.com>
mkinitfs has gained similar functionality as originally implemented with
packet_bootdev_mac so lets just use that and minimize the patch diff.

mkinitfs also learned to not blindly use first eth device. The
implementation is different that what we currently do, but seems to be
fine. It doesn't really matter though since we always set
packet_bootdev_mac when booting with boots which alpine always honors.

Signed-off-by: Manuel Mendez <manny@packet.com>
Some servers / nics are finicky and may not be ready at this point in
boot yet.

Signed-off-by: Manuel Mendez <manny@packet.com>
We need this because we will be embedding packages from main and
community (docker).

Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
apk will only use files relative to `--root` so we need the embedded
cached packages and index files within $sysroot. Also need to override
ALPINE_REPO otherwise apk won't use the cached packages.

Signed-off-by: Manuel Mendez <manny@packet.com>
Similar to the setup needed for cached packages but for our custom built
apks.

Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
This is the init used in alpine-3.12 + our changes.

Signed-off-by: Manuel Mendez <manny@packet.com>
Mmmm fresh out the oven and smells delicious.

Signed-off-by: Manuel Mendez <manny@packet.com>
Matches our other Dockerfiles and helps differentiate between commands
in `&&` chain and args for them.

Signed-off-by: Manuel Mendez <manny@packet.com>
The json output is broken on latest tagged release used in 3.12.

Signed-off-by: Manuel Mendez <manny@packet.com>
…pine

py3-pip brings in dependencies that conflict with our own, and don't
seem to actually be needed. If those dependencies are in the system,
py3-pip will be more than happy to use them. Later when we delete the
build-deps virtual package those packages go away too and now we can't
start up.

By using a non-package pip we not only avoid competing package managers
, but also don't come across issues with dependencies as pip bundles its
dependencies.

Signed-off-by: Manuel Mendez <manny@packet.com>
@mmlb mmlb removed the request for review from splaspood August 18, 2020 18:44
@mergify mergify bot merged commit e902e83 into tinkerbell:master Aug 18, 2020
Issues List automation moved this from In Progress to Just shipped Aug 18, 2020
@mmlb mmlb deleted the alpine-3.12 branch August 18, 2020 19:43
&& \
mv /etc/apk/repositories /etc/apk/repositories.old && \
apk add --no-cache --update --upgrade \
--repository=http://dl-cdn.alpinelinux.org/alpine/v3.11/main \
Copy link

Choose a reason for hiding this comment

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

I think this needs to be changed to v3.12 (maybe do a global search and replace just to check whether this does not appear elsewhere).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no this is to get lshw from 3.11 explicitly. v3.12's lshw doesn't output correct json. I have not been able to track down the commit that broke lshw.

Copy link

Choose a reason for hiding this comment

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

Oh I see :-(

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 only used in tests so not a big deal imo. Looks like upstream has fixed the json output though so I'll look into PR'ing patches to aports.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready-to-merge Signal to Mergify to merge the PR.
Projects
No open projects
Issues List
  
Just shipped
Development

Successfully merging this pull request may close these issues.

Outdated Alpine Linux version referenced
4 participants