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

integration: use local registry mirrors #618

Merged
merged 3 commits into from
Sep 19, 2018

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Sep 12, 2018

Use a local mirror for integration tests instead of pulling images all the time.

In the future, we may want to pass in the list of images per package as some of them are dockerfile specific. Also it may be easier (especially for the cleanup) if we would switch to TestMain.

For sharing between packages one can set export BUILDKIT_REGISTRY_MIRROR_DIR=$(mktemp -d), but then they need to clean up this dir themselves as well. We could also set it in hack/test script later.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
Copy link
Member Author

@AkihiroSuda I guess my thinking in b3c3e7d that dial errors in rootless are because of heavier parallelization is not correct. Any ideas?

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
Copy link
Member Author

Green now. The issue was wrong perms on the config file.

@@ -55,6 +55,9 @@ func (r *readerAt) ReadAt(b []byte, off int64) (int, error) {
var totalN int
for len(b) > 0 {
n, err := r.Reader.Read(b)
if err == io.EOF && n == len(b) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@tonistiigi I don't understand this. What if n < len(b) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Then EOF is a regular error. This is actually workaround for containerd issue where some functions do not handle EOF properly as https://golang.org/pkg/io/#ReaderAt defines.

}

if mirrorDir != "" {
if err := syscall.Flock(int(f.Fd()), syscall.LOCK_UN); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not put this in a defer?, what if newRegistry or copyImagesLocal fails ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This lock releases automatically when test exits.

@tonistiigi tonistiigi merged commit 95e6139 into moby:master Sep 19, 2018
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.

3 participants