<commit_before>#!/usr/bin/ruby -I/usr/share/omf-common-5.3

require 'omf-common/omfPubSubMessage.rb'
require "pubsubTester"

@slice = "omf.nicta.slice1"
@tester = PubSubTester.new("<EMAIL>", "omf", "norbit.npc.nicta.com.au", "norbit.npc.nicta.com.au", true)

def create (node, hrn, ipaddr)
  msg = @tester.newcmd(:cmdType => "CREATE_SLIVER", :target => "#{node}", :slicename => "#{@slice}", 
  :resname => "#{hrn}", :slivertype => 'openvz', :commaddr => 'norbit.npc.nicta.com.au', 
  :sliveraddress => "#{ipaddr}", :slivernameserver => '10.0.0.200')
  @tester.send("/OMF/system/#{node}", msg)
  msg = @tester.newcmd(:cmdType => "NOOP", :target => "#{node}")
  @tester.send("/OMF/system/#{node}", msg)
  # TODO: these nodes will be created by the RM in the future
  # creating 5 slice nodes per host
  1.upto(5) { |n|
    begin
      @tester.create("/OMF/#{@slice}/resources/#{hrn}_#{n}")
    rescue
    end
  }
end

begin
  @tester.create("/OMF/#{slice}")
  @tester.create("/OMF/#{slice}/resources")
rescue
end

# create two slivers on node 30
create("node30","omf.nicta.node30", "10.0.1.30")
create("node30","omf.nicta.node30", "10.0.2.30")

# create two slivers on node 29
create("node29","omf.nicta.node29", "10.0.1.29")
create("node29","omf.nicta.node29", "10.0.2.29")

# create two slivers on node 28
create("node28","omf.nicta.node28", "10.0.1.28")
create("node28","omf.nicta.node28", "10.0.2.28")

#msg = tester.newcmd(:cmdType => "CREATE_SLIVER", :target => "norbit.npc.nicta.com.au")
#msg = tester.newcmd(:cmdType => "KILL", :target => "norbit.npc.nicta.com.au", :appID => 0, :value => 9)
# msg = tester.newcmd(:cmdType => "CREATE_SLIVER", :target => "norbit.npc.nicta.com.au", :slicename => 'omf.nicta.slice1', :resname => '8', :slivertype => 'openvz', :commaddr => 'norbit.npc.nicta.com.au')
#msg = tester.newcmd(:cmdType => "DELETE_SLIVER", :target => "norbit.npc.nicta.com.au", :resname => '8', :slicename => 'omf.nicta.slice1', :slivertype => 'openvz')


#msg = tester.newcmd(:cmdType => "NOOP", :target => "norbit.npc.nicta.com.au")
#tester.send("/OMF/system/node30", msg)
<commit_msg>using some different nodes in the createslice script<commit_after>#!/usr/bin/ruby -I/usr/share/omf-common-5.3

require 'omf-common/omfPubSubMessage.rb'
require "pubsubTester"

@slice = "omf.nicta.slice1"
@tester = PubSubTester.new("<EMAIL>", "omf", "norbit.npc.nicta.com.au", "norbit.npc.nicta.com.au", true)

def create (node, hrn, ipaddr)
  msg = @tester.newcmd(:cmdType => "CREATE_SLIVER", :target => "#{node}", :slicename => "#{@slice}", 
  :resname => "#{hrn}", :slivertype => 'openvz', :commaddr => 'norbit.npc.nicta.com.au', 
  :sliveraddress => "#{ipaddr}", :slivernameserver => '10.0.0.200')
  @tester.send("/OMF/system/#{node}", msg)
  msg = @tester.newcmd(:cmdType => "NOOP", :target => "#{node}")
  @tester.send("/OMF/system/#{node}", msg)
  # TODO: these nodes will be created by the RM in the future
  # creating 5 slice nodes per host
  1.upto(5) { |n|
    begin
      @tester.create("/OMF/#{@slice}/resources/#{hrn}_#{n}")
    rescue
    end
  }
end

begin
  @tester.create("/OMF/#{slice}")
  @tester.create("/OMF/#{slice}/resources")
rescue
end

# create two slivers on node 30
create("node30", "omf.nicta.node30", "10.0.1.30")
create("node30", "omf.nicta.node30", "10.0.2.30")

# create two slivers on node 29
create("node29", "omf.nicta.node29", "10.0.1.29")
create("node29", "omf.nicta.node29", "10.0.2.29")

# create two slivers on node 28
create("node28", "omf.nicta.node28", "10.0.1.28")
create("node28", "omf.nicta.node28", "10.0.2.28")

#msg = tester.newcmd(:cmdType => "CREATE_SLIVER", :target => "norbit.npc.nicta.com.au")
#msg = tester.newcmd(:cmdType => "KILL", :target => "norbit.npc.nicta.com.au", :appID => 0, :value => 9)
# msg = tester.newcmd(:cmdType => "CREATE_SLIVER", :target => "norbit.npc.nicta.com.au", :slicename => 'omf.nicta.slice1', :resname => '8', :slivertype => 'openvz', :commaddr => 'norbit.npc.nicta.com.au')
#msg = tester.newcmd(:cmdType => "DELETE_SLIVER", :target => "norbit.npc.nicta.com.au", :resname => '8', :slicename => 'omf.nicta.slice1', :slivertype => 'openvz')


#msg = tester.newcmd(:cmdType => "NOOP", :target => "norbit.npc.nicta.com.au")
#tester.send("/OMF/system/node30", msg)

{'fraction_non_alphanumeric': 0.2308598351001178, 'fraction_numerical': 0.04098939929328622, 'mean_word_length': 4.616402116402116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 14, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6160760', 'n_tokens_mistral': 1894, 'n_tokens_neox': 1797, 'n_words': 313}