Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
D
docker-machine
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 25
    • Issues 25
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 6
    • Merge Requests 6
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • CI-CD
  • docker-machine
  • Merge Requests
  • !15

Merged
Opened Oct 21, 2019 by Steve Azzopardi@steveazzOwner

Use cached IP for google driver

  • Overview 2
  • Commits 1
  • Pipelines 4
  • Changes 1

GetIP gets called every time GetSSHHostname is called which is called to run every ssh command to the machine. GetIP is sending a request to the API every time we request it.

Check if the in-memory IP is available before sending a request to the API, and save it at the end as well if it's not present.

Adding tests is quite difficult here since the client for accessing the Google API is created within GetIP so it's not something that can be mocked easily. To make it testable we require a lot of changes to the google driver which will be riskier the not adding tests.

Below are some metrics on how many times we used to call the API for the IP address when creating and removing a machine:

Before Patch: Number of GetIP Calls: 21 Number of Instance.Get Calls: 21

After Patch: Number of GetIP Calls: 21 Number of Instance.Get Calls: 1

Edited Oct 21, 2019 by Steve Azzopardi
Assignee
Assign to
Reviewer
Request review from
12.5
Milestone
12.5 (Past due)
Assign milestone
Time tracking
Reference: gitlab-org/ci-cd/docker-machine!15
Source branch: use-cached-ip-for-google