INCATools / ontology-development-kit

Bootstrap an OBO Library ontology
http://incatools.github.io/ontology-development-kit/
BSD 3-Clause "New" or "Revised" License
212 stars 53 forks source link

robot needs java http proxy settings when behind a proxy #1063

Open schristley opened 1 month ago

schristley commented 1 month ago

When building our application ontology behind a proxy, robot gets an error when processing DOID.

curl -L http://purl.obolibrary.org/obo/DOID.owl --create-dirs -o tmp/DOID-download.owl --retry 4 --max-time 200 && \
robot --catalog catalog-v001.xml convert -i tmp/DOID-download.owl -o tmp/mirror-DOID.owl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   366    0   366    0     0   3763      0 --:--:-- --:--:-- --:--:--  3734
100 23.8M  100 23.8M    0     0  38.9M      0 --:--:-- --:--:-- --:--:-- 38.9M
org.semanticweb.owlapi.model.UnloadableImportException: Could not load imported ontology: <http://purl.obolibrary.org/obo/doid/obo/ext.owl> Cause: Connection reset
Use the -vvv option to show the stack trace.
Use the --help option to see usage information.
make: *** [Makefile:427: mirror-DOID] Error 1

The issue is that Java needs to know about the proxy. As I hack, I manually modified run.sh

ROBOT_JAVA_ARGS="$ODK_JAVA_OPTS -Dhttp.proxyHost=proxy.swmed.edu -Dhttp.proxyPort=3128" 

I suppose the better solution is to check if HTTP_PROXY is set in the environment and use it...

gouttegd commented 1 month ago

As I hack, I manually modified run.sh

If you don’t want to modify the run.sh script, you can also set the ODK_JAVA_OPTS variable within a run.sh.conf file. That file, when it exists, is sourced by the run.sh script, and is specifically intended to customize the script’s variables:

ODK_JAVA_OPTS="-Dhttp.proxyHost=proxy.swmed.edu -Dhttp.ProxyPort=3128 [...other Java settings as you need them...]"

I suppose the better solution is to check if HTTP_PROXY is set in the environment and use it...

I agree, I think the use of a proxy is common enough that the run.sh script should be able to automatically handle that case without requiring the user to manually configure it.