Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Implement Machine fix for host-only adapter #656

Merged
merged 1 commit into from Mar 2, 2016
Merged

Conversation

thieman
Copy link
Contributor

@thieman thieman commented Mar 2, 2016

@paetling This brings docker/machine#3112 into Dusty. We ported the Machine code that gets the VM IP into Dusty to get around Machine's slow startup times. Unfortunately, that means we need to keep the underlying code in sync when big bug fixes go out.

As part of this, attempted to memoize the VBoxManage showvminfo call. Busting cache whenever we take the machine up/down to make it pick up VM config changes we sometimes make, e.g. changing the NIC. Will want to run this through its paces in RC, the memoize part might have broken stuff.

@@ -115,6 +115,7 @@ def _stop_docker_vm():
"""Stop the Dusty VM if it is not already stopped."""
check_call_demoted(['docker-machine', 'stop', constants.VM_MACHINE_NAME], redirect_stderr=True)

@memoized
def _get_vm_config():
return check_output_demoted(['VBoxManage', 'showvminfo', '--machinereadable', constants.VM_MACHINE_NAME]).splitlines()
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this worth memoizing? Is it really slow? seems like needless speedup with costs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, you reset it in ensure_docker_vm_is_started(). So should not change without caching being busted. Still curious about speedup. We call it 2X less right? Not like we are pinging this like crazy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not hitting it super hard, but it does take about 150ms each time

thieman added a commit that referenced this pull request Mar 2, 2016
Implement Machine fix for host-only adapter
@thieman thieman merged commit 06485ec into master Mar 2, 2016
@thieman thieman deleted the tnt-host-only-fix branch March 2, 2016 17:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants