5
5
import numpy as np
6
6
import pandas as pd
7
7
from pydantic import ValidationError
8
- from typing import Any , Dict , List
8
+ from typing import Any , Dict , List , AnyStr
9
9
import logging
10
10
import warnings
11
11
import os
14
14
15
15
from mdf_connect_client import MDFConnectClient
16
16
from mdf_forge import Forge
17
- from dlhub_sdk import DLHubClient
18
17
from globus_sdk import AuthClient
19
18
20
19
from .auth import PubAuths
@@ -37,15 +36,14 @@ class Foundry(FoundryBase):
37
36
"""Foundry Client Base Class
38
37
39
38
Foundry object used for all interactions with Foundry datasets and models. Interfaces with MDF Connect Client,
40
- Globus Compute, Globus Auth, Globus Transfer, Globus Search, DLHub, and relevant Globus Endpoints
39
+ Globus Compute, Globus Auth, Globus Transfer, Globus Search, and relevant Globus Endpoints
41
40
"""
42
41
43
- dlhub_client : Any
44
42
forge_client : Any
45
43
connect_client : Any
46
44
transfer_client : Any
47
45
auth_client : Any
48
- index = ""
46
+ index : AnyStr = ""
49
47
auths : Any
50
48
51
49
def __init__ (
@@ -84,9 +82,7 @@ def __init__(
84
82
"search" ,
85
83
"petrel" ,
86
84
"transfer" ,
87
- "dlhub" ,
88
85
"openid" ,
89
- "https://auth.globus.org/scopes/facd7ccc-c5f4-42aa-916b-a0e270e2c2a9/all" , # funcx
90
86
"https://auth.globus.org/scopes/f10a69a9-338c-4e5b-baa1-0dc92359ab47/https" , # Eagle HTTPS
91
87
"https://auth.globus.org/scopes/82f1b5c6-6e9b-11e5-ba47-22000b92c6ec/https" , # NCSA HTTPS
92
88
"https://auth.globus.org/scopes/d31d4f5d-be37-4adc-a761-2f716b7af105/action_all" , # Globus Search Lambda
@@ -115,7 +111,7 @@ def __init__(
115
111
search_client = self .auths ["search" ],
116
112
transfer_client = self .auths ["transfer" ],
117
113
data_mdf_authorizer = self .auths ["data_mdf" ],
118
- petrel_authorizer = self .auths ["petrel" ],
114
+ petrel_authorizer = self .auths ["petrel" ]
119
115
)
120
116
121
117
self .transfer_client = self .auths ['transfer' ]
@@ -132,19 +128,6 @@ def __init__(
132
128
authorizer = self .auths ["mdf_connect" ], test = test
133
129
)
134
130
135
- self .dlhub_client = DLHubClient (
136
- dlh_authorizer = self .auths ["dlhub" ],
137
- search_authorizer = self .auths ["search_authorizer" ],
138
- fx_authorizer = self .auths [
139
- "https://auth.globus.org/scopes/facd7ccc-c5f4-42aa-916b-a0e270e2c2a9/all"
140
- ],
141
- openid_authorizer = self .auths ['openid' ],
142
- sl_authorizer = self .auths [
143
- "https://auth.globus.org/scopes/d31d4f5d-be37-4adc-a761-2f716b7af105/action_all"
144
- ],
145
- force_login = False ,
146
- )
147
-
148
131
def load (self , name , download = True , globus = False , verbose = False , metadata = None , authorizers = None , ** kwargs ):
149
132
"""Load the metadata for a Foundry dataset into the client
150
133
@@ -250,22 +233,6 @@ def list(self):
250
233
"""
251
234
return self .search ()
252
235
253
- def run (self , name , inputs , funcx_endpoint = None , ** kwargs ):
254
- """Run a model on inputted data
255
-
256
- Args:
257
- name (str): DLHub model name
258
- inputs: Data to send to DLHub as inputs (should be JSON serializable, example types include dict, list,
259
- np.ndarray, etc)
260
- funcx_endpoint (str) (optional): UUID for the funcx endpoint to run the model on, if not the default (eg River)
261
-
262
- Returns:
263
- Results after invocation via the DLHub service
264
- """
265
- if funcx_endpoint is not None :
266
- self .dlhub_client .fx_endpoint = funcx_endpoint
267
- return self .dlhub_client .run (name , inputs = inputs , ** kwargs )
268
-
269
236
def load_data (self , source_id = None , globus = True , as_hdf5 = False , splits = []):
270
237
"""Load in the data associated with the prescribed dataset
271
238
@@ -469,36 +436,6 @@ def publish_dataset(
469
436
res = None
470
437
return res
471
438
472
- def publish_model (self , title , creators , short_name , servable_type , serv_options , affiliations = None , paper_doi = None ):
473
- """Simplified publishing method for servables
474
-
475
- Args:
476
- title (string): title for the servable
477
- creators (string | list): either the creator's name (FamilyName, GivenName) or a list of the creators' names
478
- short_name (string): shorthand name for the servable
479
- servable_type (string): the type of the servable, must be a member of ("static_method",
480
- "class_method",
481
- "keras",
482
- "pytorch",
483
- "tensorflow",
484
- "sklearn")
485
- serv_options (dict): the servable_type specific arguments that are necessary for publishing. arguments can
486
- be found at https://dlhub-sdk.readthedocs.io/en/latest/source/dlhub_sdk.models.servables.html
487
- under the appropriate ``create_model`` signature. use the argument names as keys and their values as
488
- the values.
489
- affiliations (list): list of affiliations for each author
490
- paper_doi (str): DOI of a paper that describes the servable
491
-
492
- Returns:
493
- (string): task id of this submission, can be used to check for success
494
-
495
- Raises:
496
- ValueError: If the given servable_type is not in the list of acceptable types
497
- Exception: If the serv_options are incomplete or the request to publish results in an error
498
- """
499
- return self .dlhub_client .easy_publish (title , creators , short_name , servable_type , serv_options , affiliations ,
500
- paper_doi )
501
-
502
439
def check_status (self , source_id , short = False , raw = False ):
503
440
"""Check the status of your submission.
504
441
0 commit comments