mirror of
https://github.com/clearml/clearml-agent
synced 2025-04-27 09:29:13 +00:00
Add agent.force_git_ssh_user configuration value (issue #42)
Change default docker to nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04
This commit is contained in:
parent
b7f87fb8d3
commit
161993f66f
@ -19,6 +19,8 @@
|
|||||||
force_git_ssh_protocol: false
|
force_git_ssh_protocol: false
|
||||||
# Force a specific SSH port when converting http to ssh links (the domain is kept the same)
|
# Force a specific SSH port when converting http to ssh links (the domain is kept the same)
|
||||||
# force_git_ssh_port: 0
|
# force_git_ssh_port: 0
|
||||||
|
# Force a specific SSH username when converting http to ssh links (the default username is 'git')
|
||||||
|
# force_git_ssh_user: git
|
||||||
|
|
||||||
# Set the python version to use when creating the virtual environment and launching the experiment
|
# Set the python version to use when creating the virtual environment and launching the experiment
|
||||||
# Example values: "/usr/bin/python3" or "/usr/local/bin/python3.6"
|
# Example values: "/usr/bin/python3" or "/usr/local/bin/python3.6"
|
||||||
@ -131,7 +133,7 @@
|
|||||||
|
|
||||||
default_docker: {
|
default_docker: {
|
||||||
# default docker image to use when running in docker mode
|
# default docker image to use when running in docker mode
|
||||||
image: "nvidia/cuda:10.1-runtime-ubuntu18.04"
|
image: "nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04"
|
||||||
|
|
||||||
# optional arguments to pass to docker image
|
# optional arguments to pass to docker image
|
||||||
# arguments: ["--ipc=host", ]
|
# arguments: ["--ipc=host", ]
|
||||||
|
@ -254,15 +254,15 @@ class VCS(object):
|
|||||||
return url
|
return url
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def replace_http_url(cls, url, port=None):
|
def replace_http_url(cls, url, port=None, username=None):
|
||||||
# type: (Text, Optional[int]) -> Text
|
# type: (Text, Optional[int], Optional[str]) -> Text
|
||||||
"""
|
"""
|
||||||
Replace HTTPS URL with SSH URL when applicable
|
Replace HTTPS URL with SSH URL when applicable
|
||||||
"""
|
"""
|
||||||
parsed_url = furl(url)
|
parsed_url = furl(url)
|
||||||
if parsed_url.scheme == "https":
|
if parsed_url.scheme == "https":
|
||||||
parsed_url.scheme = "ssh"
|
parsed_url.scheme = "ssh"
|
||||||
parsed_url.username = "git"
|
parsed_url.username = username or "git"
|
||||||
parsed_url.password = None
|
parsed_url.password = None
|
||||||
# make sure there is no port in the final url (safe_furl support)
|
# make sure there is no port in the final url (safe_furl support)
|
||||||
# the original port was an https port, and we do not know if there is a different ssh port,
|
# the original port was an https port, and we do not know if there is a different ssh port,
|
||||||
@ -285,7 +285,10 @@ class VCS(object):
|
|||||||
return
|
return
|
||||||
if parsed_url.scheme == "https":
|
if parsed_url.scheme == "https":
|
||||||
new_url = self.replace_http_url(
|
new_url = self.replace_http_url(
|
||||||
self.url, port=self.session.config.get('agent.force_git_ssh_port', None))
|
self.url,
|
||||||
|
port=self.session.config.get('agent.force_git_ssh_port', None),
|
||||||
|
username=self.session.config.get('agent.force_git_ssh_user', None)
|
||||||
|
)
|
||||||
if new_url != self.url:
|
if new_url != self.url:
|
||||||
print("Using SSH credentials - replacing https url '{}' with ssh url '{}'".format(
|
print("Using SSH credentials - replacing https url '{}' with ssh url '{}'".format(
|
||||||
self.url, new_url))
|
self.url, new_url))
|
||||||
|
Loading…
Reference in New Issue
Block a user