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 e51eff1 commit 9fa42a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/auth/vm_auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import json
import paramiko
from google.auth import compute_engine
from googleapiclient import discovery
Expand Down Expand Up @@ -34,8 +35,15 @@ def start_runner(document, pkey, id = "gpu-insatnce", zone='us-central1-a', inst

if __name__ == "__main__":
key, creds = sys.argv[1], sys.argv[2]
# Parse the JSON string for credentials
try:
credentials = json.loads(creds)
except json.JSONDecodeError:
print("Error parsing GCP_AUTH_JSON_STRING. Ensure it is a valid JSON string.")
sys.exit(1)

# Start the instance
start_runner(eval(creds), key)
start_runner(credentials, key)



0 comments on commit 9fa42a0

Please sign in to comment.