mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 08:49:02 +08:00
Only use git repo if .git exists (#5701)
This commit is contained in:
committed by
Philipp Moritz
parent
07c4c6367a
commit
1d4a11a433
@@ -93,6 +93,9 @@ class ProjectDefinition:
|
||||
|
||||
return command_to_run
|
||||
|
||||
def git_repo(self):
|
||||
return self.config.get("repo", None)
|
||||
|
||||
|
||||
def find_root(directory):
|
||||
"""Find root directory of the ray project.
|
||||
|
||||
@@ -101,12 +101,13 @@ def create(project_name, cluster_yaml, requirements):
|
||||
requirements = REQUIREMENTS_TXT
|
||||
|
||||
repo = None
|
||||
try:
|
||||
repo = subprocess.check_output(
|
||||
"git remote get-url origin".split(" ")).strip()
|
||||
logger.info("Setting repo URL to %s", repo)
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
if os.path.exists(".git"):
|
||||
try:
|
||||
repo = subprocess.check_output(
|
||||
"git remote get-url origin".split(" ")).strip()
|
||||
logger.info("Setting repo URL to %s", repo)
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
with open(PROJECT_TEMPLATE) as f:
|
||||
project_template = f.read()
|
||||
|
||||
Reference in New Issue
Block a user