Whirr
  1. Whirr
  2. WHIRR-672

Allow eager caching of instance hostname based on pre-provision instance metadata

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.2
    • Component/s: core
    • Labels:
      None

      Description

      Allow eager caching of instance hostname based on pre-provision instance metadata.

      This would be nice when running the dry run test-harness against services which require host name lookups, avoiding long blocking timeouts on DNS with nonexistent hostnames, dramatically improving unit test run times.

      It is expected this pre-cache will only be executed by non-production code paths, eg unit tests.

      1. WHIRR-672_VERSION_1.patch
        5 kB
        Graham Gear
      2. WHIRR-672_VERSION_2.patch
        5 kB
        Graham Gear
      3. WHIRR-672_VERSION_3.patch
        2 kB
        Graham Gear

        Activity

        Hide
        Graham Gear added a comment -
        Show
        Graham Gear added a comment - Attached an example implementation: https://issues.apache.org/jira/secure/attachment/12550341/WHIRR-672_VERSION_1.patch This patch helps both the development of WHIRR-671 and https://github.com/cloudera/whirr-cm .
        Hide
        Graham Gear added a comment - - edited

        Attach an updated patch which uses the node metadata name field rather than hostname, which includes an instance ID and is therefore more appropriate.

        https://issues.apache.org/jira/secure/attachment/12550622/WHIRR-672_VERSION_2.patch

        Show
        Graham Gear added a comment - - edited Attach an updated patch which uses the node metadata name field rather than hostname, which includes an instance ID and is therefore more appropriate. https://issues.apache.org/jira/secure/attachment/12550622/WHIRR-672_VERSION_2.patch
        Hide
        Graham Gear added a comment - - edited

        Attach an alternative implementation, which localises the patch to the public host resolution code, not calling out to DNS in the case of a stub provider spawned instance.

        https://issues.apache.org/jira/secure/attachment/12550632/WHIRR-672_VERSION_3.patch

        Note although this implementation is cleaner, it does use a private jClouds API, which could be avoided if we were to expose the Cloud provider at layer publicly accessible to the org.apache.whirr.Instance, eg org.jclouds.compute.domain.NodeMetadata.

        This implementation also resolves an existing issue, in that it improves the fallback hostname to include a instance id if DNS fails.

        Show
        Graham Gear added a comment - - edited Attach an alternative implementation, which localises the patch to the public host resolution code, not calling out to DNS in the case of a stub provider spawned instance. https://issues.apache.org/jira/secure/attachment/12550632/WHIRR-672_VERSION_3.patch Note although this implementation is cleaner, it does use a private jClouds API, which could be avoided if we were to expose the Cloud provider at layer publicly accessible to the org.apache.whirr.Instance, eg org.jclouds.compute.domain.NodeMetadata. This implementation also resolves an existing issue, in that it improves the fallback hostname to include a instance id if DNS fails.
        Hide
        Tom White added a comment -

        +1 I just committed this. Thanks Graham!

        Show
        Tom White added a comment - +1 I just committed this. Thanks Graham!

          People

          • Assignee:
            Graham Gear
            Reporter:
            Graham Gear
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development