Commit 7f865fed authored by Yunhua Koglin's avatar Yunhua Koglin
Browse files

add dask

parent 93875ddc
......@@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = '0.0.1'
__version__ = '1.0.1'
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional
# import s3fs
# import fsspec
from osdu.core.api.storage.dask_storage_parameters import DaskStorageParameters
from osdu.core.api.storage.tenant import Tenant
from .storage_aws import AwsStorage
async def get_dask_storage_parameters(tenant: Tenant, directory: Optional[str] = None) -> DaskStorageParameters:
storage = AwsStorage(session=None,service_account_file=directory)
await storage.getCredentials(tenant)
# storage._access_key = credentials['AccessKeyId']
# storage._secret_key = credentials['SecretAccessKey']
# storage._session_token = credentials['SessionToken']
base_directory = storage._bucket_name+"/"+tenant.bucket_name
storage_options={'anon': False, 'use_ssl': True, 'key':storage._access_key, 'secret':storage._secret_key, 'token':storage._session_token}
print("here is the test\n\n\n")
return DaskStorageParameters(protocol='s3',
base_directory=base_directory,
storage_options=storage_options)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment