commit e33e7a50a4aed8d5f3eb98bdfa437ec04475c17b Author: AndyGrant Date: Sat Jun 9 15:21:19 2018 -0400 Initial commit diff --git a/OpenBench/__init__.py b/OpenBench/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/OpenBench/__pycache__/__init__.cpython-35.pyc b/OpenBench/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000..69f9b2e Binary files /dev/null and b/OpenBench/__pycache__/__init__.cpython-35.pyc differ diff --git a/OpenBench/__pycache__/admin.cpython-35.pyc b/OpenBench/__pycache__/admin.cpython-35.pyc new file mode 100644 index 0000000..1b4982c Binary files /dev/null and b/OpenBench/__pycache__/admin.cpython-35.pyc differ diff --git a/OpenBench/__pycache__/models.cpython-35.pyc b/OpenBench/__pycache__/models.cpython-35.pyc new file mode 100644 index 0000000..00818d2 Binary files /dev/null and b/OpenBench/__pycache__/models.cpython-35.pyc differ diff --git a/OpenBench/__pycache__/urls.cpython-35.pyc b/OpenBench/__pycache__/urls.cpython-35.pyc new file mode 100644 index 0000000..79c60cf Binary files /dev/null and b/OpenBench/__pycache__/urls.cpython-35.pyc differ diff --git a/OpenBench/__pycache__/views.cpython-35.pyc b/OpenBench/__pycache__/views.cpython-35.pyc new file mode 100644 index 0000000..235bdd6 Binary files /dev/null and b/OpenBench/__pycache__/views.cpython-35.pyc differ diff --git a/OpenBench/admin.py b/OpenBench/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/OpenBench/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/OpenBench/apps.py b/OpenBench/apps.py new file mode 100644 index 0000000..9d792a8 --- /dev/null +++ b/OpenBench/apps.py @@ -0,0 +1,4 @@ +from django.apps import AppConfig + +class OpenbenchConfig(AppConfig): + name = 'OpenBench' diff --git a/OpenBench/migrations/__init__.py b/OpenBench/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/OpenBench/migrations/__pycache__/__init__.cpython-35.pyc b/OpenBench/migrations/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000..cd256a1 Binary files /dev/null and b/OpenBench/migrations/__pycache__/__init__.cpython-35.pyc differ diff --git a/OpenBench/models.py b/OpenBench/models.py new file mode 100644 index 0000000..d434a44 --- /dev/null +++ b/OpenBench/models.py @@ -0,0 +1,74 @@ +from django.db.models import CharField, IntegerField, BooleanField +from django.db.models import FloatField, ForeignKey, DateTimeField +from django.db.models import PROTECT, Model + +class Engine(Model): + + name = CharField(max_length=128) + source = CharField(max_length=1024) + proto = CharField(max_length=16) + sha = CharField(max_length=64) + bench = IntegerField(default=0) + + def __str__(self): + return '{0} ({1})'.format(self.name, self.bench) + +class Machine(Model): + + owner = CharField(max_length=64) + osname = CharField(max_length=128) + lastseen = DateTimeField(auto_now=True) + + def __str__(self): + return '{0}-{1} ({2})'.format(self.owner.name, self.osname, self.id) + +class Workload(Model): + + test = ForeignKey('Test', PROTECT, related_name='test') + machine = ForeignKey('Machine', PROTECT, related_name='machine') + + games = IntegerField(default=0) + wins = IntegerField(default=0) + losses = IntegerField(default=0) + draws = IntegerField(default=0) + crashes = IntegerField(default=0) + time = IntegerField(default=0) + + lastseen = DateTimeField(default=0) + + def __str__(self): + return '{0} {1}'.format(self.test.dev.name, self.machine.__str__()) + +class Test(Model): + + dev = ForeignKey('Engine', PROTECT, related_name='dev') + base = ForeignKey('Engine', PROTECT, related_name='base') + + timecontrol = CharField(max_length=16) + hashsize = IntegerField(default=1) + threads = IntegerField(default=1) + + priority = IntegerField(default=0) + throughput = IntegerField(default=0) + + alpha = FloatField(default=0.0) + beta = FloatField(default=0.0) + elolower = FloatField(default=0.0) + eloupper = FloatField(default=0.0) + + lowerllr = FloatField(default=0.0) + currentllr = FloatField(default=0.0) + upperllr = FloatField(default=0.0) + + elo = FloatField(default=0.0) + games = IntegerField(default=0) + wins = IntegerField(default=0) + draws = IntegerField(default=0) + losses = IntegerField(default=0) + + passed = BooleanField(default=False) + failed = BooleanField(default=False) + deleted = BooleanField(default=False) + + def __str__(self): + return '{0} vs {1} @ {2}'.format(self.dev.name, self.base.name, self.timecontrol) diff --git a/OpenBench/tests.py b/OpenBench/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/OpenBench/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/OpenBench/urls.py b/OpenBench/urls.py new file mode 100644 index 0000000..0b17753 --- /dev/null +++ b/OpenBench/urls.py @@ -0,0 +1,22 @@ +from django.conf.urls import url + +import OpenBench.views + +urlpatterns = [ + #url(r"all/$", EtherBench.views.allTests), + #url(r"index/$", EtherBench.views.index), + #url(r"index/([0-9]+)/$", EtherBench.views.index), + #url(r"greens/$", EtherBench.views.greens), + #url(r"greens/([0-9]+)/$", EtherBench.views.greens), + #url(r"register/$", EtherBench.views.register), + #url(r"login/$", EtherBench.views.login), + #url(r"logout/$", EtherBench.views.logout), + #url(r"newEngineTest/$", EtherBench.views.newEngineTest), + #url(r"editEngineTest/([0-9]+)/$", EtherBench.views.editEngineTest), + #url(r"getCoreFiles/$", EtherBench.views.getCoreFiles), + #url(r"getWorkload/([0-9]+)/$", EtherBench.views.getWorkload), + #url(r"submitResults/$", EtherBench.views.submitResults), + #url(r"wrongbench/([0-9]+)/$", EtherBench.views.wrongBench), + + +] diff --git a/OpenBench/views.py b/OpenBench/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/OpenBench/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/OpenSite/__init__.py b/OpenSite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/OpenSite/__pycache__/__init__.cpython-35.pyc b/OpenSite/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000..f9de433 Binary files /dev/null and b/OpenSite/__pycache__/__init__.cpython-35.pyc differ diff --git a/OpenSite/__pycache__/settings.cpython-35.pyc b/OpenSite/__pycache__/settings.cpython-35.pyc new file mode 100644 index 0000000..94cf138 Binary files /dev/null and b/OpenSite/__pycache__/settings.cpython-35.pyc differ diff --git a/OpenSite/__pycache__/urls.cpython-35.pyc b/OpenSite/__pycache__/urls.cpython-35.pyc new file mode 100644 index 0000000..8a150346 Binary files /dev/null and b/OpenSite/__pycache__/urls.cpython-35.pyc differ diff --git a/OpenSite/__pycache__/wsgi.cpython-35.pyc b/OpenSite/__pycache__/wsgi.cpython-35.pyc new file mode 100644 index 0000000..2923bed Binary files /dev/null and b/OpenSite/__pycache__/wsgi.cpython-35.pyc differ diff --git a/OpenSite/settings.py b/OpenSite/settings.py new file mode 100644 index 0000000..d05304b --- /dev/null +++ b/OpenSite/settings.py @@ -0,0 +1,126 @@ +""" +Django settings for OpenSite project. + +Generated by 'django-admin startproject' using Django 2.0.6. + +For more information on this file, see +https://docs.djangoproject.com/en/2.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.0/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '@!zw2l8til1(0eb_nk+1w!(n78gqm&u)s)_v7#k6iseia@g9q0' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = ['*'] + + +# Application definition + +SETTINGS_DIR = os.path.dirname(__file__) +PROJECT_PATH = os.path.join(SETTINGS_DIR, os.pardir) +PROJECT_PATH = os.path.abspath(PROJECT_PATH) +TEMPLATE_PATH = os.path.join(PROJECT_PATH,'templates') + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'OpenBench', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'OpenSite.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'OpenSite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/2.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.0/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/OpenSite/urls.py b/OpenSite/urls.py new file mode 100644 index 0000000..06c7960 --- /dev/null +++ b/OpenSite/urls.py @@ -0,0 +1,9 @@ +from django.contrib import admin +from django.urls import path, include + +import OpenBench.urls + +urlpatterns = [ + path(r'admin/', admin.site.urls), + path(r'^', include(OpenBench.urls.urlpatterns)), +] diff --git a/OpenSite/wsgi.py b/OpenSite/wsgi.py new file mode 100644 index 0000000..1ecdef1 --- /dev/null +++ b/OpenSite/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for OpenSite project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OpenSite.settings") + +application = get_wsgi_application() diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/manage.py b/manage.py new file mode 100644 index 0000000..cfef37e --- /dev/null +++ b/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OpenSite.settings") + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv)