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

Image import from tar archives #75

Merged
merged 5 commits into from
Apr 4, 2017

Conversation

ubuntolog
Copy link
Contributor

Image import from tar archives has been implemented. Metadata is extracted from Manifest.json, since there is a problem with the Docker remote API (fsouza/go-dockerclient#645 (comment)). Makefile has been modified to work on Mac (the last update made go partly incompatible with the latest XCode). Services.jsx and Jobs.jsx do not throw exceptions when an empty list is found, instead we show a simple message. Updated React-Dropzone component, but it still cannot handle correctly multiple file upload: uploading is done in chunks of two files (by default), ImageBuild fails, if a Dockerfile is not in the first chunk (has to be investigated #74).

Makefile Outdated
@@ -10,14 +10,14 @@ webui:

containers:
(cd $(INTERNALSERVICES)/volume-stage-in && docker build -t volume-stage-in .)
(cd $(INTERNALSERVICES)/volume-filelist && GOOS=linux GOARCH=amd64 go build && docker build -t volume-filelist .)
(cd $(INTERNALSERVICES)/volume-filelist && GOOS=linux GOARCH=amd64 go build -ldflags -s && docker build -t volume-filelist .)
Copy link
Member

Choose a reason for hiding this comment

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

Please define GOFLAGS=-ldflags -s at the top of the makefile and use go build $(GOFLAGS) where needed, this way we can change the flags once.

if _, err := os.Stat(filepath.Join(buildDir, "Dockerfile")); os.IsNotExist(err) {
Response{w}.ServerError("no Dockerfile to build new image ", err)
return
if strings.HasSuffix(strings.ToLower(part.FileName()), ".tar") || strings.HasSuffix(strings.ToLower(part.FileName()), ".tar.gz") {
Copy link
Member

Choose a reason for hiding this comment

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

I think the logic is not perfect here. I would first save all the files on the file system, and then 1. if there exists a Dockerfile, assume build image is expected, or 2. if there is a single tar file, assume an image.

Right now the user may send a Dockerfile together with a .tar file that is used in the Dockerfile, and the assumption that the .tar file is an image would be incorrect.

@emanueldima emanueldima merged commit db43da1 into EUDAT-GEF:master Apr 4, 2017
@ubuntolog ubuntolog deleted the imageimport branch April 4, 2017 13:15
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.

2 participants