-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sql
67 lines (55 loc) · 1.84 KB
/
setup.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use role ACCOUNTADMIN;
create database DASH_DB;
create schema DASH_SCHEMA;
create warehouse DASH_WH_S WAREHOUSE_SIZE=SMALL;
use database DASH_DB;
use schema DASH_SCHEMA;
use warehouse DASH_WH_S;
create stage DASH_STAGE;
create image repository DASH_REPO;
create compute pool DASH_GPU3
min_nodes = 1
max_nodes = 2
instance_family = GPU_NV_S
auto_suspend_secs = 7200;
create stage llm_workspace encryption = (type = 'SNOWFLAKE_SSE');
create or replace hybrid table cell_towers_ca (
tower_id int unique primary key,
tower_name varchar(255),
lat float,
lon float,
status varchar(30),
status_message varchar(256),
last_comm datetime,
maintenance_due datetime
);
create or alter table images (
id int autoincrement,
site_name string,
city_name string,
file_name string,
lat float,
lon float,
image_bytes string
);
create role DASH_SPCS;
grant usage on database DASH_DB to role DASH_SPCS;
grant all on schema DASH_SCHEMA to role DASH_SPCS;
grant create service on schema DASH_SCHEMA to role DASH_SPCS;
grant usage on warehouse DASH_WH_S to role DASH_SPCS;
grant READ,WRITE on stage DASH_STAGE to role DASH_SPCS;
grant READ,WRITE on image repository DASH_REPO to role DASH_SPCS;
grant all on compute pool DASH_GPU3 to role DASH_SPCS;
grant bind service endpoint on account to role DASH_SPCS;
grant monitor usage on account to role DASH_SPCS;
grant READ,WRITE on stage llm_workspace to role DASH_SPCS;
grant all on table cell_towers_ca to role DASH_SPCS;
grant all on table images to role DASH_SPCS;
CREATE OR REPLACE NETWORK RULE allow_all_rule
TYPE = 'HOST_PORT'
MODE= 'EGRESS'
VALUE_LIST = ('0.0.0.0:443','0.0.0.0:80');
CREATE OR REPLACE EXTERNAL ACCESS INTEGRATION ALLOW_ALL_ACCESS_INTEGRATION
ALLOWED_NETWORK_RULES = (allow_all_rule)
ENABLED = true;
GRANT USAGE ON INTEGRATION ALLOW_ALL_ACCESS_INTEGRATION TO ROLE DASH_SPCS;