mirror of
https://github.com/clearml/clearml
synced 2025-03-03 10:42:00 +00:00
Add trains-init verifies credentials
This commit is contained in:
parent
2ba372560e
commit
933a9ad12e
@ -93,6 +93,7 @@ def main():
|
||||
print('\nTRAINS Hosts configuration:\nAPI: {}\nWeb App: {}\nFile Store: {}\n'.format(
|
||||
api_host, web_host, files_host))
|
||||
|
||||
while True:
|
||||
print(description.format(web_host), end='')
|
||||
parse_input = input()
|
||||
# check if these are valid credentials
|
||||
@ -116,6 +117,18 @@ def main():
|
||||
|
||||
print('Detected credentials key=\"{}\" secret=\"{}\"'.format(credentials['access_key'],
|
||||
credentials['secret_key'], ))
|
||||
|
||||
from trains.backend_api.session import Session
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
print('Verifying credentials ...')
|
||||
Session(api_key=credentials['access_key'], secret_key=credentials['secret_key'], host=api_host)
|
||||
print('Credentials verified!')
|
||||
break
|
||||
except Exception:
|
||||
print('Error: could not verify credentials: host={} access={} secret={}'.format(
|
||||
api_host, credentials['access_key'], credentials['secret_key']))
|
||||
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
default_sdk_conf = Path(__file__).parent.absolute() / 'sdk.conf'
|
||||
|
Loading…
Reference in New Issue
Block a user