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

CI fix, part II: kube #607

Merged
merged 1 commit into from
Jul 31, 2024
Merged

CI fix, part II: kube #607

merged 1 commit into from
Jul 31, 2024

Conversation

apostasie
Copy link
Contributor

@apostasie apostasie commented Jul 25, 2024

This is fixing the recent kube testing bustage.

NOTE that this PR is on-top of #606 as I needed a working CI environment as a starting point to debug.
We can either merge this and close 606, or merge 606 first, then I will rebase here.

As far as I can tell, the issues with kube were:

  1. fallout of fix: error in Kubelet when using default root directory #603 that did miss a bunch of strings
  2. containerd-nydus-grpc was built dynamically on the host, but copied into the kind control plane container that could (and does) have a different libc
  3. the rig was tightly coupled with github actions, making it really hard to test locally. Specifically, we depended upon engineerd/setup-kind which has been untouched in two years and is using deprecated features from github action anyhow

What this PR does (in commit "Fix kube test bustage"):

  • add a new make static target so that we get truly static bin/containerd-nydus-grpc binaries that we can safely copy into the kind control plane
  • finish replacing /var/lib/containerd/io.containerd.snapshotter.v1.nydus (follow-up to fix: error in Kubelet when using default root directory #603)
  • pin delve version so that we don't have the go version problem anymore in the future (mentioned in CI fix, part I: update and cleanup #606)
  • bump nerdctl version
  • replace the entire github-action-coupled rig setup by a kind.sh shell script (under tests/helpers) that takes care of setting everything up, so that we can also use that locally / outside of github actions

CI is now green and both PRs are ready to review.

Hope this is helpful.

@apostasie apostasie force-pushed the dev-fix-kube branch 11 times, most recently from ae3f08c to 9cba261 Compare July 25, 2024 20:28
@apostasie apostasie changed the title [WIP] CI fix, part II: kube CI fix, part II: kube Jul 25, 2024
@apostasie apostasie marked this pull request as ready for review July 25, 2024 20:55
@apostasie
Copy link
Contributor Author

@imeoer going to rebase this ASAP so that we can consider just the Kube fixes

Signed-off-by: apostasie <[email protected]>
@@ -25,115 +26,22 @@ jobs:
with:
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- name: Setup Kind
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of this logic, currently tied into github actions / engineerd/setup-kind, is making it (quite) difficult to test locally.

With this proposed PR, the logic gets moved to an independent shell script that should make it much easier to test locally, and also to control what version of what gets used.

@@ -58,6 +58,11 @@ build:
GOOS=${GOOS} GOARCH=${GOARCH} ${PROXY} go build -ldflags "$(LDFLAGS)" -v -o bin/containerd-nydus-grpc ./cmd/containerd-nydus-grpc
GOOS=${GOOS} GOARCH=${GOARCH} ${PROXY} go build -ldflags "$(LDFLAGS)" -v -o bin/nydus-overlayfs ./cmd/nydus-overlayfs

.PHONY: static
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we do not know what is going inside the kind control plane where the binary will get copied, we do not a static build. There is already a 'release-static' target, but it does require rust / the optimization thing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, how about splitting static-release into static and static-optimizer? but the current changes is also LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, cleaning-up the Makefile in that context would definitely make sense.

@@ -24,21 +24,21 @@ $ nerdctl run --snapshotter nydus --rm nginx

# Show mounted rootfs a container
$ mount
/dev/loop17 on /var/lib/containerd-nydus/snapshots/7/mnt type erofs (ro,relatime,user_xattr,acl,cache_strategy=readaround)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This, and any other similar change is just to complete the transition started in the earlier PR.

ARG CONTAINERD_VER=1.6.15
ARG CONTAINERD_PROJECT=/containerd
ARG RUNC_VERSION=1.1.4
ARG NYDUS_SNAPSHOTTER_PROJECT=/nydus-snapshotter
ARG DOWNLOADS_MIRROR="https://github.com"
ARG NYDUS_VER=2.2.4
ARG NERDCTL_VER=1.0.0
ARG NERDCTL_VER=1.7.6
ARG DELVE_VER=1.23.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pinning delve will avoid one of the recent breakage of the CI, where the latest delve started depending on go features only available in a more recent version of go that what we used here.

@@ -0,0 +1,161 @@
#!/usr/bin/env bash
Copy link
Contributor Author

@apostasie apostasie Jul 31, 2024

Choose a reason for hiding this comment

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

Generic helpers for nydus scripting.

@@ -0,0 +1,113 @@
#!/usr/bin/env bash
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 kind script that replaces the github action logic and can be used locally.

@@ -0,0 +1,228 @@
#!/usr/bin/env bash
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generic bash helpers, not specific to nydus (provides logging, http, heathcheck, minimal github client).

@apostasie
Copy link
Contributor Author

@imeoer rebased - one commit left - CI is green.

I just added a bunch of inline comments to facilitate review.
PTAL at your convenience and LMK if you want anything changed in this.

Thanks for your help!

Copy link
Collaborator

@imeoer imeoer left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@imeoer imeoer merged commit 39737d9 into containerd:main Jul 31, 2024
16 checks passed
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.

2 participants