Skip to content

Commit

Permalink
fix sky key secret creation so it won't break release testing locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra Belousov authored and Alexandra Belousov committed Dec 15, 2024
1 parent 8aa05a1 commit 5674950
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion runhouse/resources/hardware/launcher_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,15 @@ def supported_providers():

@classmethod
def sky_secret(cls):
from tests.fixtures.resource_fixtures import create_folder_path

secrets_name = "ssh-sky-key"

# This check is made for testsing purposes. If we are running test, the sky-key values saved loclly and in den should match.
# Therefore, we need to create a unique ssh-sky-key secret every test run, so we could parallelly run tests
# (For example: Running in parallel CI tests run and release tests)
if "test" in rh.configs.username:
secrets_name = f"{create_folder_path()}-{secrets_name}"
try:
sky_secret = rh.secret(secrets_name)
except ValueError:
Expand All @@ -116,7 +124,9 @@ def sky_secret(cls):

default_ssh_path, _ = generate_ssh_keys()
logger.info(f"Saved new SSH key to path: {default_ssh_path} ")
sky_secret = provider_secret(provider="sky", path=default_ssh_path)
sky_secret = provider_secret(
provider="sky", path=default_ssh_path, name=secrets_name
)
sky_secret.save()

secret_values = sky_secret.values
Expand Down

0 comments on commit 5674950

Please sign in to comment.