Rename/remove files that were causing copyright checker issues
Change-Id: I81a750c3a513ecc8ca6a883f729720abc7d4414c
diff --git a/xos/core/dashboard/views/analytics.unused b/xos/core/dashboard/views/analytics.unused
deleted file mode 100644
index 8661cf4..0000000
--- a/xos/core/dashboard/views/analytics.unused
+++ /dev/null
@@ -1,13 +0,0 @@
-from view_common import *
-import random
-from xos_analytics import DoXOSAnalytics
-
-class DashboardAnalyticsAjaxView(View):
- url = r'^analytics/(?P<name>\w+)/$'
-
- def get(self, request, name="hello_world", **kwargs):
- if (name == "bigquery"):
- (mimetype, data) = DoXOSAnalytics(request)
- return HttpResponse(data, content_type=mimetype)
- else:
- return HttpResponse(json.dumps("Unknown"), content_type='application/javascript')
diff --git a/xos/core/dashboard/views/cdn.unused b/xos/core/dashboard/views/cdn.unused
deleted file mode 100644
index 0a71ffe..0000000
--- a/xos/core/dashboard/views/cdn.unused
+++ /dev/null
@@ -1,139 +0,0 @@
-from view_common import *
-from xos_analytics import XOSAnalytics, RED_LOAD, BLUE_LOAD
-
-def getCDNContentProviderData():
- cps = []
- for dm_cp in ContentProvider.objects.all():
- cp = {"name": dm_cp.name,
- "account": dm_cp.account}
- cps.append(cp)
-
- return cps
-
-def getCDNOperatorData(randomizeData = False, wait=True):
- HPC_SLICE_NAME = "HyperCache"
-
- bq = XOSAnalytics()
-
- rows = bq.get_cached_query_results(bq.compose_cached_query(), wait)
-
- # wait=False on the first time the Dashboard is opened. This means we might
- # not have any rows yet. The dashboard code polls every 30 seconds, so it
- # will eventually pick them up.
-
- if rows:
- rows = bq.postprocess_results(rows, filter={"event": "hpc_heartbeat"}, maxi=["cpu"], count=["hostname"], computed=["bytes_sent/elapsed"], groupBy=["Time","site"], maxDeltaTime=80)
-
- # dictionaryize the statistics rows by site name
- stats_rows = {}
- for row in rows:
- stats_rows[row["site"]] = row
- else:
- stats_rows = {}
-
- slice = Slice.objects.filter(name=HPC_SLICE_NAME)
- if slice:
- slice_instances = list(slice[0].instances.all())
- else:
- slice_instances = []
-
- new_rows = {}
- for site in Site.objects.all():
- # compute number of instances allocated in the data model
- allocated_instances = 0
- for instance in slice_instances:
- if instance.node.site == site:
- allocated_instances = allocated_instances + 1
-
- stats_row = stats_rows.get(site.name,{})
-
- max_cpu = stats_row.get("max_avg_cpu", stats_row.get("max_cpu",0))
- cpu=float(max_cpu)/100.0
- hotness = max(0.0, ((cpu*RED_LOAD) - BLUE_LOAD)/(RED_LOAD-BLUE_LOAD))
-
- try:
- lat=float(site.location.latitude)
- long=float(site.location.longitude)
- except:
- lat=0
- long=0
-
- # format it to what that CDN Operations View is expecting
- new_row = {"lat": lat,
- "long": long,
- "health": 0,
- #"numNodes": int(site.nodes.count()),
- "activeHPCInstances": int(stats_row.get("count_hostname", 0)), # measured number of instances, from bigquery statistics
- "numHPCInstances": allocated_instances, # allocated number of instances, from data model
- "siteUrl": str(site.site_url),
- "bandwidth": stats_row.get("sum_computed_bytes_sent_div_elapsed",0),
- "load": max_cpu,
- "hot": float(hotness)}
- new_rows[str(site.name)] = new_row
-
- # get rid of sites with 0 instances that overlap other sites with >0 instances
- for (k,v) in new_rows.items():
- bad=False
- if v["numHPCInstances"]==0:
- for v2 in new_rows.values():
- if (v!=v2) and (v2["numHPCInstances"]>=0):
- d = haversine(v["lat"],v["long"],v2["lat"],v2["long"])
- if d<100:
- bad=True
- if bad:
- del new_rows[k]
-
- return new_rows
-
-class DashboardSummaryAjaxView(View):
- url=r'^hpcsummary/'
-
- def get(self, request, **kwargs):
- def avg(x):
- if len(x)==0:
- return 0
- return float(sum(x))/len(x)
-
- sites = getCDNOperatorData().values()
-
- sites = [site for site in sites if site["numHPCInstances"]>0]
-
- total_instances = sum( [site["numHPCInstances"] for site in sites] )
- total_bandwidth = sum( [site["bandwidth"] for site in sites] )
- average_cpu = int(avg( [site["load"] for site in sites] ))
-
- result= {"total_instances": total_instances,
- "total_bandwidth": total_bandwidth,
- "average_cpu": average_cpu}
-
- return HttpResponse(json.dumps(result), content_type='application/javascript')
-
-class DashboardAddOrRemoveInstanceView(View):
- # TODO: deprecate this view in favor of using TenantAddOrRemoveInstanceView
-
- url=r'^dashboardaddorreminstance/$'
-
- def post(self, request, *args, **kwargs):
- siteName = request.POST.get("site", None)
- actionToDo = request.POST.get("actionToDo", "0")
-
- siteList = [Site.objects.get(name=siteName)]
- slice = Slice.objects.get(name="HyperCache")
-
- if request.user.isReadOnlyUser():
- return HttpResponseForbidden("User is in read-only mode")
-
- if (actionToDo == "add"):
- user_ip = request.GET.get("ip", get_ip(request))
- slice_increase_instances(request.user, user_ip, siteList, slice, image.objects.all()[0], 1)
- elif (actionToDo == "rem"):
- slice_decrease_instances(request.user, siteList, slice, 1)
-
- print '*' * 50
- print 'Ask for site: ' + siteName + ' to ' + actionToDo + ' another HPC Instance'
- return HttpResponse(json.dumps("Success"), content_type='application/javascript')
-
-class DashboardAjaxView(View):
- url = r'^hpcdashboard/'
- def get(self, request, **kwargs):
- return HttpResponse(json.dumps(getCDNOperatorData(True)), content_type='application/javascript')
diff --git a/xos/tools/apigen/dot.template.dot b/xos/tools/apigen/dot.template.dot
deleted file mode 100644
index 91ff7f4..0000000
--- a/xos/tools/apigen/dot.template.dot
+++ /dev/null
@@ -1,7 +0,0 @@
-digraph plstack {
-{% for o in generator.all() %}
-{% for f in o.refs %}
- "{{ o.camel() }}"->"{{ f.camel() }}";
-{% endfor %}
-{% endfor %}
-}
diff --git a/xos/tools/apigen/style.template b/xos/tools/apigen/style.template
deleted file mode 100644
index 2f238c1..0000000
--- a/xos/tools/apigen/style.template
+++ /dev/null
@@ -1,47 +0,0 @@
-def is_camel_case(name):
- for (i,char) in enumerate(name):
- if (i>=1) and (name[i-1].islower()) and (char.isupper()):
- return True
- return False
-
-def is_missing_underscore(fieldName):
- if (fieldName == "kuser_id"):
- # this one is okay
- return False
-
- {% for model in generator.all() %}
- pos = fieldName.find("{{ model }}")
- if (pos > 0) and (fieldName[pos-1] != "_"):
- return True
- {% endfor %}
-
- return False
-
-def stylecheck_model_name(name):
- if name.endswith("s"):
- print "model '%s' name ends with 's'" % name
-
-def stylecheck_field_name(modelName, fieldName):
- if is_camel_case(fieldName):
- print "field '%s.%s' has camelcase" % (modelName, fieldName)
- if is_missing_underscore(fieldName):
- print "field '%s.%s' is missing underscore" % (modelName, fieldName)
-
-def stylecheck_field_plural(modelName, fieldName):
- if is_camel_case(fieldName):
- print "m2m field '%s.%s' has camelcase" % (modelName, fieldName)
- if is_missing_underscore(fieldName):
- print "m2m field '%s.%s' is missing underscore" % (modelName, fieldName)
-
-def main():
-{% for obj in generator.all() %}
- stylecheck_model_name("{{ obj.camel() }}");
-{% for ref in obj.refs %}
- stylecheck_field_plural("{{ obj.camel() }}", "{{ ref.plural }}");
-{% endfor %}
-{% for prop in obj.props %}
- stylecheck_field_name("{{ obj.camel() }}", "{{ prop }}");
-{% endfor %}
-{% endfor %}
-
-main()
diff --git a/xos/tools/chuckmove.README b/xos/tools/chuckmove.README.md
similarity index 100%
rename from xos/tools/chuckmove.README
rename to xos/tools/chuckmove.README.md