mirror of
https://github.com/GoogleCloudPlatform/vertex-ai-samples.git
synced 2026-09-26 14:42:04 +00:00
Update new job name creation format (#3377)
Co-authored-by: Rayan Dasoriya <dasoriya@google.com>
This commit is contained in:
co-authored by
Rayan Dasoriya
parent
0be74ddfa5
commit
c36e5f204d
@@ -85,7 +85,9 @@ def get_job_name_with_datetime(prefix: str) -> str:
|
||||
Returns:
|
||||
A job name.
|
||||
"""
|
||||
return prefix + datetime.datetime.now().strftime("_%Y%m%d_%H%M%S")
|
||||
now = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
job_name = f"{prefix}-{now}".replace("_", "-")
|
||||
return job_name
|
||||
|
||||
|
||||
def create_job_name(prefix: str) -> str:
|
||||
@@ -99,7 +101,7 @@ def create_job_name(prefix: str) -> str:
|
||||
"""
|
||||
user = os.environ.get("USER")
|
||||
now = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
job_name = f"{prefix}-{user}-{now}"
|
||||
job_name = f"{prefix}-{user}-{now}".replace("_", "-")
|
||||
return job_name
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user