diff options
author | Pjotr Prins | 2020-11-11 10:30:17 -0600 |
---|---|---|
committer | Pjotr Prins | 2020-11-11 10:30:17 -0600 |
commit | 29bb29bb6bb814384b476e8bdb10bceeb185dab0 (patch) | |
tree | 6ade8224e9b8691e5ea0f5b9a4d8691f5692bdea | |
parent | af6fa67707e185dbb9099f7c1ca371e77bdaf2bb (diff) | |
download | bh20-seq-resource-29bb29bb6bb814384b476e8bdb10bceeb185dab0.tar.gz bh20-seq-resource-29bb29bb6bb814384b476e8bdb10bceeb185dab0.tar.lz bh20-seq-resource-29bb29bb6bb814384b476e8bdb10bceeb185dab0.zip |
Deployment
-rw-r--r-- | .guix-deploy | 2 | ||||
-rwxr-xr-x | scripts/update_virtuoso/check_for_updates.py | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/.guix-deploy b/.guix-deploy index f79340d..af4c83f 100644 --- a/.guix-deploy +++ b/.guix-deploy @@ -8,5 +8,5 @@ export GUILE_LOAD_COMPILED_PATH=$GUIX_PROFILE/share/guile/site/3.0/ ls $GUILE_LOAD_PATH -env GUIX_PACKAGE_PATH=~/iwrk/opensource/guix/guix-bioinformatics/ $GUIX_PROFILE/bin/guix environment -C guix --ad-hoc git python python-flask python-pyyaml python-pycurl python-magic nss-certs python-pyshex python-pyyaml --network openssl python-pyshex python-pyshexc minimap2 python-schema-salad python-arvados-python-client --share=/export/tmp -- env TMPDIR=/export/tmp FLASK_ENV=development FLASK_RUN_PORT=5067 FLASK_APP=bh20simplewebuploader/main.py flask run +env GUIX_PACKAGE_PATH=~/iwrk/opensource/guix/guix-bioinformatics/ $GUIX_PROFILE/bin/guix environment -C guix --ad-hoc git python python-flask python-pyyaml python-pycurl python-magic nss-certs python-redis python-pyshex python-pyyaml --network openssl python-pyshex python-pyshexc minimap2 python-schema-salad python-arvados-python-client --share=/export/tmp -- env TMPDIR=/export/tmp FLASK_ENV=development FLASK_RUN_PORT=5067 FLASK_APP=bh20simplewebuploader/main.py flask run diff --git a/scripts/update_virtuoso/check_for_updates.py b/scripts/update_virtuoso/check_for_updates.py index 939a575..f32d0df 100755 --- a/scripts/update_virtuoso/check_for_updates.py +++ b/scripts/update_virtuoso/check_for_updates.py @@ -19,6 +19,10 @@ fn = sys.argv[1] user = sys.argv[2] pwd = sys.argv[3] +force = False +if fn== "--force": + force = True + no_cache = False if fn == "--no-cache": no_cache = True @@ -51,12 +55,12 @@ def upload(fn): print(out,err) assert(p.returncode == 0) -url = 'https://download.lugli.arvadosapi.com/c=lugli-4zz18-z513nlpqm03hpca/_/mergedmetadata.ttl' +url = 'https://collections.lugli.arvadosapi.com/c=lugli-4zz18-z513nlpqm03hpca/mergedMetadata.ttl' # --- Fetch headers from TTL file on Arvados # curl --head https://download.lugli.arvadosapi.com/c=lugli-4zz18-z513nlpqm03hpca/_/mergedmetadata.ttl r = requests.head(url) print(r.headers) -if not no_cache: +if not force and not no_cache: print(r.headers['Last-Modified']) # --- Convert/validate time stamp @@ -72,7 +76,7 @@ if os.path.isfile(fn): stamp = file.read() file.close -if no_cache or stamp != last_modified_str: +if force or no_cache or stamp != last_modified_str: print("Delete graphs") for graph in ["labels.ttl", "metadata.ttl", "countries.ttl"]: cmd = ("curl --digest -u dba:%s --verbose --url http://127.0.0.1:8890/sparql-graph-crud-auth?graph=http://covid-19.genenetwork.org/graph/%s -X DELETE" % (pwd, graph)) @@ -85,7 +89,7 @@ if no_cache or stamp != last_modified_str: upload(basedir+"/semantic_enrichment/labels.ttl") upload(basedir+"/semantic_enrichment/countries.ttl") - if not no_cache: + if force or not no_cache: print("Fetch metadata TTL") r = requests.get(url) assert(r.status_code == 200) @@ -93,7 +97,7 @@ if no_cache or stamp != last_modified_str: f.write(r.text) f.close upload("metadata.ttl") - if not no_cache: + if not force and not no_cache: with open(fn,"w") as f: f.write(last_modified_str) else: |