Skip to content

Commit 8eac16d

Browse files
lmfarley10JBAnderson5
authored andcommitted
More cleaning
1 parent 6470d19 commit 8eac16d

File tree

106 files changed

+3258
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3258
-261
lines changed

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,21 @@ __pycache__/
4949
*.pyd
5050
*.egg-info
5151

52-
# Images
52+
# Images (trusted & untrusted.png are required for client server)
53+
# vbcs app requires the excepted images as well
5354
*.png
55+
!clientApp/trusted.png
56+
!clientApp/untrusted.png
57+
!/vbcs_oda_archives/vbcs_apps/vbcs-askdata/webApps/nl2sqlbot/resources/images/*
58+
!nl2sql-main/vbcs_oda_archives/vbcs_apps/vbcs-askdata/webApps/nl2sqlbot/resources/images
59+
5460
*.jpeg
5561
*.jpg
62+
!/vbcs_oda_archives/vbcs_apps/vbcs-askdata/webApps/nl2sqlbot/resources/images/*
5663
*.gif
5764
*.webp
5865
*.ico
66+
!/vbcs_oda_archives/vbcs_apps/vbcs-askdata/webApps/nl2sqlbot/resources/images/*
5967

6068
*.docx
6169

@@ -66,6 +74,7 @@ __pycache__/
6674
*.xlsx
6775
*.zip
6876
/rest/nl2sql-trust/.coverage
77+
*.tgz
6978

7079
# WebSDK should be included in VBCS Applications
7180
/oda/websdk-apache-deploy/
@@ -179,8 +188,10 @@ mkdocs/docs/deployment/VBCS.md
179188
# devops sensitive info
180189
/rest/script/devops
181190

191+
/rest/script/docker/
182192
# docker artifactory info
183193
/rest/script/docker/artifacts/
194+
/rest/script/docker/artifacts/promote_apex.sh
184195

185196
# oracle instant client reference?
186197
/rest/script/docker/oracle-instantclient-23ai-ol8.repo
@@ -190,6 +201,7 @@ mkdocs/docs/deployment/VBCS.md
190201
/rest/script/docker/run_dev.sh
191202
/rest/script/docker/run.sh
192203

204+
/rest/script/docker_released/
193205
/rest/script/docker_released/artifacts
194206

195207
# another oracle instant client reference? Add link to public download instead?
@@ -202,6 +214,7 @@ mkdocs/docs/deployment/VBCS.md
202214

203215
# ubuntu image? Is this needed? Replace with olinux instead?
204216
/rest/script/dockerssh/Dockerfile
217+
/rest/script/dockerssh/
205218

206219
# Reference to google apis, twitter open source, do we need this?
207220
/rest/script/html_client/

README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,105 @@ Licensed under the Universal Permissive License (UPL), Version 1.0.
3939
See [LICENSE](LICENSE.txt) for more details.
4040

4141
ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK.
42+
## Deployment Steps
43+
44+
1. Deploy Terraform Script
45+
2. Configure Business App
46+
- Configure Business DB
47+
- Configure Trust DB
48+
3. Configure IDCS App
49+
4. Configure API Gateway
50+
5. Configure Trust App
51+
6. Configure ODA Skills
52+
7. Configure VB Apps
53+
54+
### TBD
55+
8. Deploy Trust Framework
56+
9. Deploy APEX
57+
58+
## Overview
59+
60+
I ran a dry deployment using the cleaned repo on our tenancy. Listed are some of my findings & outstanding questions.
61+
62+
- I was able to get the client business app deployed on our tenancy. A few things I noticed -
63+
- The code expects a llama model, at least for the on demand configuration
64+
- Would have to be refactored if using e.g. cohere on demand
65+
- The existing documentation suggests deploying api gateway on private subnet due to lack of authentication.
66+
- I was able to deploy the api gateway on public subnet with oauth2.0 authentication to idcs server and invoke from oda with token, so not sure why private subnet deployment for api gateway is suggested
67+
- The existing code expects api keys and wallets configured directly on the server, at least for the client business engine
68+
- Redis is required but no instructions given
69+
- There was no example data given for the vendors table, so I exported the table from the main deployment as a csv and imported to ours
70+
- Vendors table is for client business db
71+
- How do we want to provide this csv?
72+
- The business app is dependent on the trust db (trust library), i.e. the trusted prompts, which isn't intuitive
73+
- The code expects the TRUST_LIBRARY table to have at least one entry, otherwise it bombs
74+
- I provided a sample entry in the sql file
75+
The sql for the client business db is outside the clientapp directory, & there are no instructions given on which db to upload to (upload to business db)
76+
77+
The business app is exposed on an API Gateway with the main entry /prompt, which maps to <business-app-ip>:8000... this will be used by ODA app.
78+
79+
There are a handful of files required and provided within the repo, but no instructions on how/when to use them.
80+
Examples include :
81+
1. Under sql, nl2sql_datamodel_schema.sql needds to be ran in the trust database
82+
- Was able to run the client engine without the sql/sample_setup_ras.sql file.
83+
- This is a prequisite to run the business client engine, which isn't intuitive
84+
2. Within the rest (trust) directory there are docker files... I think we can remove these?
85+
- Haven't tested full trust deployment yet.
86+
87+
Some files I don't think are necessary at all
88+
1. autoprompt
89+
2. mkdocs... this is documentation we can perhaps repurpose (at least the md files)
90+
91+
Below are the various requirements and findings from deploying the infrastructure components on our tenancy -
92+
93+
### ODA
94+
95+
1. Configure IDCS Server first
96+
- ODA skill expects a token to execute
97+
- Configured manually for now. Expects ODA client callback to work
98+
2. Configured API gateway with nl2sql engine backend - provide api gateway endpoint in skill
99+
- Configured bearer token with IDCS app
100+
3. There are two skill zips that don't seem to be used and not referenced in the documentation -
101+
- oda-skill-EmbeddedCont.changeit.zip
102+
- oda-skill-ExtOracleFn.changeit.zip
103+
104+
### VBCS
105+
106+
1. The zipped askdata vbcs app in here looks to be outdated.
107+
- It's a more simple implementation, which might be best for now
108+
2. Reference to websocket - to be deprecated? Need to test if working without
109+
- Tested, seems to be unnecessary
110+
3. App import relies on various images in the directory... do we want to provide these images in the repo?
111+
- I'm going to include them for now, since they are dependencies
112+
113+
### API Gateway
114+
1. API Gateway is configured with Single Authentication OAuth2.0 which requires a vault.
115+
2. The existing mkdocs documentation said to deploy the api gateway to private subnet due to lack of authentication... authentication can be added to api gateway on public subnet
116+
117+
### Redis
118+
1. Redis is required but there were no instructions given on configuration
119+
120+
### Generative AI
121+
1. Existing deployment was using dedicated ai cluster/data science. I was able to get it to work with on demand model.
122+
- Code is hard coded to handle only the llama models. Cohere models would require refactoring.
123+
124+
### NL2SQL Business Engine
125+
1. The code is currently expecting the user to upload their own api keys
126+
2. Database wallets need to be uploaded manually
127+
3. png files trusted & untrusted.png are required to run the server.
128+
4. autoprompt - need to test if working without (deprecated?)
129+
130+
### Client Database
131+
1. The vendors table didn't have any example data. I had to export the table from the existing implementation and import as csv
132+
- Do we want to include this csv in the repo, or add to object storage bucket and provide link?
133+
134+
### Trust Database
135+
1. Engine code expects at least one entry in Trust library table before execution
136+
- Provided an example entry with sample embedding
137+
138+
### Trust REST Framework
139+
Haven't gotten this far, but the basic prompt endpoint does use the trust library table.
140+
141+
## APEX
142+
tbd ... do we want to include this in the first version?
143+

clientApp/ConfigFile.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,18 @@ max.resultset=50
3434
filter.upn=notused
3535
filter.ignoreupntablelist=notused
3636
[vbcs]
37+
# endpoint url should be the root e.g. endpoint.url=https://<your-vb>.oraclecloud.com/ic/builder/rt/
3738
endpoint.url=<vbcs-endpoint-url>
39+
# graph url should be relative to endpoint url e.g. <your-graph-app>/1.0/webApps/nl2sql_interactivegraph/
3840
graph_app.url=<graph-app-url>
41+
# table graph should also be relative
3942
idata_app.url=<table-graph-url>
4043
[OCI]
4144
#Sao Paulo
4245
#serviceendpoint.url=https://inference.generativeai.sa-saopaulo-1.oci.oraclecloud.com
4346
#Scenario2
4447
# DAC or DS or GAI
45-
serviceendpoint.active=DS
48+
serviceendpoint.active=GAI
4649
serviceendpoint.ds_endpt=<service-endpoint-url>
4750
serviceendpoint.ds_model=<service-endpoint-ds-model>
4851
serviceendpoint.url=https://inference.generativeai.us-chicago-1.oci.oraclecloud.com

clientApp/helper_methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
config = configparser.RawConfigParser()
1919
config.read('ConfigFile.properties')
2020

21-
rediscache = redis.StrictRedis(host=config.get('RedisSection', 'url'), charset='utf-8', ssl=True, decode_responses=True, port=config.get('RedisSection', 'port'))
22-
rediscache_obj = redis.StrictRedis(host=config.get('RedisSection', 'url'), charset='utf-8', ssl=True, decode_responses=False, port=config.get('RedisSection', 'port'))
21+
rediscache = redis.StrictRedis(host=config.get('RedisSection', 'url'), ssl=True, decode_responses=True, port=config.get('RedisSection', 'port'))
22+
rediscache_obj = redis.StrictRedis(host=config.get('RedisSection', 'url'), ssl=True, decode_responses=False, port=config.get('RedisSection', 'port'))
2323
queryttl=2*24*60*60
2424

2525
def setup_logger(log_file_name='application.log'):

clientApp/trusted.png

2.51 KB
Loading

clientApp/untrusted.png

2.13 KB
Loading

data/demodata.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,6 +2997,7 @@ Insert into ACCOUNT_PAYABLES_TBL (VENDOR_NAME,VENDOR_NUMBER,VENDOR_SITE_DETAILS
29972997
Insert into ACCOUNT_PAYABLES_TBL (VENDOR_NAME,VENDOR_NUMBER,VENDOR_SITE_DETAILS,INVOICE_NUMBER,INVOICE_DATE,GL_DATE,INVOICE_TYPE,DUE_DATE,PAST_DUE_DAYS,AMOUNT_DUE) values ('GE Capital',1001,'MILANO ERS Milano','ERS-7048-212135',to_date('01-SEP-23','DD-MON-RR'),to_date('06-SEP-23','DD-MON-RR'),'STANDARD',to_date('04-SEP-23','DD-MON-RR'),255,7928.64);
29982998
Insert into ACCOUNT_PAYABLES_TBL (VENDOR_NAME,VENDOR_NUMBER,VENDOR_SITE_DETAILS,INVOICE_NUMBER,INVOICE_DATE,GL_DATE,INVOICE_TYPE,DUE_DATE,PAST_DUE_DAYS,AMOUNT_DUE) values ('GE Capital',1001,'MILANO ERS Milano','ERS-7057-212300',to_date('01-SEP-23','DD-MON-RR'),to_date('07-SEP-23','DD-MON-RR'),'STANDARD',to_date('04-SEP-23','DD-MON-RR'),255,7928.64);
29992999
Insert into ACCOUNT_PAYABLES_TBL (VENDOR_NAME,VENDOR_NUMBER,VENDOR_SITE_DETAILS,INVOICE_NUMBER,INVOICE_DATE,GL_DATE,INVOICE_TYPE,DUE_DATE,PAST_DUE_DAYS,AMOUNT_DUE) values ('Advanced Network Devices',1013,'MILANO ERS Milano','ERS-7041-212016',to_date('01-SEP-23','DD-MON-RR'),to_date('05-SEP-23','DD-MON-RR'),'STANDARD',to_date('04-SEP-23','DD-MON-RR'),255,21960.29);
3000+
commit;
30003001
Insert into ACCOUNT_PAYABLES_TBL (VENDOR_NAME,VENDOR_NUMBER,VENDOR_SITE_DETAILS,INVOICE_NUMBER,INVOICE_DATE,GL_DATE,INVOICE_TYPE,DUE_DATE,PAST_DUE_DAYS,AMOUNT_DUE) values ('Advanced Network Devices',1013,'MILANO ERS Milano','ERS-7058-212383',to_date('01-SEP-23','DD-MON-RR'),to_date('08-SEP-23','DD-MON-RR'),'STANDARD',to_date('04-SEP-23','DD-MON-RR'),255,21960.29);
30013002
Insert into ACCOUNT_PAYABLES_TBL (VENDOR_NAME,VENDOR_NUMBER,VENDOR_SITE_DETAILS,INVOICE_NUMBER,INVOICE_DATE,GL_DATE,INVOICE_TYPE,DUE_DATE,PAST_DUE_DAYS,AMOUNT_DUE) values ('GE Capital',1001,'MILANO ERS Milano','ERS-7033-211643',to_date('26-AUG-23','DD-MON-RR'),to_date('29-AUG-23','DD-MON-RR'),'STANDARD',to_date('29-AUG-23','DD-MON-RR'),261,3567.89);
30023003
Insert into ACCOUNT_PAYABLES_TBL (VENDOR_NAME,VENDOR_NUMBER,VENDOR_SITE_DETAILS,INVOICE_NUMBER,INVOICE_DATE,GL_DATE,INVOICE_TYPE,DUE_DATE,PAST_DUE_DAYS,AMOUNT_DUE) values ('GE Capital',1001,'MILANO ERS Milano','ERS-7033-211642',to_date('25-AUG-23','DD-MON-RR'),to_date('29-AUG-23','DD-MON-RR'),'STANDARD',to_date('28-AUG-23','DD-MON-RR'),262,8675.79);

sql/nl2sql_datamodel_schema.sql

Lines changed: 46 additions & 14 deletions
Large diffs are not rendered by default.

sql/sample_setup_ras.sql

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
As admin user
22

3-
create user app_data identified by H0tsummer2025
3+
create user app_data identified by <password>
44
default tablespace data;
55

66
grant connect, resource to app_data;
77
alter user app_data quota unlimited on data;
88

99
drop user ras_admin cascade;
10-
create user ras_admin identified by H0tsummer#2025
10+
create user ras_admin identified by <password>
1111
default tablespace data;
1212
grant connect, resource to ras_admin;
1313
alter user ras_admin quota unlimited on data;
@@ -57,20 +57,20 @@ grant nl2sql_role to inv_type_redact_role;
5757

5858
SELECT STANDARD_HASH('test', 'SHA256') FROM dual;
5959

60-
exec sys.xs_principal.create_user(name => 'rajarora', schema => 'app_data');
61-
exec sys.xs_principal.set_password('rajarora', 'G0ingtothest#rs');
62-
exec sys.xs_principal.grant_roles('rajarora', 'XSCONNECT');
63-
exec sys.xs_principal.grant_roles('rajarora', 'superuser_app_role');
60+
exec sys.xs_principal.create_user(name => '<user>', schema => 'app_data');
61+
exec sys.xs_principal.set_password('<user>', '<password>');
62+
exec sys.xs_principal.grant_roles('<user>', 'XSCONNECT');
63+
exec sys.xs_principal.grant_roles('<user>', 'superuser_app_role');
6464

65-
exec sys.xs_principal.create_user(name => 'rajarora1', schema => 'app_data');
66-
exec sys.xs_principal.set_password('rajarora1', 'G0ingtothest#rs');
67-
exec sys.xs_principal.grant_roles('rajarora1', 'XSCONNECT');
68-
exec sys.xs_principal.grant_roles('rajarora1', 'inv_type_redact_role');
65+
exec sys.xs_principal.create_user(name => '<user2>', schema => 'app_data');
66+
exec sys.xs_principal.set_password('<user2>', '<password-user-2>');
67+
exec sys.xs_principal.grant_roles('<user2>', 'XSCONNECT');
68+
exec sys.xs_principal.grant_roles('<user2>', 'inv_type_redact_role');
6969

70-
exec sys.xs_principal.create_user(name => 'rajarora2', schema => 'app_data');
71-
exec sys.xs_principal.set_password('rajarora2', 'G0ingtothest#rs');
72-
exec sys.xs_principal.grant_roles('rajarora2', 'XSCONNECT');
73-
exec sys.xs_principal.grant_roles('rajarora2', 'inv_type_limited_role');
70+
exec sys.xs_principal.create_user(name => '<user3>', schema => 'app_data');
71+
exec sys.xs_principal.set_password('<user3>', '<password-user-3>');
72+
exec sys.xs_principal.grant_roles('<user3>', 'XSCONNECT');
73+
exec sys.xs_principal.grant_roles('<user3>', 'inv_type_limited_role');
7474

7575

7676

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"type" : "USER",
3+
"autoCompleteTrainingStatus" : "NO_DATA",
4+
"category" : "null",
5+
"description" : "calls Rest EP-MVP1(from v5g - APIGW(.252), auth, group, domain, odaclarify, EH+, FBFmtd, CC, dm_spc)",
6+
"dialogVersion" : "2.0",
7+
"displayName" : "callGenAiSQLEndPointv5h",
8+
"intentTrainer" : "Sakura",
9+
"multilingualMode" : "NATIVE",
10+
"name" : "callGenAiSQLEndPointv5h",
11+
"platformVersion" : "25.04",
12+
"primaryLanguageTag" : "en",
13+
"requiresAutoCompleteTraining" : false,
14+
"trackingId" : "F59CDEF3-58DE-4895-B72F-824DE1EF2EDC",
15+
"version" : "1.0"
16+
}

0 commit comments

Comments
 (0)