-
Couldn't load subscription status.
- Fork 62
Add support for converting OCI tarfiles #200
Conversation
lib/internal/backend/file/file.go
Outdated
| type FileBackend struct { | ||
| file *os.File | ||
| file *os.File | ||
| fname string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does file.Name() work for this?
|
Cool! |
|
ah good call. I didn't realize the go file object stored the name. Changed it to use that. |
|
I could take a look on Wednesday, scrambling to do a project for school currently
|
|
ping @dgonyeo |
|
Wow, so sorry about dropping this. Reviewing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little silly of a situation to be in, but rkt's tests of docker2aci flex more parts of this codebase than docker2aci's tests. Would you be willing to update docker2aci in rkt, run the tests, and see if they pass? If you don't have the bandwidth I can take care of it.
Also since I took so long to get around to reviewing this, it looks like a rebase is needed.
| func getImageID(file *os.File, dockerURL *types.ParsedDockerURL) (string, *types.ParsedDockerURL, error) { | ||
| func (lb *FileBackend) BuildACIV22(layerIDs []string, dockerURL *types.ParsedDockerURL, outputDir string, tmpBaseDir string, compression common.Compression) ([]string, []*schema.ImageManifest, error) { | ||
| if len(layerIDs) < 2 { | ||
| return nil, nil, fmt.Errorf("insufficient layers for oci image") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain this a little? Are single layer OCI images not possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the above comment "// for oci the first image is the config"
To build an oci we need the sha of the image config object as well as the sha of the layers since it isn't in a known location like it is with v1 docker images. The sha of the image.json is being passed as the first item in the layers slice. It is pulled out below. This was the easiest way to get the data here without modifying the signature of a bunch of methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah gotcha, makes sense.
Sometimes aciPath doesn't have a leading directory when writing with --nosquash. Instead of failing because we can't create the directory, it makes sesnse to just write the files locally.
|
rebased. Will try rkt tests |
glide.lock
Outdated
| imports: | ||
| - name: github.com/appc/spec | ||
| version: fd5e3d8f5d596c6fbd506e80b5e13ba8a97b704c | ||
| version: f329150233aa3ac6c83ab5ba02a2b5a8bd03d365 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we are using tilde-versions in glide.yaml, so everything is getting bumped to latest patch release, but with a major-version of 0 this doesn't make sense. Do we perhaps want to pin down to exact versions instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glide doesn't seem to offer the ability to just update a single package. If there is a way to do this, I'm happy to just add the new package without touching anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also not aware of a functionality to update just a single package in glide, unfortunately. That is why we pin versions in rkt to avoid general bumps like this. I suggest to pin versions and bump just the single package, or make a local test-run with unchecked tilde-versions in glide.yaml to check if there are note-worthy updates in other packages too.
|
The unit tests pass fine with the new version. The functional tests are getting a lot of failures but i suspect they fail without my changes as well. It looks like they are failing because i don't have overlayfs enabled on my build machine |
Note that the oci layout doesn't have a name associated with the image, so this uses the filename of the tar file if --image=IMAGE_NAME isn't explicitly passed in.
|
Ok I manually updated the glide.yaml and glide.lock and used glide install. The hash on the lock file doesn't match anymore, but this means that the update can be done separately after the merge. |
|
Sorry about the couple day delay, was fighting with my setup over something dumb. LGTM |
This also switches to the new OCI media types.