Skip to content

Commit

Permalink
minio-remove-cert (#45)
Browse files Browse the repository at this point in the history
* removing cert requirement

* Edit readme

* adding to gitignore

* adding to gitignore

* Adding example env.yml file
  • Loading branch information
fongcj authored Nov 15, 2024
1 parent 4b1c27e commit ba74977
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ docs/source/msk_cdm*.rst
build
dist
*.egg-info
site/*
configs/*

# python runtime
__pycache__/
Expand All @@ -22,8 +24,8 @@ __pycache__/
.DS_Store
.DS_store
/credentials.json
/databricks_env_test.txt
/configs/databricks_env_test.txt
/databricks_env.txt
/certificate_sparky.crt
/minio_env.txt
/configs/certificate_sparky.crt
/configs/minio_env.txt
/sandbox/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Run:
mkdocs serve --dev-addr <Default 127.0.0.1:8000>
```

### How to deploy the documentation
### How to deploy the documentation
Run:
```
mkdocs gh-deploy
Expand Down
16 changes: 16 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: <your-conda-env-example>
channels:
- pytorch
- nvidia
- conda-forge
dependencies:
- python == 3.10
- pandas
- pyyaml
- minio
- requests
- ipykernel
- conda-build
- pip
- pip:
- git+https://github.com/clinical-data-mining/msk_cdm.git
17 changes: 0 additions & 17 deletions src/msk_cdm/minio/_minio_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def __init__(
*,
ACCESS_KEY: Optional[str] = None,
SECRET_KEY: Optional[str] = None,
ca_certs: Optional[str] = None,
url_port: Optional[str] = "pllimsksparky3:9000",
fname_minio_env: Optional[Union[Path, str]] = None,
bucket: Optional[str] = None,
Expand All @@ -39,12 +38,10 @@ def __init__(
"""
self._ACCESS_KEY = ACCESS_KEY
self._SECRET_KEY = SECRET_KEY
self._ca_certs = ca_certs
self._url_port = url_port

self._bucket = bucket
self._client = None
self._httpClient = None

if fname_minio_env is not None:
self._process_env(fname_minio_env)
Expand Down Expand Up @@ -245,39 +242,25 @@ def _process_env(self, fname_minio_env):
self._ACCESS_KEY = dict_config.get("ACCESS_KEY", None)
if not self._SECRET_KEY:
self._SECRET_KEY = dict_config.get("SECRET_KEY", None)
if not self._ca_certs:
self._ca_certs = dict_config.get("CA_CERTS", None)
if not self._url_port:
self._url_port = dict_config.get("URL_PORT", None)
if not self._bucket:
self._bucket = dict_config.get("BUCKET", None)

# # Print out for QC
# print('Access Key: %s' % self._ACCESS_KEY)
# print('Secret Key: %s' % self._SECRET_KEY)
# print('CA Cert: %s' % self._ca_certs)
# print('URL Port: %s' % self._url_port)
# print('Bucket: %s' % self._bucket)

return None

def _connect(self):
# required for self-signed certs
httpClient = urllib3.PoolManager(
cert_reqs="CERT_REQUIRED", ca_certs=self._ca_certs
)

# Create secure client with access key and secret key
client = Minio(
endpoint=self._url_port,
access_key=self._ACCESS_KEY,
secret_key=self._SECRET_KEY,
secure=True,
http_client=httpClient,
)

self._client = client
self._httpClient = httpClient

return None

Expand Down

0 comments on commit ba74977

Please sign in to comment.