Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Allow drivers to skip SSH provisioning #886

Open
twhiteman opened this issue Mar 26, 2015 · 7 comments
Open

Allow drivers to skip SSH provisioning #886

twhiteman opened this issue Mar 26, 2015 · 7 comments

Comments

@twhiteman
Copy link

Currently the "none" driver name is used to skip the SSH provisioning steps:

// TODO: Not really a fan of just checking "none" here.

I'd like to be able to skip the SSH provisioning too, for a SDC Docker driver I'm writing.

My initial thoughts are to add SupportsSSH() or SupportsSSHProvisioning() to the Driver interface - but that requires changes to all existing drivers - which I'd prefer to avoid.

Any thoughts for best approach?

@nathanleclaire
Copy link
Contributor

@twhiteman What specifically are you wanting to skip? Installation of Docker? Setting hostname, configuration of the certs etc.?

@twhiteman
Copy link
Author

@nathanleclaire All of it :P - I wanted to create a driver (which behaves similar to the none driver), but where I can specify the SDC Docker settings, like:

   --sdc-account "twhiteman"        SDC Account [$SDC_ACCOUNT]
   --sdc-key "path-to-cert"         SDC SSH key [$SDC_KEY]
   --sdc-region "us-east-3b"        SDC data center (DC) [$SDC_REGION]

This is in the aim of then being able to use docker-machine env to populate the docker client settings.

Perhaps another take on this would be imaging the provisioning steps occurring over a REST API?

Note: The SDC Docker already handles the remote docker machine setup in other ways, so the other docker-machine commands (start, stop, upgrade, rm, ...) are not applicable for SDC Docker.

@nathanleclaire
Copy link
Contributor

What OS is SDC behind the scenes? If SDC supports /etc/os-release I think your easiest way would be to implement a custom provisioner.

@twhiteman
Copy link
Author

OS: SmartOS / Illumos (aka Solaris) - no /etc/os-release (it's Unix but not Linux).

For custom provisioner, it looks like it still requires SSH, thus my question about an alternative merthod (if I'm reading the code right). C.f.:

catOsReleaseCmd, err := drivers.GetSSHCommandFromDriver(d, "cat /etc/os-release")

// TODO: Not really a fan of just checking "none" here.

@twhiteman
Copy link
Author

Note that the SDC Docker I'm referring to uses its own implementation of the Docker Remote API, so it's somewhat different to a regular docker host setup. This means the provisioning side for SDC Docker (setting up keys/certs, managing machines, installing docker, ...) is already done (already available) when the user first creates an account with SDC.

@nathanleclaire nathanleclaire added this to the 0.5.0 milestone Sep 5, 2015
@dmp42 dmp42 removed this from the 0.5.0 milestone Oct 21, 2015
@nathanleclaire nathanleclaire changed the title Add option to skip SSH provisioning Allow drivers to skip SSH provisioning Oct 29, 2015
@nathanleclaire
Copy link
Contributor

Here's my thinking on how to enable this (since IMO it's a very important type of driver to enable and would love to see Triton / Carina type drivers):

I don't want to change the Driver interface directly since it is a huge pain to try and do so (at least without a version bump to the driver API, which I want to save until we're going to make some changes that are really exceptionally worth it). But, I think we can use Go's type system to control flows like this.

Basically, I'm thinking that maybe we can bundle the methods related to SSH into another interface (say SSHer) and embed that into the Driver interface. Consequently, we can make a SkipSSHer interface which drivers such as Triton embed (which fulfills the interface, but with "noop" methods), and then check the driver to see if it fulfills SkipSSHer before moving forward with provisioning. If it does we will, naturally, skip the normal provisioning process.

@hairyhenderson
Copy link
Contributor

I think the SkipSSHer idea is probably the best way to get this going quickly and without too much pain.

But I think we should also consider bumping the Driver API, and adding a mechanism for a driver to override DetectProvisioner and provide its own provisioning mechanism...

@dgageot dgageot added area/ssh and removed area/ssh labels Feb 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants