Skip to content

Add functional support for Docker sub commands on Solaris#28056

Merged
tiborvass merged 1 commit intomoby:masterfrom
LK4D4:solaris_me
Nov 8, 2016
Merged

Add functional support for Docker sub commands on Solaris#28056
tiborvass merged 1 commit intomoby:masterfrom
LK4D4:solaris_me

Conversation

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Nov 4, 2016

This is the carry of #23397 to free @amitkris from hell of a rebase. That PR was in merged state, so we can merge this when CI will pass.
Closes #23397

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 4, 2016

@amitkris would you mind to try before merge?

@thaJeztah thaJeztah added this to the 1.13.0 milestone Nov 4, 2016
@amitkris
Copy link
Contributor

amitkris commented Nov 4, 2016

@LK4D4 : Thank you so much for doing this!
How do I clone your branch so that I can quickly test the changes?

@amitkris
Copy link
Contributor

amitkris commented Nov 4, 2016

@thaJeztah thanks!

@LK4D4 : There were two things that need to be modified for the above changeset to work on Solaris.
In #27912 in hack/make.sh https://github.com/docker/docker/blob/master/hack/make.sh#L104
was modified
from : export GOPATH="${PWD}/.gopath:${PWD}/vendor"
to : export GOPATH="${PWD}/.gopath"
We build with AUTO_GOPATH=1 on Solaris and we need $(PWD)/vendor to be in the GOPATH to build the source. Can this be added back? It can even be in the Solaris specific if statement that follows this line if it is not desired as a general setting for the GOPATH.

Again in #27912 there is a difference in the version number of the fsnotify package that was previously in hack/vendor.sh and that was added in vendor.conf
hack/vendor.sh
clone git gopkg.in/fsnotify.v1 v1.2.11
vendor.conf
github.com/fsnotify/fsnotify v1.2.1
v1.2.11 of fsnotify contains Solaris support. Could we please restore this to v1.2.11?

With these two changes this changeset builds and runs on Solaris as expected. Thank you once again for helping me out with this rebase!

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 4, 2016

@amitkris actually AUTO_GOPATH should work. vendor directory is no more "gopath" on itself.
I'll update fsnotify now.

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 4, 2016

@amitkris updated fsnotify. Now we need to figure out stuff with AUTO_GOPATH. Pls ping me in IRC if you have time

@amitkris
Copy link
Contributor

amitkris commented Nov 4, 2016

Sorted out all outstanding issues with @LK4D4 offline.
The functionality works as expected on Solaris now.
LGTM! :D

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 4, 2016

@mlaventure has some concerns about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather have listSystemIPs() be in a platform specific file than making use of runtime.GOOS.

Copy link
Contributor

@mlaventure mlaventure Nov 4, 2016

Choose a reason for hiding this comment

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

It's a copy of the version in container_operations_unix.go, could it be moved to a common files to avoid duplications? We'd definitely forget to update the solaris version if we ever had to make changes to this routine.

Copy link
Contributor

Choose a reason for hiding this comment

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

The only difference here is the lack of call to mount.MakeRPrivate could we just have a stub for solaris in pkg/mount/sharedsubtree_solaris.go?

edit: And I just saw that this file actually exists :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong comment format

Copy link
Contributor

Choose a reason for hiding this comment

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

remove the \n

daemon/start.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

remove \n

daemon/start.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently on Linux this just fails when we try to actually run the image, wouldn't the same happen on Solaris?

Also, this probably make more sense in the containerCreate side of things, might as well fails as early as possible

Copy link
Contributor

Choose a reason for hiding this comment

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

defer should be just after the Lock

Copy link
Contributor

Choose a reason for hiding this comment

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

runtime == runc? I thought it was named runz? :)

Also this can be removed, if the user specify an invalid runtime this will fails and that's the expected behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

same as above. For maximum reutilization of common code and due to the stockRuntimeName issues we're sticking to runc in the engine for Soalris.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I usually prefer having a dedicated file with a stub than checking GOOS. Easier to maintain and expand IMHO.

@mlaventure
Copy link
Contributor

In which case the code can stay unmodified.

If the user explicitly specify a non compatible runtime, it's up to him to
fix it, the default would still work.

On Fri, Nov 4, 2016 at 3:08 PM Amit Krishnan [email protected]
wrote:

@amitkris commented on this pull request.

In libcontainerd/remote_unix.go
#28056:

    "--metrics-interval=0",
  "--start-timeout", "2m",
  "--state-dir", filepath.Join(r.stateDir, containerdStateDir),

}

  • if r.runtime != "" {
  • args = append(args, "--runtime")
    
  • args = append(args, r.runtime)
    
  • if goruntime.GOOS == "solaris" {
  • args = append(args, "--shim", "containerd-shim", "--runtime", "runc")
    

same as above. For maximum reutilization of common code and due to the
stockRuntimeName issues we're sticking to runc in the engine for Soalris.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#28056, or mute the thread
https://github.com/notifications/unsubscribe-auth/APUifizBGK78fCmuQCsvCFKX8wU-h_j8ks5q66zugaJpZM4KpHYy
.

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 5, 2016

I've fixed some nits, but splitting to files is still problematic for me. Because solaris uses many functions from _unix.go files which are also used for linux and freebsd, but some of them should be split to some OTHER file for linux and freebsd and I don't know how to call it(linux_freebsg.go? unix_not_solaris.go?).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amitkris shouldn't we hide tests behind tag? This really looks bad.

Copy link
Contributor

Choose a reason for hiding this comment

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

@LK4D4: My only intention there was to get daemon/graphdriver tests to not run for Solaris. We support only zfs and running the other graph plugins doesn't make sense.
With my limited understanding of hack/make/test-unit this seemed to be the simplest way to do it.
Any logic that would help accomplish this better is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amitkris let me know which tests fail for you. They all should be behind linux tag.

Copy link
Contributor

Choose a reason for hiding this comment

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

@LK4D4 : everything in graphdriver except zfs fails for Solaris.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amitkris What the errors? All graphdrivers behind linux build tag.

Copy link
Contributor

Choose a reason for hiding this comment

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

@LK4D4 : sorry misunderstood your question the first time. The issue is with graphtest/graphtest_unix.go. Enabling that for Solaris calls into devmapper for some reason and that fails and then terminates the entire test run. Please remove the Solaris build tag from graphtest_unix.go for now. I will investigate and fix that in a follow up.
Once the solaris build tag is removed frm that file hack/make/test-unit can go back to the way it was.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for explanation.

hack/make/tgz Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amitkris can you describe more

Copy link
Contributor

Choose a reason for hiding this comment

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

@LK4D4 : The libnetwork changes that I vendored in with my original PR were being called only from Solaris files. This caused an issue with the vendor CI which being run on a linux box did not detect the dependencies in use by Solaris files.
To fix this I added the solaris/amd64 tag in vendor. As a result of this make/cross tried to build Solaris binaries and failed due to the CGO calls which call into Solaris specific header files.
So to make the vendor CI and make/cross pass we added bypassed the cross build for Solaris with the above elif continue.

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 5, 2016

Also, I've rebased on master. So, now changes are way smaller.

@mlaventure
Copy link
Contributor

It doesn't build

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 7, 2016

By the way it's common problem with files. You can find examples of duplication in net standard package :(

@mlaventure
Copy link
Contributor

I'll open an issue for tracking the deduplication as far as Solaris is concerned then so this can be moved along.

@LK4D4
Copy link
Contributor Author

LK4D4 commented Nov 7, 2016

@mlaventure btw, I think I've fixed duplication issues which you mentioned.

Signed-off-by: Amit Krishnan <[email protected]>

Signed-off-by: Alexander Morozov <[email protected]>
@tiborvass
Copy link
Contributor

LGTM

@tiborvass tiborvass merged commit 109c26b into moby:master Nov 8, 2016
@amitkris
Copy link
Contributor

amitkris commented Nov 8, 2016

thank you @LK4D4 @thaJeztah @mlaventure @tiborvass! :D

@LK4D4 LK4D4 deleted the solaris_me branch November 8, 2016 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants