Skip to content

First steps toward OBO Dashboard #1069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 79 commits into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
17f781a
Add assets
Oct 15, 2019
7b92983
Fix assets
Oct 15, 2019
0390024
Update gitignore, Makefile, default HTML
Oct 15, 2019
7dc3c85
Update requirements
Oct 15, 2019
eea0c0b
Update PATH
Oct 15, 2019
9aacace
build script
Oct 15, 2019
23bae0d
Fix path to build.sh
Oct 15, 2019
787e912
Try with pip3
Oct 15, 2019
6557d79
Move to build/robot.jar
Oct 15, 2019
daa0c16
Add kill to process running on port
Oct 15, 2019
043582d
Ignore on failure
Oct 15, 2019
010d947
Fix robot path
Oct 15, 2019
b023a2c
Use different ROBOT jar for removing foreign axioms
Oct 15, 2019
78895bc
Add cause to dashboard exceptions
Oct 16, 2019
7499d7d
Use unbuffered feed
Oct 16, 2019
5e726f2
Add flush to print messages
Oct 16, 2019
3ba69a4
Try to kill server
Oct 16, 2019
b03cfa0
Remove try except
Oct 16, 2019
e7d941b
Re-add try except
Oct 16, 2019
c835c3d
Redo archive artefacts
Oct 17, 2019
8735f17
Separate big ontology processing
Oct 18, 2019
95ae85b
Fix separation between big ontologies
Oct 18, 2019
d5d5054
Fix errors
Oct 19, 2019
1110d01
Add kill
Oct 19, 2019
5d14080
Add kill
Oct 19, 2019
4342f1d
Fix command for big-dashboard.html
Oct 20, 2019
7eaa330
Fix typo
Oct 20, 2019
4169666
Phony test
Oct 21, 2019
f6861ff
Recursive zip
Oct 21, 2019
5d4852e
Add reboot script
Oct 21, 2019
2ba7c56
Switch to uberon for test
Oct 21, 2019
bb72df9
Combine regular and big dashboards
Oct 21, 2019
3746b04
Make sure zip is not empty
Oct 21, 2019
ac273fb
Change zip remove
Oct 21, 2019
f2dbf1e
Fix zipping
Oct 21, 2019
29eed2d
Add rf to rm
Oct 21, 2019
117301f
Run over all
Oct 21, 2019
7985f29
Update site docs
Oct 22, 2019
309fce4
Alert admin emails on failure
Oct 22, 2019
ff91803
Move to docker image
Oct 23, 2019
e11c3b0
Skip GAZ
Oct 23, 2019
d589e78
add timeout
Oct 23, 2019
825ac22
Try to specify git repo
Oct 24, 2019
4b94beb
Fix git url
Oct 24, 2019
419634d
Change ls
Oct 24, 2019
628cb18
Try in top agent
Oct 24, 2019
18ada95
Switch to ODK container
Oct 24, 2019
aa9416b
Make dashboard dir
Oct 24, 2019
17c5a06
Try other configuration
Oct 24, 2019
d5e40e8
Fix bad file
Oct 24, 2019
bf19122
Fix missing agent
Oct 24, 2019
dbf614f
Add init step
Oct 24, 2019
58a86c8
Try different docker method
Oct 24, 2019
ebd0402
Change to node
Oct 24, 2019
f4edf0c
Use withDockerContainer
Oct 24, 2019
1e05d69
Try inside image
Oct 24, 2019
4c6b34e
Reset to original
Oct 24, 2019
00d9888
Fix docker agent
Oct 24, 2019
8ccddf6
work on creating a dockerized dashboard pipeline
Oct 24, 2019
d9ca1d7
work on creating a dockerized dashboard pipeline; typo
Oct 24, 2019
b0f9b7c
work on creating a dockerized dashboard pipeline; testing that Makefi…
Oct 24, 2019
635a183
work on creating a dockerized dashboard pipeline; debug
Oct 24, 2019
4db3223
attempt to debug global env
Oct 24, 2019
606ba8b
attempt to debug global env
Oct 24, 2019
47a8a8d
attempt to debug global env
Oct 24, 2019
9594015
back to odk image
Oct 25, 2019
8fe4f0e
install needful python
Oct 25, 2019
2dc4f84
pip3
Oct 25, 2019
0d05279
email switch and package
Oct 25, 2019
dfea85f
Small test
Oct 25, 2019
af822d7
Install zip
Oct 25, 2019
6b8c6b1
Fix branch name var
Oct 25, 2019
eed8934
Fix archive product directory
Oct 25, 2019
23b7128
Try archiving inside Docker
Oct 25, 2019
8edb7d9
Fix version IRI parsing for big ontologies
Oct 25, 2019
fdde3ad
Fix test line
Oct 25, 2019
c9775b6
Fix HTML grid links
Nov 4, 2019
3494c30
Merge branch 'master' into dashboard
Nov 19, 2019
6e7ec22
Merge branch 'master' into dashboard
Nov 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
reports
reports
util/__pycache__/
util/principles/__pycache__/
build/
.jekyll-cache/
113 changes: 113 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
pipeline {
agent any
// In additional to manual runs, trigger somewhere at midnight to
// give us the max time in a day to get things right.
triggers {
// Master never runs--Feb 31st.
cron('0 0 31 2 *')
// Nightly @12am.
//cron('0 0 2-31 * *')
// First of the month @12am, for "release" (also "current").
//cron('0 0 1 * *')
}
environment {
///
/// Automatic run variables.
///

// Pin dates and day to beginning of run.
START_DATE = sh (
script: 'date +%Y-%m-%d',
returnStdout: true
).trim()

START_DAY = sh (
script: 'date +%A',
returnStdout: true
).trim()

///
/// Internal run variables.
///

// The people to call when things go bad. It is a comma-space
// "separated" string.
TARGET_ADMIN_EMAILS = '[email protected]'
}
options{
timestamps()
buildDiscarder(logRotator(numToKeepStr: '14'))
}
stages {
// Very first: pause for a minutes to give a chance to cancel
// and clean the workspace before use.
stage('Ready and clean') {
steps {
// Give us a minute to cancel if we want.
//sleep time: 1, unit: 'MINUTES'
cleanWs deleteDirs: true, disableDeferredWipeout: true
}
}
stage('Initialize') {
steps {
// Start preparing environment.
sh 'env > env.txt'
sh 'echo $BRANCH_NAME > branch.txt'
sh 'echo "$BRANCH_NAME"'
sh 'cat env.txt'
sh 'cat branch.txt'
sh 'echo $START_DAY > dow.txt'
sh 'echo "$START_DAY"'
}
}
// Our main bit of work.
stage('Produce dashboard') {
agent {
docker {
image 'obolibrary/odkfull:v1.1.7'
// Reset Jenkins Docker agent default to original
// root.
args '-u root:root'
}
}
steps {
// Create a relative working directory and setup our
// working environment.
dir('./OBOFoundry.github.io') {
git branch: BRANCH_NAME,
url: 'https://github.com/OBOFoundry/OBOFoundry.github.io'

// Setup our environment the way we want.
sh 'pip3 install -r requirements.txt'
sh 'apt-get -f install lsof'
sh 'apt-get -f install zip'

// Check what our world looks like.
sh 'env'

// We're downloading things, so lets give it a few
// tries.
timeout(time: 8, unit: 'HOURS') {
retry(3){
sh 'export PYTHONUNBUFFERED=1'
sh 'make clean-dashboard'
archiveArtifacts artifacts: 'build/*.zip', onlyIfSuccessful: true
}
}
}
}
}
}
post {
// Let's let our internal people know if things change.
changed {
echo "There has been a change in the ${env.BRANCH_NAME} pipeline."
mail bcc: '', body: "There has been a pipeline status change in ${env.BRANCH_NAME}. Please see: https://build.obolibrary.io/job/obofoundry/job/pipeline/job/${env.BRANCH_NAME}", cc: '', from: '', replyTo: '', subject: "OBO pipeline change for ${env.BRANCH_NAME}", to: "${TARGET_ADMIN_EMAILS}"
}
// Let's let our internal people know if things go badly.
failure {
echo "There has been a failure in the ${env.BRANCH_NAME} pipeline."
mail bcc: '', body: "There has been a pipeline failure in ${env.BRANCH_NAME}. Please see: https://build.obolibrary.io/job/obofoundry/job/pipeline/job/${env.BRANCH_NAME}", cc: '', from: '', replyTo: '', subject: "OBO pipeline FAIL for ${env.BRANCH_NAME}", to: "${TARGET_ADMIN_EMAILS}"
}
}
}
80 changes: 80 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ tmp:
reports:
mkdir -p $@

reports/robot:
mkdir -p $@

reports/principles:
mkdir -p $@


### Build Configuration Files

Expand Down Expand Up @@ -131,6 +137,80 @@ tmp/unsorted-ontologies.yml: $(ONTS) | tmp
extract-metadata: $(ONTS)
./util/extract-metadata.py validate $^


### OBO Dashboard

# This is the Jenkins job
# The reports will be archived

dashboard: build/dashboard.zip

# Build directories
build:
mkdir -p $@
build/ontologies:
mkdir -p $@

# reboot the JVM for Py4J
reboot:
bash ./util/reboot.sh

# This version of ROBOT includes features for starting Py4J
# This will be changed to ROBOT release once feature is released
#.PHONY: build/robot.jar
build/robot.jar: | build
curl -o $@ -Lk \
https://build.obolibrary.io/job/ontodev/job/robot/job/py4j/lastSuccessfulBuild/artifact/bin/robot.jar

# This version of ROBOT includes features for removing external axioms to create 'base' artefacts
# This will be removed once this feature is released
#.PHONY: build/robot-foreign.jar
build/robot-foreign.jar: | build
curl -o $@ -Lk \
https://build.obolibrary.io/job/ontodev/job/robot/job/562-feature/lastSuccessfulBuild/artifact/bin/robot.jar

# Generate the initial dashboard results file
# ALWAYS make sure nothing is running on port 25333
# Then boot Py4J gateway to ROBOT on that port
reports/dashboard.csv: registry/ontologies.yml | \
reports/robot reports/principles build/ontologies build/robot.jar build/robot-foreign.jar
make reboot
./util/principles/dashboard.py $< $@ --big false

reports/big-dashboard.csv: reports/dashboard.csv
make reboot
./util/principles/dashboard.py registry/ontologies.yml $@ --big true

# Combine the dashboard files
reports/dashboard-full.csv: reports/dashboard.csv reports/big-dashboard.csv registry/ontologies.yml
./util/principles/sort_tables.py $^ $@

# Generate the HTML grid output for dashboard
reports/dashboard.html: reports/dashboard-full.csv
./util/create-html-grid.py $< $@

# Move all important results to a dashboard directory
build/dashboard: reports/dashboard.html
mkdir -p $@
mkdir -p $@/assets
mkdir -p $@/reports
cp $< $@
cp -r reports/robot $@/reports
cp -r reports/principles $@/reports
cp -r assets/svg $@/assets
rm -rf build/dashboard.zip
zip -r [email protected] $@

# Clean up, removing ontology files
# We don't want to keep them because we will download new ones each time to stay up-to-date
# Reports are all archived in build/dashboard.zip
clean-dashboard: build/dashboard
rm -rf build/ontologies
rm -rf reports/robot
rm -rf reports/principles
rm -rf build/dashboard


# Note this should *not* be run as part of general travis jobs, it is expensive
# and may be prone to false positives as it is inherently network-based
#
Expand Down
1 change: 1 addition & 0 deletions _includes/themes/bootstrap-3/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<!-- Custom styles -->
<link href="/css/custom.css" rel="stylesheet" type="text/css" media="all">
<link href="/assets/css/pygments.css" rel="stylesheet" type="text/css" media="all">

<style>
@media (min-width: 768px) {
Expand Down
68 changes: 68 additions & 0 deletions _layouts/check.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
layout: default
---

{% include navbar.html %}
<div class="content">


<div>
<div class="page-header">
<h1>
Automated Check {{ page.title }}
</h1>
<p>
{{page.summary}}
</p>
</div>

</div>

<div class="col-md-12">
<div class="row">
<div class="col-md-3">
<ul>
{% for p in site.principles %}
<li>
<a href="../{{p.id}}.html">{{p.title}}</a>
</li>
{% endfor %}
</ul>

<div class="btn-group" role="group" aria-label="Source">
<a href="https://github.com/OBOFoundry/OBOFoundry.github.io/blob/master/principles/{{page.id}}.md">
<button type="button"
data-toggle="tooltip"
title="See FAQ entry: How I do propose edits to principles?"
html="true"
class="btn btn-default">
View
</button>
</a>
<a href="https://github.com/OBOFoundry/OBOFoundry.github.io/edit/master/principles/checks/{{page.id}}.md">

<button type="button"
data-toggle="tooltip"
title="See FAQ entry: How I do propose edits to principles?"
html="true"
class="btn btn-default">
Edit</button>
</a>
<!-- <button type="button" class="btn btn-default">Help</button> -->
</div>
<div>
This page is generated via <a href="{{site.repo_src}}_layouts/principle.html">_layouts/check.html</a>. See <a href="/faq/how-do-i-edit-content.html">edit guide</a>
</div>

</div>
<div class="col-md-9">
{{ content }}
</div>
</div>


</div>


</div>

Loading