diff --git a/README.md b/README.md index 1725a80..d7751b2 100644 --- a/README.md +++ b/README.md @@ -1 +1,51 @@ -# psi-j-testing-service \ No newline at end of file +# psi-j-testing-service + +# make virtual environment +virtualvenv psi +source psi/bin/activate + +# install some things. + +pip3 install -r requirements.txt + +cd ~/psi-j-testing-service/src/psij/testing +python3 service.py + +# you will need mongoDB, follow the instructions here, it takes a while to install. +https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/ + +On Mac OS X, the last step is: +brew services start mongodb-community@6.0 + + + +Creating A Local Dev Environment +------------------------------------------------------ +This starts the service witch allows things to run locally: +cd ~/psi-j-testing-service; +python3 src/psij/testing/service.py + +then you can see it at this url: +http://127.0.0.1:9909/summary.html + + + +To populate the data i need to run psi-j-python: +Edit testing.conf first and, at a minimum, update the url to point to your server +server_url = http://0.0.0.0:9909 + +~/psi-j-python: pip3 install -r requirements-dev.txt +~/psi-j-python: make tests -- --upload-results + + +Restoring a mongodump DB: +You'll want to get a full dump, that way you can play with the data: + +First untar these: +mongodump-psij.tar +mongodump-sdk.tar.gz + +mongorestore dump/ + + + diff --git a/src/psij/web/style.css b/src/psij/web/css/style.css similarity index 95% rename from src/psij/web/style.css rename to src/psij/web/css/style.css index abf27f2..9255072 100644 --- a/src/psij/web/style.css +++ b/src/psij/web/css/style.css @@ -146,6 +146,7 @@ body { width: 100%; text-align: right; margin-bottom: 32pt; + position: relative; } #toolbar .spacer { @@ -547,3 +548,30 @@ td.run-id { .calendar-cell { text-align: center; } + +.IntroBlurb { + background-color: #ffffff; + border: 1px solid #e2e2e2; + border-radius: 5px; + padding: 9px; + margin: 10px 0 10px 0; + font-size: 13px; + color: #000000; + position: relative; +} + +.IntroBlurb .CloseMe { + position: absolute; + top: 7px; + right: 10px; + color: #999999; + font-size: 17px; + cursor: pointer; +} + +.dashboard-title { + position: absolute; + left: 110px; + top: 10px; + font-weight: bold; +} \ No newline at end of file diff --git a/src/psij/web/checkmark.png b/src/psij/web/imgs/checkmark.png similarity index 100% rename from src/psij/web/checkmark.png rename to src/psij/web/imgs/checkmark.png diff --git a/src/psij/web/js/IntroBlurb.js b/src/psij/web/js/IntroBlurb.js new file mode 100644 index 0000000..501d636 --- /dev/null +++ b/src/psij/web/js/IntroBlurb.js @@ -0,0 +1,38 @@ +var VC = VC || {}; + +VC.IntroBlurb = Vue.component("intro-blurb", { + data: function () { + + return { + show: 0 + } + }, + template: '
' + + '
' + + '
X
' + + '
', + mounted: function( event ) { + console.log('mounted'); + var content = this.$slots.default[0].text; + console.dir( content ); + + var hideBlurb = Cookies.get( content ); + + if( hideBlurb === "1" ) { + // hide + this.show = 0; + } else { + this.show = 1; + } + }, + methods: { + close: function( event ) { + + var ihtml = this.$el.firstChild.innerHTML; + console.log(ihtml); + + Cookies.set( ihtml, "1" ) + this.show = 0; + } + } +}); diff --git a/src/psij/web/js/RowAccordian.js b/src/psij/web/js/RowAccordian.js new file mode 100644 index 0000000..8b76214 --- /dev/null +++ b/src/psij/web/js/RowAccordian.js @@ -0,0 +1,26 @@ +var VC = VC || {}; + +VC.RowAccordian = Vue.component("row-accordian", { + props: [ + 'logo_name', + 'machines', + 'logo_results', + 'machine_row_results' + ], + data: function () { + + return { + open: 1 + } + }, + template: '' + + '
', + mounted: function( event ) { + }, + methods: { + toggle: function( event ) { + + this.open = this.open ? 0 : 1; + } + } +}); diff --git a/src/psij/web/js/customization.js b/src/psij/web/js/customization.js new file mode 100644 index 0000000..6688c75 --- /dev/null +++ b/src/psij/web/js/customization.js @@ -0,0 +1,12 @@ +CUSTOMIZATION = { + projectName: "PSI/J" +} + +var CONF = { + STR: { + "dashboardTitle": "Exascale dashboard testing service", + "introBlurb": "The dashboard testing service shows you the status of various sites in the calendar view by date and machine without curation.", + "bottomBlurb": "The curated sites tab will eventually show labs on the left which are expandable to show the machines of each lab on the y axis. Meanwhile, the X axis will show you test cases like PSI/J and PSI/J Parcel, etc." + } +}; + diff --git a/src/psij/web/lib.js b/src/psij/web/js/lib.js similarity index 99% rename from src/psij/web/lib.js rename to src/psij/web/js/lib.js index d81417c..f7480a1 100644 --- a/src/psij/web/lib.js +++ b/src/psij/web/js/lib.js @@ -1,3 +1,4 @@ +// lib.js var badness = function(obj) { if (obj['failed_count'] > 0) { if (obj['completed_count'] < obj['failed_count']) { diff --git a/src/psij/web/js/summary.js b/src/psij/web/js/summary.js new file mode 100644 index 0000000..291cf24 --- /dev/null +++ b/src/psij/web/js/summary.js @@ -0,0 +1,89 @@ +var sites = [ +]; + +settingsDefaults({"viewMode": "calendar", "inactiveTimeout": 10, "showBranchBubbles": false}); + +set = function(dst, src) { + dst.length = 0; + for (var i = 0; i < src.length; i++) { + dst.push(src[i]); + } +} + +update = function() { + $.get("summary", settings("inactiveTimeout"), function(data) { + set(sites, data); + }); +}; + +update(); + +var siteStatus = new Vue({ + el: "#container", + components: { + 'intro-blurb':VC.IntroBlurb + }, + vuetify: new Vuetify(), + data: { + sites: sites, + mode: '', + now: moment().utc().startOf("day"), + settingsDialog: false, + STR: CONF.STR + }, + methods: globalMethods, + computed: { + inactiveTimeout: makeSetting("inactiveTimeout", update), + showBranchBubbles: makeSetting("showBranchBubbles", update, "bool"), + allBranches: function() { + var unique = {}; + for (var i = 0; i < this.sites.length; i++) { + var site = this.sites[i]; + var branches = site.branches; + for (var j = 0; j < branches.length; j++) { + var branch = branches[j]; + if (branch.name in unique) { + var existing = unique[branch.name]; + existing['failed_count'] += branch['failed_count']; + existing['completed_count'] += branch['completed_count']; + } + else { + unique[branch.name] = {... branch}; + unique[branch.name]['sites'] = {}; + } + unique[branch.name]['sites'][site.site_id] = branch; + } + } + + values = []; + for (var k in unique) { + values.push(unique[k]); + } + return this.sort('name', values); + }, + branchIndexMap: function() { + var all = this.allBranches; + var map = {}; + for (var i = 0; i < all.length; i++) { + map[all[i].name] = i; + } + return map; + } + } +}); + +var setViewMode = function(viewMode) { + if (viewMode === undefined) { + viewMode = Cookies.get('viewMode'); + } + if (viewMode === undefined) { + viewMode = 'calendar'; + } + Cookies.set('viewMode', viewMode); + $('.view-mode-group').removeClass('selected'); + $('#view-mode-' + viewMode).addClass('selected'); + siteStatus.mode = viewMode; +} + +setViewMode(); + diff --git a/src/psij/web/run.html b/src/psij/web/run.html index 36e5be2..389ce0c 100644 --- a/src/psij/web/run.html +++ b/src/psij/web/run.html @@ -8,12 +8,12 @@ crossorigin="anonymous"> - - + + - +
@@ -33,7 +33,7 @@ {{ branch.name }}
{{ branch.failed_count }} - +
diff --git a/src/psij/web/site.html b/src/psij/web/site.html index aac4294..01aa8ae 100644 --- a/src/psij/web/site.html +++ b/src/psij/web/site.html @@ -8,12 +8,12 @@ crossorigin="anonymous"> - - + + - +
@@ -48,7 +48,7 @@
{{ branch.failed_count }} - +
diff --git a/src/psij/web/summary.html b/src/psij/web/summary.html index 902b0ca..7973400 100644 --- a/src/psij/web/summary.html +++ b/src/psij/web/summary.html @@ -8,14 +8,18 @@ crossorigin="anonymous"> - + + + + + - + - +
@@ -23,6 +27,11 @@
+
calendar_today
@@ -33,6 +42,9 @@ table_view
 
+ +
{{ STR.dashboardTitle }}
+