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

Tiny image import fix #553

Merged
merged 1 commit into from
Mar 16, 2020
Merged

Conversation

darkowlzz
Copy link
Contributor

When an image is very small, filesystem creation using mkfs fails due to
not enough space. This adds a minimum base image size that's used when
the image is too small.

Also, fixes the /etc/resolv.conf symlink error when there's no /etc
directory in the image filesystem. /etc dir is created as part of the
import step if it doesn't exists.

Adds an e2e test for this fix using hello-world docker container image
which is tiny and lacks /etc dir.

Fixes #402

@darkowlzz darkowlzz requested a review from twelho as a code owner March 5, 2020 09:19
When an image is very small, filesystem creation using mkfs fails due to
not enough space. This adds a minimum base image size that's used when
the image is too small.

Also, fixes the /etc/resolv.conf symlink error when there's no /etc
directory in the image filesystem. /etc dir is created as part of the
import step if it doesn't exists.

Adds an e2e test for this fix using hello-world docker container image
which is tiny and lacks /etc dir.
@bbros-dev
Copy link

bbros-dev commented Mar 5, 2020

From your comment in #402

I'm not sure about a solution for this. Maybe just log a warning when resolv.conf setup fails?

Can you document the choice made, either in a FAQ type section hinting at the cause of certain errors or in the kernel build documentation?

@darkowlzz
Copy link
Contributor Author

Can you document the choice made, either in a FAQ type section hinting at the cause of certain errors or in the kernel build documentation?

This will not be a problem anymore after this is merged. This is following the firecracker networking option Kernel Boot Param . Ignite image import was failing to create a symlink from /etc/resolv.conf to /proc/net/pnp because images like hello-world and busybox don't have /etc directory at root directory. With this fix, the import step will create /etc if it doesn't exists.

@bbros-dev
Copy link

bbros-dev commented Mar 6, 2020

Testing one of them should be enough

Apologies for not being clearer. I didn't suggest testing both.

Just the record and by way of explanation: From (bitter) experience I always take hello world examples with a shovel of salt - it tends to indicate real usage isn't as trivial as they are trying to make out - so they use 'hello world'. If something real was as simple they would have made/used the real test/demo case.

@darkowlzz
Copy link
Contributor Author

darkowlzz commented Mar 9, 2020

@bbros-dev As per my understanding, this issue is about two fixes, small size and missing /etc dir. Busybox is about ~1.2 MB, which is more than what we need to test the fix. hello-world image is ~1.8 kB, which fits the need for this small size test. Dockerfile source for both busybox and hello-world are not very different.
If you can recommend any other real image that's as small as hello-world (requirement: image size * 3 < 500 kB) happy to use that.

@bbros-dev
Copy link

No worries.

@stealthybox
Copy link
Contributor

Regardless of the lack of a known example for a vm userspace < 0.5MB, this fix is very reasonable.
Thanks all for taking the time to report, discuss, and implement it.

@stealthybox stealthybox merged commit 32cc9b1 into weaveworks:master Mar 16, 2020
@luxas luxas added this to the v0.7.0 milestone Jun 2, 2020
@gaby gaby mentioned this pull request Mar 10, 2021
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.

Cant pull Docker hello-world image
4 participants