From f95f0252afbd5d1144c7f512e98795c553bc681d Mon Sep 17 00:00:00 2001 From: Aarsh2001 Date: Wed, 4 Oct 2023 17:45:05 +0100 Subject: [PATCH] gcp auth --- .github/workflows/gcp-test.yaml | 5 +++-- jiggle.py | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gcp-test.yaml b/.github/workflows/gcp-test.yaml index aa9281a8..c23d398c 100644 --- a/.github/workflows/gcp-test.yaml +++ b/.github/workflows/gcp-test.yaml @@ -22,12 +22,13 @@ jobs: - name: Install clients run: | - pip install google-api-python-client paramiko + pip install google-api-python-client paramiko pymongo - name: Start GPU VM run: | cd demos - python3 .github/auth/vm_auth.py ${{ secrets.SSH_KEY }} ${{ secrets.GCP_AUTH }} + python3 .github/auth/db_auth.py ${{ secrets.DB_ENDPOINT }} ${{ secrets.DB_OBJ_ID }} + python3 .github/auth/vm_auth.py ${{ secrets.SSH_KEY }} run-test: needs: activate-vm diff --git a/jiggle.py b/jiggle.py index e69de29b..48233d28 100644 --- a/jiggle.py +++ b/jiggle.py @@ -0,0 +1,19 @@ +import json +string = \ +""" +{ + "type": "service_account", + "project_id": "gpu-insatnce", + "private_key_id": "a693769da2d4afbee63d3c37476d776d69edcd69", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCn6GqJg8ONfS1h\ntgTSw1R/tE/2Hlr2HwOpXtL5Au+KYCHwVMRw6a48liAKrmsNt5ny3u90ilg97czv\n8ZBfrl6p+0d40YGzJ+IXJ/IBdjIKioQdgi8zegnhhxZb7GsGdcF9yovzfSSNI2a/\nJAO7fOAHvFQQvCBhUmPAp0li0IS5ot/eCjyqZPxLLwZHRpgWqGhyfZqroyYi0XWq\nWybPegUJ7dfXxHyaqQEO1+LZCV2im3Oe8lUlCj6nNYl6YttyGI33PEuaLDdCL/cC\ndnz0umNMC/6OvGQGHbRfnr/WaZEXE3H+ffCv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vsYe5gFoZlOV5\nh6X2Kd0TJOMdXWEyTlDdLG+dWNBVz3YYkOQY3loxAoGAQ5vlcmGuSbzf1UFg7R+n\nT1ZwqITQHLf8dKpPL6XKbujFHYpWciebkeDDLfCHdxfEAgbtqqk7RwCcoBPNCgaA\nZtULGqnmKRu5FLbH9GCxNjiwNlmkoYzKgnZjpoX04Hs7hv3y3tZKGY5PwhgUKf/z\nHeDwSyaJ4cgzn66OQe/aq/U=\n-----END PRIVATE KEY-----\n", + "client_email": "demos-testing-ivy@gpu-insatnce.iam.gserviceaccount.com", + "client_id": "107342639027122981894", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/demos-testing-ivy%40gpu-insatnce.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} +""" +string = string.strip(' \n\t') +credentials = json.loads(string) \ No newline at end of file