jobQueue.recalculate() signal.signal(signal.SIGHUP, reloadConfig) def jobDone(job, successfull): project = multiverseInstance.projects[job['basename']] project.refreshMasterBuildHistory() graphResource.update() pool.Pool(jobQueue, jobDoneCallback=jobDone) rackrun.config.DIRBALAK_EGG_DIR = args.dirbalakRoot render.addTemplateDir(os.path.join(args.dirbalakRoot, 'html')) render.DEFAULTS['title'] = "Dirbalak" render.DEFAULTS['brand'] = "Dirbalak" render.DEFAULTS['mainMenu'] = [ dict(title="Projects", href="/projects"), dict(title="Queue", href="/queue"), dict(title="Build Hosts", href="/buildHosts")] root = rootresource.rootResource() root.putChild("js", static.File(os.path.join(args.dirbalakRoot, "js"))) root.putChild("static", static.File(os.path.join(args.dirbalakRoot, "static"))) root.putChild("favicon.ico", static.File(os.path.join(args.dirbalakRoot, "static", "favicon.ico"))) rootresource.GLOBAL_PARAMETERS['logbeamWebFrontendPort'] = args.logbeamWebFrontendPort root.putChild("projects", rootresource.Renderer("projects.html", dict(activeMenuItem="Projects"))) root.putChild("queue", rootresource.Renderer("queue.html", dict(activeMenuItem="Queue"))) root.putChild("buildHosts", rootresource.Renderer("buildHosts.html", dict(activeMenuItem="Build Hosts"))) root.putChild("project", resources.Projects())
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') parser = argparse.ArgumentParser() parser.add_argument("--webPort", type=int, default=6001) parser.add_argument("--webSocketPort", type=int, default=6002) parser.add_argument("--realtimewebuiRoot") parser.add_argument("--dashboardRoot") parser.add_argument("--localhostRackattackProvider", action='store_true') args = parser.parse_args() if args.realtimewebuiRoot is not None: realtimewebui.config.REALTIMEWEBUI_ROOT_DIRECTORY = args.realtimewebuiRoot if args.localhostRackattackProvider: os.environ['RACKATTACK_PROVIDER'] = \ 'tcp://*****:*****@@amqp://guest:guest@localhost:1013/%2F@@http://localhost:1016' hostsStatsPoller = pollthread.PollThread() inaugurationTimePoller = pollthread.InaugurationTimesPollThread() render.addTemplateDir(os.path.join(args.dashboardRoot, 'html')) render.DEFAULTS['title'] = "Rackattack" render.DEFAULTS['brand'] = "Rackattack" render.DEFAULTS['mainMenu'] = [dict(title="inaugurations", href="inaugurations.html")] root = rootresource.rootResource() root.putChild("js", static.File(os.path.join(args.dashboardRoot, "js"))) root.putChild("static", static.File(os.path.join(args.dashboardRoot, "static"))) root.putChild("favicon.ico", static.File(os.path.join(args.dashboardRoot, "static", "favicon.ico"))) root.putChild("inaugurations", rootresource.Renderer("inaugurations.html", {})) server.runUnsecured(root, args.webPort, args.webSocketPort)
from realtimewebui import server from realtimewebui import rootresource from realtimewebui import render from realtimewebui import callbacks from realtimewebui import tojs def changeYuvu(** kwargs): tojs.set("yuvu", {'name': 'pash'}) render.addTemplateDir(".") tojs.set("yuvu", {'name': 'yuvu'}) callbacks.callbacks["changeYuvu"] = changeYuvu root = rootresource.rootResource() # server.runUnsecured(root, 2000, 2001) server.runSecured(root, 2000, 2001, "b", "b")
from realtimewebui import server from realtimewebui import rootresource from realtimewebui import render from rackattack.dashboard import pollthread from twisted.web import static pollThreads = list() for dashboardSource in dashboardSources: logging.info("Creating poll thread for %(dashboardSource)s", dict(dashboardSource=dashboardSource["name"])) pollThreads.append(pollthread.PollThread(dashboardSource["name"], dashboardSource["innerURL"])) render.addTemplateDir(os.path.join(args.dashboardRoot, 'html')) render.DEFAULTS['title'] = "Rackattack" render.DEFAULTS['brand'] = "Rackattack" render.DEFAULTS['mainMenu'] = [] render.DEFAULTS["useStyleTheme"] = True render.DEFAULTS['dashboardSources'] = dashboardSources root = rootresource.rootResource() root.putChild("js", static.File(os.path.join(args.dashboardRoot, "js"))) root.putChild("static", static.File(os.path.join(args.dashboardRoot, "static"))) root.putChild("favicon.ico", static.File(os.path.join(args.dashboardRoot, "static", "favicon.ico"))) root.putChild("wallboard", rootresource.Renderer("index-wallboard.html", {})) root.putChild("dashboard.js", rootresource.Renderer("dashboard.js", {})) root.putChild("seriallogs", static.File("/var/lib/rackattackphysical/seriallogs")) for dashboardSource in dashboardSources: root.putChild(dashboardSource["name"], rootresource.Renderer("index.html", dict(defaultDashboard=dashboardSource["name"])))