Skip to content

Add functional support for Docker sub commands on Solaris#23397

Closed
amitkris wants to merge 4 commits intomoby:masterfrom
amitkris:solaris-1.12
Closed

Add functional support for Docker sub commands on Solaris#23397
amitkris wants to merge 4 commits intomoby:masterfrom
amitkris:solaris-1.12

Conversation

@amitkris
Copy link
Contributor

@amitkris amitkris commented Jun 9, 2016

This PR will add support for a subset docker sub commands on Solaris.
This PR looks to add support for the following subcommands and explicitly disallow the rest on Solaris.

Supported subcommands:
attach, build, commit, cp, create, diff, events ,export, history, images, import, info, inspect, kill , load, login, logout, logs , network(null and bridge driver only), port, ps, pull, push, rename, restart , rm, rmi, run, save, search, start, stop, tag, top, version, wait

Unsupported commands:
exec, pause, stats, service, unpause, update, volume

TODO:

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

@justincormack
Copy link
Contributor

The CI is complaining about some Go linting issues, might be good to clean up.

@thaJeztah
Copy link
Member

08:18:29 # github.com/docker/docker/libcontainerd
08:18:29 libcontainerd/client_linux.go:4: imported and not used: "encoding/json"
08:18:29 libcontainerd/client_linux.go:7: imported and not used: "path/filepath"
08:18:29 libcontainerd/client_linux.go:9: imported and not used: "sync"
08:18:29 libcontainerd/client_linux.go:14: imported and not used: "github.com/docker/docker/pkg/idtools"
08:18:53 Build step 'Execute shell' marked build as failure

@amitkris amitkris force-pushed the solaris-1.12 branch 3 times, most recently from eaceb51 to d9700d8 Compare June 10, 2016 07:50
@tiborvass tiborvass added the status/needs-attention Calls for a collective discussion during a review session label Jun 20, 2016
@thaJeztah thaJeztah added this to the 1.13.0 milestone Jun 20, 2016
@thaJeztah
Copy link
Member

ping @amitkris can you rebase? 1.12 is released, so we can begin moving this forward

@amitkris
Copy link
Contributor Author

@thaJeztah thats great! thanks for the update. will ping here when done.

@amitkris amitkris force-pushed the solaris-1.12 branch 4 times, most recently from 8248e41 to 14328d9 Compare August 9, 2016 04:31
@amitkris
Copy link
Contributor Author

amitkris commented Aug 9, 2016

ping @thaJeztah : rebased changes, its ready to be reviewed.

@amitkris amitkris force-pushed the solaris-1.12 branch 2 times, most recently from 340013d to 0a3df6b Compare August 17, 2016 23:58
@amitkris amitkris changed the title [WIP] Add funtional support for Docker sub commands on Solaris Add funtional support for Docker sub commands on Solaris Aug 24, 2016
@amitkris amitkris force-pushed the solaris-1.12 branch 2 times, most recently from db9feb6 to 86e14f9 Compare September 3, 2016 23:24
@thaJeztah thaJeztah changed the title Add funtional support for Docker sub commands on Solaris Add functional support for Docker sub commands on Solaris Sep 15, 2016
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm. There is no runc on Windows....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jhowardmsft : this change was introduced because the stock runtime was being initialized to runc for all platforms and we wanted it to be runz for Solaris. Due to changes that have come about since then this is no longer required, and the logic can go back to what it was.
I'll revert this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

This only actually builds on Linux, FreeBSD does not have unix.MNT_DETACH, so looks like this should be container_linux and FreeBSD and Solaris can share the other file.

If you don't want to change this, feel free to leave it and I will try to tidy up the mess that is our bitrotted FreeBSD support later...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed the files to container_linux.go and container_notlinux.go

Copy link
Contributor

Choose a reason for hiding this comment

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

this should be split out into a conditionally compiled file ideally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was necessitated because the net package isn't fully threshed out on Solaris.
We have to shell out to the CLI in the interim via this function and it will be removed soon.
Since its temporary I thought it would be best to keep it in the common file for now as opposed to making it platform specific and stubbing it out for all the platforms.
I can change it if you feel strongly about it..

Copy link
Contributor

Choose a reason for hiding this comment

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

no fine to keep it temporarily

daemon/commit.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.

It would be nicer to refactor this as a set of daemon feature flags eg daemon.feature.commitRunning = false and test these rather than OS conditionals, then collect them all together in a per OS file.

Copy link
Contributor Author

@amitkris amitkris Nov 2, 2016

Choose a reason for hiding this comment

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

I'm not sure thats required for one feature?
A multi-platform check such as this is done only in this file (all others are in test files and not feature specific). If such checks show up for multiple features in the future I'd be happy to implement that. For now I think its simplest this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the only feature, there are more, but happy if we fix later.

As a matter of principle, we should not have references to runtime anywhere. These are static features.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about ignoring these values, I think it might be better to error and fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats a good point. Some of the features here have been stubbed pending certain minor changes in Solaris OS code which are being worked upon. Once we have a fully threshed out list of what we're looking to support going forward we will error out on those unsupported.
So until then we'd like to keep it this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

hack/make/cross Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Confusing comment, do you mean "Solaris cannot be cross built"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I've updated the comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure? The man page says that would be a 1 byte blocksize! bs=1024 should work for all platforms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great catch! thanks! I've updated this as you suggested.

@justincormack
Copy link
Contributor

@amitkris hi, have looked through this and added some comments. Generally I would be happy if most/all of them were addressed in followup PRs instead and I think it would be ok to merge as is.

@amitkris
Copy link
Contributor Author

amitkris commented Nov 2, 2016

@justincormack : Hi! Thank you for the comments :)
I've addressed some of your comments and replied to the rest. I've added an additional changeset with the changes. Please let me know what you think.

@thaJeztah
Copy link
Member

@amitkris looks like it needs a rebase

@amitkris
Copy link
Contributor Author

amitkris commented Nov 3, 2016

@thaJeztah : done

@amitkris
Copy link
Contributor Author

amitkris commented Nov 3, 2016

thanks @tiborvass !

@thaJeztah
Copy link
Member

oh, @amitkris is going to squash the last commit before merging, so hold your horses 😄

@amitkris
Copy link
Contributor Author

amitkris commented Nov 4, 2016

thanks @justincormack! squashing the topmost changeset now.

…laris support.

This is because the Solaris platform does not support the syscall package.
Note that while Solaris supports all the common functionality in sys/unix there are platform specific features (for eg. MNT_DETACH) which are not implemented for the Solaris platform.

Signed-off-by: Amit Krishnan <[email protected]>
@thaJeztah
Copy link
Member

Rebased/Carried in #28056

@tiborvass
Copy link
Contributor

In that case I'm closing this one.

@tiborvass tiborvass closed this Nov 4, 2016
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.

7 participants