Skip to content

Comments

Fixed file hashing for LCOW.#37316

Closed
notanaverageman wants to merge 1 commit intomoby:masterfrom
notanaverageman:lcow_wrong_cache
Closed

Fixed file hashing for LCOW.#37316
notanaverageman wants to merge 1 commit intomoby:masterfrom
notanaverageman:lcow_wrong_cache

Conversation

@notanaverageman
Copy link
Contributor

- What I did
While file hashes are being generated, they are searched on the host filesystem. For LCOW this always returns a file not found error and the file name is used instead of the SHA hash. This was causing wrong cache uses like #36793. I have fixed the hashing method for LCOW.

- How I did it
For LCOW, instead of trying to read the file from the host filesystem, use the container filesystem.

- How to verify it
#36793 has the necessary steps.

- Description for the changelog

Fixed file hash values for LCOW that caused wrong usage of layer caches.

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Yusuf Tarık Günaydın <[email protected]>
@thaJeztah
Copy link
Member

ping @jhowardmsft @johnstep PTAL

@cpuguy83
Copy link
Member

Seems like this should be handled lower down in the abstraction, as is this is pretty sloppy.

@notanaverageman
Copy link
Contributor Author

I am not familiar with this repository to make the abstraction and also do not have time for it. I have written a comment on #36793. If someone tries to fix this, he can use the information there. So, closing this.

@lowenna
Copy link
Member

lowenna commented Jun 27, 2018

I think the right/cleaner fix is:

	fi, err := c.root.Lstat(fullPath)
	if err != nil {
		// Backwards compatibility: a missing file returns a path as hash.
		// This is reached in the case of a broken symlink.
		return relPath, nil
	}

which takes advantage of containerd\continuity\driver abstraction.

I'll test this and put a replacement PR in if so.

@cpuguy83
Copy link
Member

@yusuf-gunaydin understood, thanks for the contribution!

@thaJeztah thaJeztah added the area/lcow Issues and PR's related to the experimental LCOW feature label Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/builder Build area/lcow Issues and PR's related to the experimental LCOW feature kind/experimental platform/windows status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants