Initial installation and configuration

Base Model Application

This document provides instructions on how to start the Base Model application, grant necessary access, view job logs, and access the UI. Follow the steps below to ensure proper setup and configuration.

For BaseModel Product documentation, please follow this link.

Getting Started

To get started, navigate to"Data Products" > "Apps" > <app_name>. In the "Grant Account Privileges" section, click Grant to assign account privileges. Then, in the "Allow Connections" section, click Review to review the connection details and confirm by selecting Connect.

You can now activate the application by clicking the Activate button. This process will set up all necessary compute pools, warehouses, and other resources, which may take some time to complete.

(Optional) To grant access to the application for additional roles use Manage Access button

You’re all set! You can now click the Launch App button to start using the application. However, to enable all the features of our application, please follow the steps outlined below.

Granting Data Access

Provide access to the necessary databases, schemas, and tables for the application to function properly.

πŸ“˜

Note

This action needs to be repeated anytime the user is adding additional databases, schemas and tables.

Granting Usage on Database:

For each required database <db_name>:

GRANT USAGE ON DATABASE <db_name> TO APPLICATION <app_name>;

Granting Usage on Schema:

For each required schema <schema_name> in <db_name>:

GRANT USAGE ON SCHEMA <db_name>.<schema_name> TO APPLICATION <app_name>;

Granting Select on Table:

For each required table <table_name> in <db_name>.<schema_name>:

GRANT SELECT ON TABLE <db_name>.<schema_name>.<table_name> TO APPLICATION <app_name>;

Accessing Job Logs & Telemetry configuration

To configure necessary telemetry and logs tables.

1. Create an Intermediate View

Create an intermediate view. By default, the event table is located in SNOWFLAKE.TELEMETRY.EVENTS.

CREATE VIEW IF NOT EXISTS <any_db>.<any_schema>.<any_table> AS
SELECT *
FROM <your_event_table>
WHERE RESOURCE_ATTRIBUTES['snow.compute_pool.name'] = 'BASE_MODEL_TRAINING_COMPUTE_POOL';

2. Grant Privileges to the Intermediate View

Grant the necessary privileges to the intermediate view.

GRANT USAGE ON DATABASE <any_db> TO APPLICATION <app_name>;
GRANT USAGE ON SCHEMA <any_db>.<any_schema> TO APPLICATION <app_name>;
GRANT SELECT ON TABLE <any_db>.<any_schema>.<any_table> TO APPLICATION <app_name>;

πŸ“˜

Note

You need to grant the privileges to the view that you have created in the previous step. For example, if you have created view named DB.SCHEMA.BASEMODEL_TELEMETRY you need to use the same name here when granting privileges.

3. Registering the Event Table

Once the privileges are set, switch schema to <app_name>.APP_PUBLIC and register the event table:

CALL app_public.register_event_table('<any_db>.<any_schema>.<any_table>');

Setup backup stage for configuration backups (optional)

This can be done at any point

CREATE DATABASE BASEMODEL_BACKUP_DB;
CREATE SCHEMA BASEMODEL_BACKUP_DB.BACKUP;
CREATE STAGE BASEMODEL_BACKUP_DB.BACKUP.BACKUP;
GRANT USAGE ON DATABASE BASEMODEL_BACKUP_DB TO APPLICATION <app_name>;
GRANT USAGE ON SCHEMA BASEMODEL_BACKUP_DB.BACKUP TO APPLICATION <app_name>;
GRANT READ, WRITE ON STAGE BASEMODEL_BACKUP_DB.BACKUP.BACKUP TO APPLICATION <app_name>;

Setup output table for the predictions

To enable saving the predictions to output table:

GRANT USAGE ON DATABASE <any_db> TO APPLICATION <app_name>;
CREATE SCHEMA <any_db>.<any_schema>.;
GRANT USAGE, CREATE TABLE ON SCHEMA <any_db>.<any_schema> TO APPLICATION <app_name>;

πŸ“˜

Note

The instructions above enable the application to create an output table with ownership of the table granted to the application. Users do not have any permissions to perform operations on the output_table. However, the schema owner maintains the ability to:

  • Grant necessary privileges (e.g., SELECT).
  • Assign privileges to other roles as required.

These permissions are crucial for enabling interactions with the table - meaning that each role that will be viewing the output tables needs to have correct privilege setup to the output table