Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: gcloud integration, fixes #18 #23

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

abhishek818
Copy link
Contributor

@abhishek818 abhishek818 commented Mar 29, 2024

Added support for BigQuery, BigQuery Data Transfer, Logging, Storage, and Compute cloud services.
Add Tests.

Fixes: #18
/claim #18

@abhishek818 abhishek818 marked this pull request as draft March 29, 2024 11:34
@abhishek818 abhishek818 force-pushed the feat_gcloud_bigquery_integration branch 4 times, most recently from 6b4cf4c to 692c4ee Compare April 1, 2024 15:51
@abhishek818 abhishek818 changed the title WIP: Feat gcloud bigquery integration Feat gcloud bigquery integration Apr 1, 2024
Added support for BigQuery, BigQuery Data Transfer, Logging, Storage, and Compute cloud services.
Add Tests.
@abhishek818 abhishek818 force-pushed the feat_gcloud_bigquery_integration branch from 692c4ee to 4afc3db Compare April 1, 2024 15:54
@abhishek818
Copy link
Contributor Author

@HugoCasa Up for review.

@abhishek818 abhishek818 marked this pull request as ready for review April 1, 2024 15:54
@abhishek818
Copy link
Contributor Author

/claim #18

@HugoCasa
Copy link
Collaborator

HugoCasa commented Apr 6, 2024

Works great!
Few comments:

  • run prettier on the scripts
  • when creating objects you should use the api to check that they are really created
  • delete buckets/schedules/any objects you created after running main
  • no need to handle errors like you do, you can just let them throw
  • for Upload_an_object you need to use Base64 as type for the file
type Base64 = string

export async function main(file: Base64) {
   // upload the file
}
  • the credentials have to come from the resource, gcloud clients can accept credentials instead of keyFilename

here's the resource type def:

{
    "type": "object",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "required": [
        "type",
        "auth_uri",
        "client_id",
        "token_uri",
        "project_id",
        "private_key",
        "client_email",
        "private_key_id",
        "client_x509_cert_url",
        "auth_provider_x509_cert_url"
    ],
    "properties": {
        "type": {
            "type": "string"
        },
        "auth_uri": {
            "type": "string",
            "format": "url"
        },
        "client_id": {
            "type": "string"
        },
        "token_uri": {
            "type": "string",
            "format": "url"
        },
        "project_id": {
            "type": "string"
        },
        "private_key": {
            "type": "string"
        },
        "client_email": {
            "type": "string",
            "format": "email"
        },
        "private_key_id": {
            "type": "string"
        },
        "client_x509_cert_url": {
            "type": "string",
            "format": "url"
        },
        "auth_provider_x509_cert_url": {
            "type": "string",
            "format": "url"
        }
    }
}

@abhishek818
Copy link
Contributor Author

abhishek818 commented Apr 8, 2024

@HugoCasa
Reg, for Upload_an_object you need to use Base64 as type for the file
Not sure about this, it seems any file type is supported, have referred their official sample code - link

Anyways, have incorporated your ask.

@abhishek818
Copy link
Contributor Author

@HugoCasa Up for review again, have addressed your comments.

@abhishek818 abhishek818 changed the title Feat gcloud bigquery integration Feat: gcloud integration Apr 8, 2024
@HugoCasa
Copy link
Collaborator

Thanks for the update.

@abhishek818
Copy link
Contributor Author

@HugoCasa done.

@HugoCasa
Copy link
Collaborator

HugoCasa commented Apr 23, 2024

  • you need to use prettier with the config specified in the .prettierrc file
  • i get an error with Create_Scheduled_Query (5 NOT_FOUND: Requested entity was not found.)
  • can you update the resource type def to include universe domain

@HugoCasa
Copy link
Collaborator

HugoCasa commented May 7, 2024

@abhishek818 still on it?

@abhishek818
Copy link
Contributor Author

@HugoCasa yep, will just get back to this.

@abhishek818
Copy link
Contributor Author

abhishek818 commented May 8, 2024

@HugoCasa

i get an error with Create_Scheduled_Query (5 NOT_FOUND: Requested entity was not found.)

Tried everything like creating a new destination table under a new dataset for storing scheduled query results, varying request params, checking out stackoverflow/github repos (very limited references), nothing works.
Have followed the official docs and their github repo
i give up..

Have run prettier and added that resource type missing field.

@abhishek818 abhishek818 changed the title Feat: gcloud integration Feat: gcloud integration, fixes #18 May 8, 2024
Copy link
Collaborator

@HugoCasa HugoCasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check the in-code reviews and remove the Create_Scheduled_Query script

integrations/gcloud/Search_Objects/script.bun.ts Outdated Show resolved Hide resolved
integrations/gcloud/Upload_An_Object/script.bun.ts Outdated Show resolved Hide resolved
@abhishek818 abhishek818 requested a review from HugoCasa May 28, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write TypeScript scripts interacting with Google Cloud
2 participants