mirror of
https://github.com/clearml/clearml-agent
synced 2025-02-12 07:38:04 +00:00
Add extra_index_url to the configuration wizard
This commit is contained in:
parent
402856656f
commit
2b239829de
@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
# additional artifact repositories to use when installing python packages
|
# additional artifact repositories to use when installing python packages
|
||||||
# extra_index_url: ["https://allegroai.jfrog.io/trainsai/api/pypi/public/simple"]
|
# extra_index_url: ["https://allegroai.jfrog.io/trainsai/api/pypi/public/simple"]
|
||||||
extra_index_url: []
|
|
||||||
|
|
||||||
# additional conda channels to use when installing with conda package manager
|
# additional conda channels to use when installing with conda package manager
|
||||||
conda_channels: ["defaults", "conda-forge", "pytorch", ]
|
conda_channels: ["defaults", "conda-forge", "pytorch", ]
|
||||||
|
@ -150,6 +150,18 @@ def main():
|
|||||||
git_user = None
|
git_user = None
|
||||||
git_pass = None
|
git_pass = None
|
||||||
|
|
||||||
|
# get extra-index-url for pip installations
|
||||||
|
extra_index_urls = []
|
||||||
|
print('\nEnter additional artifact repository (extra-index-url) to use when installing python packages '
|
||||||
|
'(leave blank if not required):', end='')
|
||||||
|
index_url = input().strip()
|
||||||
|
while index_url:
|
||||||
|
extra_index_urls.append(index_url)
|
||||||
|
print('Another artifact repository? (enter another url or leave blank if done):', end='')
|
||||||
|
index_url = input().strip()
|
||||||
|
if len(extra_index_urls):
|
||||||
|
print("The following artifact repositories will be added:\n\t- {}".format("\n\t- ".join(extra_index_urls)))
|
||||||
|
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
conf_folder = Path(__file__).parent.absolute() / '..' / 'backend_api' / 'config' / 'default'
|
conf_folder = Path(__file__).parent.absolute() / '..' / 'backend_api' / 'config' / 'default'
|
||||||
@ -183,6 +195,10 @@ def main():
|
|||||||
'agent.git_pass=\"{}\"\n' \
|
'agent.git_pass=\"{}\"\n' \
|
||||||
'\n'.format(git_user or '', git_pass or '')
|
'\n'.format(git_user or '', git_pass or '')
|
||||||
f.write(git_credentials)
|
f.write(git_credentials)
|
||||||
|
extra_index_str = '# extra_index_url: ["https://allegroai.jfrog.io/trainsai/api/pypi/public/simple"]\n' \
|
||||||
|
'agent.package_manager.extra_index_url= ' \
|
||||||
|
'[\n{}\n]\n\n'.format("\n".join(map("\"{}\"".format, extra_index_urls)))
|
||||||
|
f.write(extra_index_str)
|
||||||
f.write(default_conf)
|
f.write(default_conf)
|
||||||
except Exception:
|
except Exception:
|
||||||
print('Error! Could not write configuration file at: {}'.format(str(conf_file)))
|
print('Error! Could not write configuration file at: {}'.format(str(conf_file)))
|
||||||
|
Loading…
Reference in New Issue
Block a user