Skip to content

Commit

Permalink
remove signpost from sheepdog deps (#291)
Browse files Browse the repository at this point in the history
* Remove backwards compatibility tests for signpost

* Remove if-else logic for signpost

* rename app.signpost to app.index_client

* rename transaction.signpost to transaction.index_client

* un-alias IndexClient from SignpostClient

* rename config vb SIGNPOST to INDEX_CLIENT

* rename signpost_obj to file_record

* miscellaneous signpost cleanup
  • Loading branch information
vpsx authored Jun 18, 2019
1 parent 279a0b8 commit d13676f
Show file tree
Hide file tree
Showing 21 changed files with 144 additions and 477 deletions.
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ more-itertools==5.0.0
cdispyutils==0.2.13
datamodelutils==0.4.5
psqlgraph==1.2.3
-e git+https://[email protected]/NCI-GDC/[email protected]#egg=signpost
# required for gdcdatamodel, not required for sheepdog
-e git+https://[email protected]/uc-cdis/[email protected]#egg=cdiserrors
-e git+https://[email protected]/uc-cdis/cdislogging.git@master#egg=cdislogging
-e git+https://[email protected]/NCI-GDC/cdisutils.git@f54e393c89939b2200dfae45c6235cbe2bae1206#egg=cdisutils
gdcdictionary==1.2.0
gdcdatamodel==1.3.12
-e git+https://[email protected]/uc-cdis/[email protected]#egg=indexclient
-e git+https://[email protected]/NCI-GDC/python-signpostclient.git@ca686f55772e9a7f839b4506090e7d2bb0de5f15#egg=signpostclient
-e git+https://[email protected]/uc-cdis/[email protected]#egg=storageclient
4 changes: 2 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def fake_get_nodes(dids):
return nodes


def fake_urls_from_signpost(did):
def fake_urls_from_index_client(did):
return ["s3://fake-host/fake_bucket/{}".format(did)]


Expand Down Expand Up @@ -123,7 +123,7 @@ def run_with_fake_download():
"sheepdog.download",
key_for=fake_key_for,
key_for_node=fake_key_for_node,
urls_from_signpost=fake_urls_from_signpost,
urls_from_index_client=fake_urls_from_index_client,
):
if os.environ.get("GDC_FAKE_AUTH"):
run_with_fake_auth()
Expand Down
13 changes: 6 additions & 7 deletions sheepdog/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from datamodelutils import models, validators, postgres_admin


from indexclient.client import IndexClient as SignpostClient
from indexclient.client import IndexClient

import sheepdog
from sheepdog.errors import (
Expand Down Expand Up @@ -78,11 +78,11 @@ def db_init(app):

app.oauth_client = oauth2_client.OAuthClient(**app.config["OAUTH2"])

app.logger.info("Initializing Signpost driver")
app.signpost = SignpostClient(
app.config["SIGNPOST"]["host"],
version=app.config["SIGNPOST"]["version"],
auth=app.config["SIGNPOST"]["auth"],
app.logger.info("Initializing index client")
app.index_client = IndexClient(
app.config["INDEX_CLIENT"]["host"],
version=app.config["INDEX_CLIENT"]["version"],
auth=app.config["INDEX_CLIENT"]["auth"],
)


Expand Down Expand Up @@ -124,7 +124,6 @@ def app_init(app):
app.logger.info("Initializing app")

# explicit options set for compatibility with gdc's api
app.config["USE_SIGNPOST"] = False
app.config["AUTH_SUBMISSION_LIST"] = True
app.config["USE_DBGAP"] = False
app.config["IS_GDC"] = False
Expand Down
6 changes: 3 additions & 3 deletions sheepdog/dev_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from boto.s3.connection import OrdinaryCallingFormat
from os import environ as env

# Signpost
SIGNPOST = {
"host": env.get("SIGNPOST_HOST", "http://localhost:8888"),
# Index client
INDEX_CLIENT = {
"host": env.get("INDEX_CLIENT_HOST", "http://localhost:8888"),
"version": "v0",
"auth": None,
}
Expand Down
2 changes: 1 addition & 1 deletion sheepdog/test_settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections import OrderedDict
from .config import LEGACY_MODE

SIGNPOST = {
INDEX_CLIENT = {
"host": "http://localhost:8000",
"version": "v0",
"auth": ("fake_user", "fake_password"),
Expand Down
2 changes: 1 addition & 1 deletion sheepdog/transactions/deletion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def handle_deletion_request(program, project, ids, to_delete=None, **tx_kwargs):
program=program,
project=project,
logger=flask.current_app.logger,
signpost=flask.current_app.signpost,
index_client=flask.current_app.index_client,
to_delete=to_delete,
db_driver=db_driver,
**tx_kwargs
Expand Down
2 changes: 1 addition & 1 deletion sheepdog/transactions/release/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def handle_release_transaction(program, project, **tx_kwargs):
program=program,
project=project,
logger=flask.current_app.logger,
signpost=flask.current_app.signpost,
index_client=flask.current_app.index_client,
db_driver=db_driver,
**tx_kwargs
)
Expand Down
2 changes: 1 addition & 1 deletion sheepdog/transactions/review/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _single_transaction(tx_cls, program, project, **tx_kwargs):
program=program,
project=project,
logger=flask.current_app.logger,
signpost=flask.current_app.signpost,
index_client=flask.current_app.index_client,
db_driver=db_driver,
**tx_kwargs
)
Expand Down
2 changes: 1 addition & 1 deletion sheepdog/transactions/submission/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def handle_submission_transaction(program, project, *doc_args, **tx_kwargs):
program=program,
project=project,
logger=flask.current_app.logger,
signpost=flask.current_app.signpost,
index_client=flask.current_app.index_client,
db_driver=db_driver,
**tx_kwargs
)
Expand Down
4 changes: 2 additions & 2 deletions sheepdog/transactions/transaction_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, program, project, **kwargs):
dry_run: If True, the transaction will not be committed
role: The role required to take this transaction
user: The initializer of the transaction
signpost: Signpost driver (default: capp.signpost)
index_client: index client (default: capp.index_client)
db_driver: PsqlGraph driver (default: capp.db)
logger: Logging driver (default: capp.logger)
transaction_id: Optionally inherit and write to an existing
Expand All @@ -70,7 +70,7 @@ def __init__(self, program, project, **kwargs):
self.role = kwargs.pop("role", None)
# To be pulled from flask request context if not provided
self.logger = kwargs.pop("logger", None) or current_app.logger
self.signpost = kwargs.pop("signpost", None) or current_app.signpost
self.index_client = kwargs.pop("index_client", None) or current_app.index_client
self.db_driver = kwargs.pop("db_driver", None) or current_app.db
self.config = kwargs.pop("flask_config", None) or current_app.config
#: Create a transaction log, this will be created and committed to the
Expand Down
6 changes: 3 additions & 3 deletions sheepdog/transactions/upload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _single_transaction(role, program, project, *doc_args, **tx_kwargs):
project=project,
role=role,
logger=flask.current_app.logger,
signpost=flask.current_app.signpost,
index_client=flask.current_app.index_client,
flask_config=flask.current_app.config,
db_driver=db_driver,
external_proxies=utils.get_external_proxies(),
Expand Down Expand Up @@ -123,7 +123,7 @@ def handle_single_transaction(role, program, project, **tx_kwargs):
role=role,
logger=flask.current_app.logger,
flask_config=flask.current_app.config,
signpost=flask.current_app.signpost,
index_client=flask.current_app.index_client,
external_proxies=utils.get_external_proxies(),
db_driver=db_driver,
**tx_kwargs
Expand Down Expand Up @@ -246,7 +246,7 @@ def handle_bulk_transaction(role, program, project, **tx_kwargs):
project=project,
role=role,
logger=flask.current_app.logger,
signpost=flask.current_app.signpost,
index_client=flask.current_app.index_client,
db_driver=flask.current_app.db,
external_proxies=utils.get_external_proxies(),
**tx_kwargs
Expand Down
Loading

0 comments on commit d13676f

Please sign in to comment.