Skip to content

Commit

Permalink
Merge pull request #319 from obophenotype/odk15r
Browse files Browse the repository at this point in the history
Update OBA to ODK 1.5
  • Loading branch information
matentzn authored Mar 2, 2024
2 parents e13f696 + 1e6d480 commit 7831114
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 104 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
ontology_qc:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.3.0
container: obolibrary/odkfull:v1.5

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Run ontology QC checks
env:
DEFAULT_BRANCH: master
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ src/ontology/run.sh.env
*.gz
src/ontology/imports/lipidmaps_import.owl
src/ontology/imports/swisslipids_import.owl
src/ontology/debug.log
2 changes: 1 addition & 1 deletion docs/odk-workflows/RepoManagement.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Updating your ODK repository

Your ODK repositories configuration is managed in `src/ontology/oba-odk.yaml`. Once you have made your changes, you can run the following to apply your changes to the repository:
Your ODK repositories configuration is managed in `src/ontology/oba-odk.yaml`. The [ODK Project Configuration Schema](https://github.com/INCATools/ontology-development-kit/blob/master/docs/project-schema.md) defines all possible parameters that can be used in this config YAML. Once you have made your changes, you can run the following to apply your changes to the repository:


```
Expand Down
215 changes: 127 additions & 88 deletions src/ontology/Makefile

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/ontology/oba-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ release_artefacts:
- base
- full
- basic
- baseplus
primary_release: full
import_group:
use_base_merging: TRUE
Expand Down
11 changes: 6 additions & 5 deletions src/ontology/oba.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ DOCUMENTATION_PAGES=../../docs/metrics.md \
../../docs/oak-metrics.md \
../../docs/robot-metrics.md

reports/robot-metrics.yml: oba-baseplus.owl
reports/robot-metrics.yml: oba-base.owl
$(ROBOT) measure -i $< --format yaml --metrics all -o $@

reports/oak-metrics.yml: oba-baseplus.db
reports/oak-metrics.yml: oba-base.db
runoak -i $< statistics --has-prefix OBA > $@

../../docs/%-metrics.md: config/%-metrics.md.jinja2 reports/%-metrics.yml
Expand All @@ -232,7 +232,7 @@ documentation:
#######################################
# Here, we compare the structure of OAK with other ontologies

$(TMPDIR)/vt-baseplus.owl: $(TMPDIR)/mirror-vt.owl
$(TMPDIR)/vt-base.owl: $(TMPDIR)/mirror-vt.owl
$(ROBOT_RELEASE_IMPORT_MODE) \
reason --reasoner ELK --equivalent-classes-allowed asserted-only --exclude-tautologies structural \
relax \
Expand All @@ -243,8 +243,8 @@ $(TMPDIR)/vt-baseplus.owl: $(TMPDIR)/mirror-vt.owl
--ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
--output $@.tmp.owl && mv $@.tmp.owl $@

$(REPORTDIR)/oba-vt-diff-simple.yaml: oba-baseplus.owl $(TMPDIR)/vt-baseplus.owl
runoak --input sqlite:$< diff-via-mappings -X sqlite:$(TMPDIR)/vt-baseplus.owl --mapping-input ../mappings/oba-vt.sssom.tsv -o $@
$(REPORTDIR)/oba-vt-diff-simple.yaml: oba-base.owl $(TMPDIR)/vt-base.owl
runoak --input sqlite:$< diff-via-mappings -X sqlite:$(TMPDIR)/vt-base.owl --mapping-input ../mappings/oba-vt.sssom.tsv -o $@

.PHONY: oak_diff
oak_diff:
Expand Down Expand Up @@ -399,3 +399,4 @@ help:
echo "* oak_match: Run a bunch of standard OAK matching tasks"
echo "* phenotype_mappings: Recreate the OBA Phenotype mappings"


38 changes: 34 additions & 4 deletions src/ontology/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# See README-editors.md for more details.

set -e

if [ -f run.sh.conf ]; then
. ./run.sh.conf
fi
Expand All @@ -29,6 +31,22 @@ elif [ -f "$HOME/Library/Application Support/ontology-development-kit/github/tok
GH_TOKEN=$(cat "$HOME/Library/Application Support/ontology-development-kit/github/token")
fi

# SSH agent socket
# On macOS, we cannot use $SSH_AUTH_SOCK directly,
# we need to use a "magic" socket instead.
case "$(uname)" in
Darwin)
ODK_SSH_AUTH_SOCKET=/run/host-services/ssh-auth.sock
;;
*)
ODK_SSH_AUTH_SOCKET=$SSH_AUTH_SOCK
;;
esac
ODK_SSH_BIND=
if [ -n "$ODK_SSH_AUTH_SOCKET" ]; then
ODK_SSH_BIND=",$ODK_SSH_AUTH_SOCKET:/run/host-services/ssh-auth.sock"
fi

ODK_IMAGE=${ODK_IMAGE:-odkfull}
TAG_IN_IMAGE=$(echo $ODK_IMAGE | awk -F':' '{ print $2 }')
if [ -n "$TAG_IN_IMAGE" ]; then
Expand All @@ -40,16 +58,28 @@ ODK_TAG=${ODK_TAG:-latest}
ODK_JAVA_OPTS=${ODK_JAVA_OPTS:--Xmx8G}
ODK_DEBUG=${ODK_DEBUG:-no}

ODK_USER_ID=${ODK_USER_ID:-$(id -u)}
ODK_GROUP_ID=${ODK_GROUP_ID:-$(id -g)}

# Convert OWLAPI_* environment variables to the OWLAPI as Java options
# See http://owlcs.github.io/owlapi/apidocs_4/org/semanticweb/owlapi/model/parameters/ConfigurationOptions.html
# for a list of allowed options
OWLAPI_OPTIONS_NAMESPACE=org.semanticweb.owlapi.model.parameters.ConfigurationOptions
for owlapi_var in $(env | sed -n s/^OWLAPI_//p) ; do
ODK_JAVA_OPTS="$ODK_JAVA_OPTS -D$OWLAPI_OPTIONS_NAMESPACE.${owlapi_var%=*}=${owlapi_var#*=}"
done

TIMECMD=
if [ x$ODK_DEBUG = xyes ]; then
# If you wish to change the format string, take care of using
# non-breaking spaces (U+00A0) instead of normal spaces, to
# prevent the shell from tokenizing the format string.
echo "Running ${IMAGE} with ${ODK_JAVA_OPTS} of memory for ROBOT and Java-based pipeline steps."
echo "Running obolibrary/${ODK_IMAGE}:${ODK_TAG} with '${ODK_JAVA_OPTS}' as options for ROBOT and other Java-based pipeline steps."
TIMECMD="/usr/bin/time -f ### DEBUG STATS ###\nElapsed time: %E\nPeak memory: %M kb"
fi
rm -f tmp/debug.log

VOLUME_BIND=$PWD/../../:/work
VOLUME_BIND=$PWD/../../:/work$ODK_SSH_BIND
WORK_DIR=/work/src/ontology

if [ -n "$ODK_BINDS" ]; then
Expand All @@ -59,14 +89,14 @@ fi
if [ -n "$USE_SINGULARITY" ]; then

singularity exec --cleanenv $ODK_SINGULARITY_OPTIONS \
--env "ROBOT_JAVA_ARGS=$ODK_JAVA_OPTS,JAVA_OPTS=$ODK_JAVA_OPTS" \
--env "ROBOT_JAVA_ARGS=$ODK_JAVA_OPTS,JAVA_OPTS=$ODK_JAVA_OPTS,SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock,ODK_USER_ID=$ODK_USER_ID,ODK_GROUP_ID=$ODK_GROUP_ID,ODK_DEBUG=$ODK_DEBUG" \
--bind $VOLUME_BIND \
-W $WORK_DIR \
docker://obolibrary/$ODK_IMAGE:$ODK_TAG $TIMECMD "$@"
else
BIND_OPTIONS="-v $(echo $VOLUME_BIND | sed 's/,/ -v /')"
docker run $ODK_DOCKER_OPTIONS $BIND_OPTIONS -w $WORK_DIR \
-e ROBOT_JAVA_ARGS="$ODK_JAVA_OPTS" -e JAVA_OPTS="$ODK_JAVA_OPTS" \
-e ROBOT_JAVA_ARGS="$ODK_JAVA_OPTS" -e JAVA_OPTS="$ODK_JAVA_OPTS" -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock -e ODK_USER_ID=$ODK_USER_ID -e ODK_GROUP_ID=$ODK_GROUP_ID -e ODK_DEBUG=$ODK_DEBUG \
--rm -ti obolibrary/$ODK_IMAGE:$ODK_TAG $TIMECMD "$@"
fi

Expand Down
4 changes: 4 additions & 0 deletions src/scripts/run-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
ODK_DEBUG_FILE=${ODK_DEBUG_FILE:-debug.log}
echo "Command: sh $@" >> $ODK_DEBUG_FILE
/usr/bin/time -a -o $ODK_DEBUG_FILE -f "Elapsed time: %E\nPeak memory: %M kb" /bin/sh "$@"
5 changes: 3 additions & 2 deletions src/scripts/update_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ cp target/$OID/src/ontology/run.sh $SRCDIR/ontology/
cp -r target/$OID/src/sparql/* $SRCDIR/sparql/
mkdir -p $ROOTDIR/.github
mkdir -p $ROOTDIR/.github/workflows
cp -n target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml
cp target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml



cp target/$OID/.github/workflows/docs.yml $ROOTDIR/.github/workflows/docs.yml
Expand All @@ -35,5 +36,5 @@ cp target/$OID/.github/workflows/docs.yml $ROOTDIR/.github/workflows/docs.yml
cp -n target/$OID/mkdocs.yaml $ROOTDIR/

echo "WARNING: These files should be manually migrated: mkdocs.yaml, .gitignore, src/ontology/catalog.xml (if you added a new import or component)"
echo "WARNING: Your QC workflows have not been updated automatically. Please update the ODK version number(s) in .github/workflows/qc.yml."

echo "Ontology repository update successfully completed."

0 comments on commit 7831114

Please sign in to comment.