Skip to content

Commit

Permalink
Merge pull request #450 from Knowledge-Graph-Hub/add_kghub_downloader
Browse files Browse the repository at this point in the history
Update reqs and Jenkins for multi-indexer
  • Loading branch information
caufieldjh authored Mar 15, 2022
2 parents 2326d34 + 0776a97 commit 218fddc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pipeline {
//
// put $S3PROJECTDIR/$BUILDSTARTDATE/ and $S3PROJECTDIR/current in s3 bucket
//
sh '. venv/bin/activate && python3.8 ./go-site/scripts/directory_indexer.py -v --inject ./go-site/scripts/directory-index-template.html --directory $S3PROJECTDIR --prefix https://kg-hub.berkeleybop.io/$S3PROJECTDIR/ -x -u'
sh '. venv/bin/activate && python3.8 multi_indexer -v --directory $S3PROJECTDIR --prefix https://kg-hub.berkeleybop.io/$S3PROJECTDIR/ -x -u'
// for existing builds on s3, we just made an index.html that will clobber the existing (correct) s3 index.html
// here we download the existing index.html and clobber the local one instead
sh ". venv/bin/activate && for dir in `s3cmd ls s3://kg-hub-public-data/kg-covid-19/ | grep '\\/\$' | awk '{print \$NF}' | grep -w -v -E 'raw|current' | xargs -n1 basename`; do s3cmd get --force --continue s3://kg-hub-public-data/kg-covid-19/\$dir/index.html $S3PROJECTDIR/\$dir/ || true; done"
Expand All @@ -200,7 +200,7 @@ pipeline {

// Build the top level index.html
// "External" packages required to run these scripts.
sh '. venv/bin/activate && python3.8 ./go-site/scripts/bucket-indexer.py --credentials $AWS_JSON --bucket kg-hub-public-data --inject ./go-site/scripts/directory-index-template.html --prefix https://kg-hub.berkeleybop.io/ > top-level-index.html'
sh '. venv/bin/activate && python3.8 multi_indexer --bucket kg-hub-public-data --prefix https://kg-hub.berkeleybop.io/ > top-level-index.html'
sh '. venv/bin/activate && s3cmd -c $S3CMD_CFG put --acl-public --mime-type=text/html --cf-invalidate top-level-index.html s3://kg-hub-public-data/index.html'

// Invalidate the CDN now that the new files are up.
Expand Down
2 changes: 1 addition & 1 deletion kg_covid_19/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-


from .utils import download_from_yaml
from kghub_downloader.download_utils import download_from_yaml # type: ignore


def download(yaml_file: str, output_dir: str, ignore_cache: bool = False) -> None:
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ def find_version(*file_paths):
'pyyaml',
'bmt',
'ensmallen_graph==0.4.3',
'elasticsearch',
'elasticsearch==7.17.1',
'sphinx',
'sphinx_rtd_theme',
'recommonmark',
'kghub-downloader',
'multi-indexer'
],
extras_require=extras,
)

0 comments on commit 218fddc

Please sign in to comment.