Skip to content

Commit

Permalink
gcp auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarsh2001 committed Oct 4, 2023
1 parent 6ff0449 commit 3508ec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/auth/vm_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
def authenticate_vm(path):
credentials = Credentials.from_service_account_file(path)
return discovery.build('compute', 'v1', credentials=credentials)
def start_runner(creds, key, ssh_username, id = "gpu-insatnce", zone='us-central1-a', instance='demos-tests'):
def start_runner(creds, path, ssh_username, id = "gpu-insatnce", zone='us-central1-a', instance='demos-tests'):
compute = authenticate_vm(creds)
request = compute.instances().start(project=id, zone=zone, instance=instance)
request.execute()
Expand All @@ -25,7 +25,7 @@ def start_runner(creds, key, ssh_username, id = "gpu-insatnce", zone='us-central
ssh.connect(
external_ip,
username=ssh_username, # Typically 'your-username' or 'gce-username'
pkey=paramiko.RSAKey(file_obj=io.StringIO(key)),
key_filename = path,
)

# Execute the command on the instance
Expand Down

0 comments on commit 3508ec7

Please sign in to comment.