[CORD-2636]
Remove unused/obsolete files (v2)
Change-Id: I2e46488d9fe6d04755718c503a5ec51d525d48a7
diff --git a/ansible/group_vars/all b/ansible/group_vars/all
deleted file mode 100644
index 795a286..0000000
--- a/ansible/group_vars/all
+++ /dev/null
@@ -1,9 +0,0 @@
-ip: "{{ facter_ipaddress_eth1 }}"
-consul_extra: ""
-proxy_url: http://{{ facter_ipaddress_eth1 }}
-proxy_url2: http://{{ facter_ipaddress_eth1 }}
-registry_url: 10.100.198.200:5000/
-jenkins_ip: 10.100.198.200
-docker_cfg: docker.cfg
-docker_cfg_dest: /etc/default/docker
-fabric: false
diff --git a/ansible/host_vars/10.100.198.200 b/ansible/host_vars/10.100.198.200
deleted file mode 100644
index 4adcd6d..0000000
--- a/ansible/host_vars/10.100.198.200
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ansible_ssh_private_key_file: /cord/.vagrant/machines/corddev/virtualbox/private_key
diff --git a/ansible/host_vars/10.100.198.201 b/ansible/host_vars/10.100.198.201
deleted file mode 100644
index f5ab39a..0000000
--- a/ansible/host_vars/10.100.198.201
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-ansible_ssh_private_key_file: /cord/.vagrant/machines/prod/virtualbox/private_key
diff --git a/ansible/hosts/prod b/ansible/hosts/prod
deleted file mode 100644
index 66da1c1..0000000
--- a/ansible/hosts/prod
+++ /dev/null
@@ -1,6 +0,0 @@
-[jenkins-node]
-10.100.198.200
-10.100.198.201
-
-[prod]
-10.100.198.201 consul_extra="-server -bootstrap -ui"
diff --git a/elk-logger/logstash_tail b/elk-logger/logstash_tail
deleted file mode 100755
index 6b29718..0000000
--- a/elk-logger/logstash_tail
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/usr/bin/python
-
-import pdb
-import argparse
-import sys
-from pyparsing import *
-import json
-import os
-import patterns
-import json
-import logging
-import logstash
-import time
-
-def follow(thefile):
- while True:
- line = thefile.readline()
- if not line:
- time.sleep(0.1)
- continue
- yield line
-
-
-parse = argparse.ArgumentParser(description='Convert log file to json.')
-parse.add_argument('--format', dest='format', action='store',default=None, help='Format e.g. Ansible')
-parse.add_argument('--hostport', dest='hostport', action='store',default=None, help='Logstash UDP host:port')
-parse.add_argument('--file', dest='filename', action='store',default=None, help='Filename to follow')
-
-args = parse.parse_args()
-
-host,port = args.hostport.split(':')
-
-format = args.format
-
-logger = logging.getLogger('python-logstash-logger')
-logger.setLevel(logging.INFO)
-logger.addHandler(logstash.LogstashHandler(host, int(port), version=1))
-
-def send_log(log):
-
- try:
- msg = log['desc']
- except KeyError:
- msg = 'Metadata'
-
- time.sleep(0.1)
- try:
- logger.info(msg, extra=log)
- except Exception,e:
- logger.info('Logstash log failed', extra={'xos_fatal':1,'exception':str(e)})
- pass
-
-### Read parser from patterns.py
-
-def extract_global(l):
- g = None
-
- try:
- global_tag = "==>" + Word(alphanums) + ":" + SkipTo(LineEnd(),include=True)
- s = global_tag.parseString(l)
- l = s[3]+'\n'
- g = s[1]
- except:
- pass
-
- return g,l
-
-def serialize_raw(s):
- for l in s.splitlines():
- g,l = extract_global(l)
- report(l, g)
-
-def report(payload,g):
- if (not payload):
- return
-
- if (type(payload)!=dict):
- payload = {'desc':payload, 'global_tag': g}
-
- send_log(payload)
- #print payload
-
-def run_logger():
- lst = []
- for n in dir(patterns.Parser):
- sym = getattr(patterns.Parser, n)
- if isinstance(sym,ParserElement):
- lst.append(sym)
-
- default = SkipTo(LineEnd(),include=True)
-
- xos_logger = Or(lst)
-
- inp = ''
- lc = 0
-
- if (args.filename):
- source = follow(open(args.filename))
-
- while True:
- if (not args.filename):
- l = sys.stdin.readline()
- else:
- l = source.next()
-
- if (l==""):
- break
- elif len(l)>200:
- continue
-
- inp += l
- lc = len(inp.split('\n'))
-
- if (lc>4):
- top = inp.splitlines()[0]
- try:
- line_idx = inp.index('\n')
- inp=inp[line_idx+1:]
-
- g,top = extract_global(top)
- report(top,g)
- lc = len(inp.split('\n'))
- except ValueError:
- pass
-
- try:
- s = xos_logger.scanString(inp)
-
- last = None
- first = True
- for i in s:
-
- if (first):
- pending = inp[:i[1]]
- serialize_raw(pending)
-
- first = False
-
- try:
- payload = i[0][0]
- g,_ = extract_global(inp)
- report(payload,g)
- except IndexError:
- pass
-
- last = i
-
- if (last):
- inp = inp[last[2]:]
- lines = inp.splitlines()
- lc=len(lines)
-
- except Exception,e:
- # We don't want logging to hold up execution
- #print str(e)
- pass
-
-def main():
- run_logger()
-
-
-if __name__ == "__main__":
- main()
diff --git a/elk-logger/mixpanel b/elk-logger/mixpanel
deleted file mode 100755
index 08c1ee9..0000000
--- a/elk-logger/mixpanel
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/python
-
-from mixpanel import Mixpanel
-import pdb
-
-import argparse
-import sys
-import getpass
-import socket
-import subprocess
-import os
-
-from os.path import expanduser
-
-parse = argparse.ArgumentParser(description='Send CORD logs to mixpanel.')
-parse.add_argument('--corddir', dest='corddir', action='store',default=None, help='CORD Directory')
-parse.add_argument('--event', dest='event', action='store',default=None, help='Event Name')
-parse.add_argument('--finish', dest='finish', action='store_true',default=False, help='Finish')
-parse.add_argument('--status', dest='status', action='store',default=None, help='Exit status')
-
-args = parse.parse_args()
-
-corddir = expanduser(args.corddir)
-build_version_file = '/tmp/cord-build'
-cord_version_file = '/tmp/cord-build-version'
-
-build_features = []
-
-try:
- mp = Mixpanel("7d5ca3b3ff870dbeda89c9d5af59e9e9")
- hostname = socket.gethostname()
-
- context = {}
- context['debian-version'] = open('/etc/debian_version').read().strip()
-
- os.chdir(corddir+'/orchestration/xos')
- p = subprocess.Popen(['git','rev-parse','HEAD'], stdout=subprocess.PIPE,stderr=subprocess.PIPE,stdin=subprocess.PIPE)
-
- git_hash,err = p.communicate()
-
- context['last-commit'] = git_hash
- context['build-features'] = build_features
-
- if (args.status):
- context['status'] = args.status
-
- config = open(corddir+'/build/config/cord_in_a_box.yml').read().splitlines()
- for l in config:
- if 'cord_profile:' in l:
- context['profile'] = l.rstrip().rsplit(' ')[-1].replace("'","")
-
- context['user'] = getpass.getuser()
-
- name = ''
- idx=0
- lst = hostname.split('.')
- lst.reverse()
- for i in lst:
- name='.'.join([name,i]).lstrip('.')
-
- context['level-%d'%idx] = name
- idx+=1
-
- if (args.finish):
- logfile = open(corddir+'/install.out').read().splitlines()
- snapshot = logfile[-20:]
- snapshot = filter(lambda x:x, snapshot)
- context['snapshot'] = snapshot
-
- try:
- build_id = open(build_version_file).read().rstrip()
- except:
- build_id = context['user'] + name
-
- # Figure out whether we're in master or what
- try:
- cord_version = open(cord_version_file).read().rstrip()
- except:
- os.chdir(corddir)
- possible_versions = ['master','cord-1.0','cord-2.0']
-
- cord_version = 'personal'
- try:
- for v in possible_versions:
- diff = os.popen('repo forall -c "git stash 2>/dev/null 1>/dev/null;git diff -b opencord/%s 2>/dev/null;git stash pop 2>/dev/null 1>/dev/null"'%v).read()
- if (not diff):
- cord_version = v
- break
- except:
- pass
-
- open(cord_version_file,'w').write(cord_version)
- context['version'] = cord_version
- mp.track(build_id, args.event, context)
-except Exception,e:
- print str(e)
- pass
diff --git a/elk-logger/patterns.py b/elk-logger/patterns.py
deleted file mode 100644
index b2094d7..0000000
--- a/elk-logger/patterns.py
+++ /dev/null
@@ -1,47 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from pyparsing import *
-
-class Parser:
- test_pattern = "{{{" + SkipTo("}}}",include=True)
- test_pattern.setParseAction(lambda x:{"test":x[1][0]})
-
- test_pattern2 = "1" + SkipTo(LineEnd(),include=True) + SkipTo(LineEnd(),include=True) + "2"
- test_pattern2.setParseAction(lambda x:{"test":x[1]})
-
- ansible = "TASK [" + SkipTo(']',include=True) + SkipTo(LineEnd(),include=True) + oneOf('changed ok failed error unreachable') + ': ' + SkipTo(LineEnd(),include=True)
- ansible.setParseAction(lambda x:{"task":x[1][0],"status":x[3],"subject": x[5][0],"ansible":1})
-
- ansible2 = "TASK [" + SkipTo(']',include=True) + SkipTo(LineEnd(),include=True) + SkipTo(LineEnd(),include=True) + oneOf('changed ok failed error unreachable') + ': ' + SkipTo(LineEnd(),include=True)
- ansible2.setParseAction(lambda x:{"task":x[1][0],"status":x[4],"subject": x[6][0],"ansible":1})
-
- ansible3 = "TASK [" + SkipTo(']',include=True) + SkipTo(LineEnd(),include=True) + SkipTo(LineEnd(),include=True) + SkipTo(LineEnd(),include=True) + oneOf('changed ok failed error unreachable') + ': ' + SkipTo(LineEnd(),include=True)
- ansible3.setParseAction(lambda x:{"task":x[1][0],"status":x[5],"subject": x[7][0],"ansible":1})
-
- # Vagrant
- vagrant_start = Literal("[") + SkipTo("]",include=True) + "Importing base box '" + SkipTo("'",include=True) + SkipTo(LineEnd(),include=True)
- vagrant_start.setParseAction(lambda x:{"vm":x[1][0],"image":x[3][0],"vagrant":1,"global":"Booting VM"})
-
- vagrant_start = Literal("[") + SkipTo("]",include=True) + "Machine booted and ready!" + SkipTo(LineEnd(), include=True)
- vagrant_start.setParseAction(lambda x:{"vm":x[1][0], "vagrant":1, "global":"VM Booted up"})
-
- gradle_start = "Downloading https://services.gradle.org" + SkipTo(LineEnd(), include=True)
- gradle_start.setParseAction(lambda x:{"gradle":1, "global":"Gradle started"})
-
- debian_preparing = "Preparing to unpack" + Word(printables) + SkipTo(LineEnd(), include=True)
- debian_preparing.setParseAction(lambda x:{"debian":1, "package":x[1]})
-
diff --git a/utils/enable-remote-docker-registry b/utils/enable-remote-docker-registry
deleted file mode 100755
index 9492187..0000000
--- a/utils/enable-remote-docker-registry
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-PROG=$(basename $0)
-
-HELP=$(echo "$*" | grep "\-h" | wc -w)
-
-if [ $HELP -ne 0 ]; then
- echo "usage: $PROG <remote-registry>..."
- exit 1
-fi
-
-LINE="DOCKER_OPTS=\"\$DOCKER_OPTS --insecure-registry $1\""
-
-OUT=$(tempfile)
-cat /etc/default/docker >> $OUT
-CHANGED=0
-while [ $# -gt 0 ]; do
- FOUND=$(grep "$LINE" /etc/default/docker | wc -l)
- if [ $FOUND -eq 0 ]; then
- echo "DOCKER_OPTS=\"\$DOCKER_OPTS --insecure-registry $1\"" >> $OUT
- CHANGED=1
- fi
- shift
-done
-
-if [ $CHANGED -eq 1 ]; then
- sudo cp $OUT /etc/default/docker
- sudo service docker restart
-fi
-rm -f $OUT