diff --git a/clearml_agent/backend_api/config/default/agent.conf b/clearml_agent/backend_api/config/default/agent.conf index c21b29e..9238e73 100644 --- a/clearml_agent/backend_api/config/default/agent.conf +++ b/clearml_agent/backend_api/config/default/agent.conf @@ -19,6 +19,8 @@ force_git_ssh_protocol: false # Force a specific SSH port when converting http to ssh links (the domain is kept the same) # 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 # Example values: "/usr/bin/python3" or "/usr/local/bin/python3.6" @@ -131,7 +133,7 @@ default_docker: { # 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 # arguments: ["--ipc=host", ] diff --git a/clearml_agent/helper/repo.py b/clearml_agent/helper/repo.py index f22233c..5a77075 100644 --- a/clearml_agent/helper/repo.py +++ b/clearml_agent/helper/repo.py @@ -254,15 +254,15 @@ class VCS(object): return url @classmethod - def replace_http_url(cls, url, port=None): - # type: (Text, Optional[int]) -> Text + def replace_http_url(cls, url, port=None, username=None): + # type: (Text, Optional[int], Optional[str]) -> Text """ Replace HTTPS URL with SSH URL when applicable """ parsed_url = furl(url) if parsed_url.scheme == "https": parsed_url.scheme = "ssh" - parsed_url.username = "git" + parsed_url.username = username or "git" parsed_url.password = None # 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, @@ -285,7 +285,10 @@ class VCS(object): return if parsed_url.scheme == "https": 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: print("Using SSH credentials - replacing https url '{}' with ssh url '{}'".format( self.url, new_url))