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

Add linux bind volume support #73

Merged
merged 10 commits into from
Oct 10, 2017
Merged

Add linux bind volume support #73

merged 10 commits into from
Oct 10, 2017

Conversation

febbraro
Copy link
Member

@febbraro febbraro commented Oct 5, 2017

Some exploration into having linux use bind volume mounts (instead of unison) so that we don't need different configs for volumes on mac & linux

cmd.out.Verbose.Printf("Setting up local volume: %s", volumeName)
cmd.SetupBindVolume(volumeName)
default:
cmd.out.Verbose.Printf("Volume Sync not supported on: %s", platform)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does unison not work on Windows?

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't know, we have not tried it yet, but at a minimum the binary would likely be something like unison.exe so our current command would not be supported. I think windows also does cli options differently.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, so currently we are in aggressive conflict with Windows. Perhaps in the recent change to generator-outrigger-drupal, I should have it use the "devcloud" options for non-Darwin, instead of for linux specifically.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused what hole are we leaving Windows users in? Is it "Add Unison support on Windows" or is it "Treat Windows like Linux"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Windows support would be "Treat Windows like Mac"

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I see what you mean.... let's default to what mac does and lets just use Linux as the single case.

Copy link
Member

@mike-potter mike-potter left a comment

Choose a reason for hiding this comment

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

I like this approach.

@grayside grayside mentioned this pull request Oct 6, 2017
20 tasks
@febbraro febbraro changed the title [WIP] Add linux bind volume support Add linux bind volume support Oct 10, 2017
@febbraro
Copy link
Member Author

Moved from WIP to legit PR. Verified sync:start as working on Linux, and also folded in a few more compat fixes to doctor

cmd.out.Verbose.Printf("Setting up local volume: %s", volumeName)
cmd.SetupBindVolume(volumeName)
default:
cmd.out.Verbose.Printf("Volume Sync not supported on: %s", platform)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused what hole are we leaving Windows users in? Is it "Add Unison support on Windows" or is it "Treat Windows like Linux"?

"volume", "create",
"--opt", "type=none",
"--opt", fmt.Sprintf("device=%s", workingDir),
"--opt", "o=bind",
Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear, the lack of specifying ro meant this is a read/write binding?

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you suggesting that we explicitly mark it :rw

Copy link
Contributor

Choose a reason for hiding this comment

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

Just confirming its rw.

func (cmd *ProjectSync) RunStop(ctx *cli.Context) error {
if runtime.GOOS == "linux" {
cmd.out.Info.Println("No unison container to stop, using local bind volume")
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are creating the volume as an external, shouldn't this stop the volume for them?

And if so, as long as any action is taken I think logging about no-op should be verbose.

Copy link
Member Author

Choose a reason for hiding this comment

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

Volumes are not start or stopped, they just exist. Are you suggesting we do the volume remove here in the stop?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, you are right, we should probably not do a volume remove here.

@febbraro febbraro merged commit db7ed4c into develop Oct 10, 2017
@febbraro febbraro deleted the feature/linux-sync branch October 10, 2017 22:53
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.

3 participants