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

add e2e test for running nydus snapshotter in Kubernetes #283

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

liubin
Copy link
Contributor

@liubin liubin commented Dec 12, 2022

add e2e test for running nydus snapshotter in Kubernetes

This e2e test will
- deploy nydus snapshotter with RBAC in Kubernetes
- setup a Docker retistry needs auth
- create a dockerconfig secret and let snapshotter get the auth from it

Optimize image size

Change base image from ubuntu to alpine to reduce image size.

Change base image from ubuntu to alpine to reduce image size.

Signed-off-by: bin liu <liubin0329@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2022

Codecov Report

Base: 33.45% // Head: 33.39% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (15f3fdb) compared to base (30980d9).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #283      +/-   ##
==========================================
- Coverage   33.45%   33.39%   -0.06%     
==========================================
  Files          29       29              
  Lines        3124     3129       +5     
==========================================
  Hits         1045     1045              
- Misses       1971     1976       +5     
  Partials      108      108              
Impacted Files Coverage Δ
pkg/manager/manager.go 20.68% <0.00%> (-0.11%) ⬇️
pkg/system/system.go 6.34% <0.00%> (-0.10%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

sudo DOCKER_CONFIG=$HOME/.docker nydusify convert \
--source busybox:latest \
--target ${registry_ip}:5000/busybox:nydus-v5-latest \
--fs-version 5
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe use 6 as default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

"backend": {
"type": "registry",
"config": {
"scheme": "http",
Copy link
Collaborator

Choose a reason for hiding this comment

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

The scheme field can be ignored for nydusd v2.1.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@imeoer
Copy link
Collaborator

imeoer commented Dec 13, 2022

others LGTM!

@liubin liubin force-pushed the feat/k8s-e2e branch 2 times, most recently from 356ff02 to 15f3fdb Compare December 13, 2022 04:08
name: test-pod
spec:
containers:
- name: nginx
Copy link
Member

Choose a reason for hiding this comment

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

This looks odd. The container is named nginx but the image is busybox

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

- --root /var/lib/containerd-nydus
- --address /run/containerd-nydus/containerd-nydus-grpc.sock
- --log-level debug
- --enable-nydus-overlayfs=false
Copy link
Member

Choose a reason for hiding this comment

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

Where do we pack the binary nydus-overlayfs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

docker exec kind-control-plane cat /etc/containerd/config.toml >> $log_dir/containerd-config.toml
docker exec kind-control-plane containerd config dump >> $log_dir/containerd-config-dump.toml

docker exec kind-control-plane journalctl -u containerd >> $log_dir/containerd.log
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to append --no-pager, otherwise I am not sure if the containerd log can be piped

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.
But from the test result, the log wasn't truncated, since there is no tty.

docker exec kind-control-plane containerd config dump >> $log_dir/containerd-config-dump.toml

docker exec kind-control-plane journalctl -u containerd >> $log_dir/containerd.log
docker exec kind-control-plane journalctl -u kubelet >> $log_dir/kubelet.log
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@changweige
Copy link
Member

Otherwise, looks good to me

This e2e test will
- deploy nydus snapshotter with RBAC in Kubernetes
- setup a Docker retistry needs auth
- create a dockerconfig secret and let snapshotter get the auth from it

Signed-off-by: bin liu <liubin0329@gmail.com>
--enable-metrics ${ENABLE_METRICS} \
--enable-nydus-overlayfs ${ENABLE_NYDUS_OVERLAY} \
--enable-metrics=${ENABLE_METRICS} \
--enable-nydus-overlayfs=${ENABLE_NYDUS_OVERLAY} \
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to remove this too? Otherwise, the executive nydus-overlayfs should be installed

Copy link
Member

Choose a reason for hiding this comment

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

I see. It is false, please ignore it.

@changweige changweige merged commit d349d56 into containerd:main Dec 13, 2022
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.

4 participants