turbot / steampipe-plugin-gcp

Use SQL to instantly query GCP resources across regions, projects and organizations. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/gcp
Apache License 2.0
39 stars 25 forks source link

Add new table gcp_vertex_ai_model #555

Closed Priyanka-Chatterjee-2000 closed 6 months ago

Priyanka-Chatterjee-2000 commented 6 months ago

Integration test logs

Logs ``` Add passing integration test logs here ```

Example query results

Results ``` select name, display_name, create_time, version_id, container_spec, deployed_models from gcp_vertex_ai_model; Warning: failed to start plugin instance 'hub.steampipe.io/plugins/turbot/prometheus@latest': Get "http://localhost:9090/api/v1/label/__name__/values?end=1711529148.242302&match%5B%5D=%7B__name__%3D~%22.%2B%22%7D&start=1711525548.242302": dial tcp 127.0.0.1:9090: connect: connection refused +------------------------------------+------------------------------------+---------------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------> | name | display_name | create_time | version_id | container_spec > +------------------------------------+------------------------------------+---------------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------> | microsoft_biomedclip-1711459586314 | microsoft_biomedclip-1711459586314 | 2024-03-26T18:57:25+05:30 | 1 | {"env":[{"name":"MODEL","value":"hf-hub:microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224"},{"name":"TASK","value":"zero-shot-image-classificatio> +------------------------------------+------------------------------------+---------------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------> > select name, display_name, create_time from gcp_vertex_ai_model where create_time >= current_date - interval '30 days'; +------------------------------------+------------------------------------+---------------------------+ | name | display_name | create_time | +------------------------------------+------------------------------------+---------------------------+ | microsoft_biomedclip-1711459586314 | microsoft_biomedclip-1711459586314 | 2024-03-26T18:57:25+05:30 | +------------------------------------+------------------------------------+---------------------------+ > select name, display_name, case when model_source_info ->> 'source_type' = '1' then 'Model Generated by AutoML' when model_source_info ->> 'source_type' = '2' then 'Model Imported from Custom' when model_source_info ->> 'source_type' = '3' then 'Model Imported from BigQuery ML' when model_source_info ->> 'source_type' = '4' then 'Model Saved from Model Garden' when model_source_info ->> 'source_type' = '5' then 'Model Saved from Genie' end as model_source from gcp_vertex_ai_model; +------------------------------------+------------------------------------+-------------------------------+ | name | display_name | model_source | +------------------------------------+------------------------------------+-------------------------------+ | microsoft_biomedclip-1711459586314 | microsoft_biomedclip-1711459586314 | Model Saved from Model Garden | +------------------------------------+------------------------------------+-------------------------------+ select name, display_name, d ->> 'endpoint' as endpoint, d ->> 'deployed_model_id' as deployed_model_id from gcp_vertex_ai_model, jsonb_array_elements(deployed_models) as d where d ->> 'endpoint' = 'projects/123456789/endpoints/123456789'; +------+--------------+----------+-------------------+ | name | display_name | endpoint | deployed_model_id | +------+--------------+----------+-------------------+ +------+--------------+----------+-------------------+ select name, display_name, d ->> 'endpoint' as endpoint, d ->> 'deployed_model_id' as deployed_model_id from gcp_vertex_ai_model, jsonb_array_elements(deployed_models) as d where d ->> 'endpoint' = 'projects/979620418102/locations/us-central1/endpoints/6870247828623458304'; +------------------------------------+------------------------------------+---------------------------------------------------------------------------+---------------------+ | name | display_name | endpoint | deployed_model_id | +------------------------------------+------------------------------------+---------------------------------------------------------------------------+---------------------+ | microsoft_biomedclip-1711459586314 | microsoft_biomedclip-1711459586314 | projects/979620418102/locations/us-central1/endpoints/6870247828623458304 | 6881410070668640256 | +------------------------------------+------------------------------------+---------------------------------------------------------------------------+---------------------+ select name, display_name, supported_input_storage_formats from gcp_vertex_ai_model where supported_input_storage_formats ? 'csv'; +------------------------------------+------------------------------------+---------------------------------------------------------------------+ | name | display_name | supported_input_storage_formats | +------------------------------------+------------------------------------+---------------------------------------------------------------------+ | microsoft_biomedclip-1711459586314 | microsoft_biomedclip-1711459586314 | ["jsonl","bigquery","csv","tf-record","tf-record-gzip","file-list"] | +------------------------------------+------------------------------------+---------------------------------------------------------------------+ select name, display_name, supported_input_storage_formats from gcp_vertex_ai_model where supported_input_storage_formats ? 'json'; +------+--------------+---------------------------------+ | name | display_name | supported_input_storage_formats | +------+--------------+---------------------------------+ +------+--------------+---------------------------------+ select * from gcp_vertex_ai_model where name = 'turbot' +------+------------+---------------------+---------------------+--------------+-------------+---------------------+---------------------+-------------------+--------------+--------------+-------------+-------------+------+-------------------+-----------------+--------> | name | version_id | version_create_time | version_update_time | display_name | description | version_description | metadata_schema_uri | training_pipeline | pipeline_job | artifact_uri | create_time | update_time | etag | metadata_artifact | version_aliases | predict> +------+------------+---------------------+---------------------+--------------+-------------+---------------------+---------------------+-------------------+--------------+--------------+-------------+-------------+------+-------------------+-----------------+--------> +------+------------+---------------------+---------------------+--------------+-------------+---------------------+---------------------+-------------------+--------------+--------------+-------------+-------------+------+-------------------+-----------------+--------> select * from gcp_vertex_ai_model where name = 'microsoft_biomedclip-1711459586314' +------------------------------------+------------+---------------------------+---------------------------+------------------------------------+-------------+---------------------+---------------------+-------------------+--------------+--------------+-----------------> | name | version_id | version_create_time | version_update_time | display_name | description | version_description | metadata_schema_uri | training_pipeline | pipeline_job | artifact_uri | create_time > +------------------------------------+------------+---------------------------+---------------------------+------------------------------------+-------------+---------------------+---------------------+-------------------+--------------+--------------+-----------------> | microsoft_biomedclip-1711459586314 | 1 | 2024-03-26T18:57:25+05:30 | 2024-03-26T18:59:16+05:30 | microsoft_biomedclip-1711459586314 | | | | | | | 2024-03-26T18:57> +------------------------------------+------------+---------------------------+---------------------------+------------------------------------+-------------+---------------------+---------------------+-------------------+--------------+--------------+----------------- ```
Priyanka-Chatterjee-2000 commented 6 months ago

No Integration test is added as no terraform resource supports it.