mirror of
https://github.com/clearml/clearml
synced 2025-03-03 18:52:12 +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(
|
print('\nTRAINS Hosts configuration:\nAPI: {}\nWeb App: {}\nFile Store: {}\n'.format(
|
||||||
api_host, web_host, files_host))
|
api_host, web_host, files_host))
|
||||||
|
|
||||||
|
while True:
|
||||||
print(description.format(web_host), end='')
|
print(description.format(web_host), end='')
|
||||||
parse_input = input()
|
parse_input = input()
|
||||||
# check if these are valid credentials
|
# check if these are valid credentials
|
||||||
@ -116,6 +117,18 @@ def main():
|
|||||||
|
|
||||||
print('Detected credentials key=\"{}\" secret=\"{}\"'.format(credentials['access_key'],
|
print('Detected credentials key=\"{}\" secret=\"{}\"'.format(credentials['access_key'],
|
||||||
credentials['secret_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
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
default_sdk_conf = Path(__file__).parent.absolute() / 'sdk.conf'
|
default_sdk_conf = Path(__file__).parent.absolute() / 'sdk.conf'
|
||||||
|
Loading…
Reference in New Issue
Block a user