Skip to content

Upgrading

Bhaskar Maddala edited this page Sep 12, 2015 · 5 revisions

Version 2.0

The upcoming version of Collins includes changes for database schema and production configuration. The upgrade requires you to make the changes prior to attempting to run the latest version.

Here we document some of the changes and new features

User defined views

Monitoring configuration has been replaced by custom user configured views. An example of the change required to transition from monitoring configuration to custom views with the same result is, replacing

monitoring {
  GenericFrame {
   urlTemplate = "https://icinga2.ewr01.tumblr.net/thruk/cgi-bin/status.cgi?host=%s"
  }
}

by

views {
  enabled = true
  frames = {
    monitoring {
      enabled = true
      title = "Monitoring"
      style = "width: 100%;height: 1200px;"
      script = """
        function isEnabled(inp) { 
          var obj = JSON.parse(inp);
          return ((obj.ASSET.TYPE === "SERVER_NODE") && ("HOSTNAME" in obj.ATTRIBS[0]));
        }

        function getUrl(inp) {
          var obj = JSON.parse(inp);
          return "https://icinga2.ewr01.tumblr.net/thruk/cgi-bin/status.cgi?host=" + obj.ATTRIBS[0]["HOSTNAME"];
        } 
      """
    }
  }
}

While the new configuration looks more complicated it provides for greater flexibility. The script element is written in Javascript and requires the implementation of 2 functions isEnabled and getUrl which are passed in a JSON object representing an Asset. This allows for monitoring frames to be defined for Asset of types other than SERVER_NODE. For an additional example please take a look at the views_reference.conf

Provisioner Configuration

New configuration parameter checkCommandTimeout and commandTimeout have been added.

Default Tag Decorator

As part of a naming refactoring change the valueParser property under tag decorators was changes from util.views.DelimiterParser to collins.util.views.DelimiterParser. Please update your configuration.

Better configurability of Actor System

Actor configuration was cleaned up and better defined to provide better configurability of the systems. The configuration used at Tumblr is below. play.akka.actor is the configuration for Play framework while akka.actor is configuration for Collins internal Akka system. For information on the different actors specified here background_processor, solr_asset_updater, solr_asset_log_updater and change_queue_processor please take a look at the developer documentation.

# play default thread pool
# Accessible under play-akka.actor.default-dispatcher
play {
  akka {
    actor {
      default-dispatcher = {
        fork-join-executor {
          parallelism-factor = 1.0
          parallelism-max = 24
        }
      }
    }
  }
}

# Akka system used internally by Collins
akka {
  actor {
    default-dispatcher = {
      fork-join-executor {
        parallelism-factor = 1.0
        parallelism-max = 24
      }
    }

    deployment = {
      /background-processor = {
        dispatcher = default-dispatcher
        router = round-robin
        nr-of-instances = 128
      }

      /solr_asset_updater = {
        dispatcher = default-dispatcher
        router = round-robin
        nr-of-instances = 1
      }

      /solr_asset_log_updater = {
        dispatcher = default-dispatcher
        router = round-robin
        nr-of-instances = 1
      }

      /change_queue_processor = {
        dispatcher = default-dispatcher
        router = round-robin
        nr-of-instances = 1
      }
    }
  }
}

Asset Log Schema updates

A new field CREATED_BY has been added to ASSET_LOG to keep track of the account creating the log. This field is exposed in the log view in the GUI and the ruby client API.

Better Configurability of Caching system

Collins can be configured to use either GuavaCache or Hazelcast based caches for domain objects. Hazelcast is recommended for used in a clustered deployment (HA) of Collins, and GuavaCache for standalone (single instance) deployment.

Additional configuration options for Cache performance have been exposed to the user. For instance when using Guava Cache the specification property can be used to configure its behavior as below. For a full list of options available please see documentation for GuavaCacheBuilder

cache {
  enabled=true
  specification="maximumSize=10000,expireAfterWrite=10s,recordStats"
}