Skip to content

Commit 779abb2

Browse files
committed
init 3
1 parent 3da51e4 commit 779abb2

File tree

5 files changed

+41
-29
lines changed

5 files changed

+41
-29
lines changed

Dockerfile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
FROM openjdk:11-jre-slim
1+
FROM maven:3.6.3-openjdk-11 AS maven_build
2+
#COPY pom.xml /tmp/
3+
#COPY src /tmp/src/
4+
COPY * /tmp/
5+
WORKDIR /tmp/
6+
FROM openjdk
7+
EXPOSE 8080
8+
ARG JAR_FILE=target/*.jar
9+
COPY ${JAR_FILE} oracleai-0.0.1-SNAPSHOT.jar
10+
ENTRYPOINT ["java","-jar","/oracleai-0.0.1-SNAPSHOT.jar"]
11+
#ARG JAR_FILE=target/*.jar
12+
#COPY ${JAR_FILE} app.jar
13+
#ENTRYPOINT ["java","-jar","/app.jar"]
214

3-
ENTRYPOINT ["java", "-jar", "/usr/share/oracleai/oracleai.jar"]
415

5-
ADD target/oracleai-0.0.1-SNAPSHOT.jar /usr/share/oracleai/oracleai.jar
16+
17+
#FROM openjdk:11-jre-slim
18+
#
19+
#ENTRYPOINT ["java", "-jar", "/usr/share/oracleai/oracleai.jar"]
20+
#
21+
#ADD target/oracleai-0.0.1-SNAPSHOT.jar /usr/share/oracleai/oracleai.jar

build_and_run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
#source ~/Downloads/env.properties
44
source env.properties
55

6-
mvn clean package ; java -Djava.security.debug="access,failure" -jar target/oracleai-0.0.1-SNAPSHOT.jar
6+
mvn clean package ; java -jar target/oracleai-0.0.1-SNAPSHOT.jar

env.properties

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
#!/bin/bash
22

3-
## Add exports here... For example...
4-
#export COHERE_KEY="mykeyvalue"
5-
#export OPENAI_KEY="mykeyvalue"
6-
#export OCICONFIG_FILE=~/.oci/config
7-
#export OCICONFIG_PROFILE=DEFAULT
8-
#only set region to override the default found in OCI config, eg if using a feature only avaiable in a certain region
9-
#export REGION="US_CHICAGO_1"
10-
#export COMPARTMENT_ID="ocid1.compartment.oc1..mycompartmentvalue"
11-
#export OBJECTSTORAGE_NAMESPACE="myobjectstorenamespacename"
12-
#export OBJECTSTORAGE_BUCKETNAME="myobjectstorebucketname"
13-
#export ORDS_ENDPOINT_URL="myordsendpointurl"
14-
#export OCI_VISION_SERVICE_ENDPOINT="https://vision.aiservice.myregion.oci.oraclecloud.com"
15-
#export OCI_SPEECH_SERVICE_ENDPOINT="https://speech.aiservice.myregion.oci.oraclecloud.com"
16-
#export OCI_GENAI_SERVICE_ENDPOINT="https://genai.aiservice.us-chicago-1.oci.oraclecloud.com"
3+
## Add exports here...
4+
export OCICONFIG_FILE=~/.oci/config
5+
export OCICONFIG_PROFILE=DEFAULT
6+
export COMPARTMENT_ID="ocid1.compartment.oc1..mycompartmentvalue"
7+
export OBJECTSTORAGE_NAMESPACE="myobjectstorenamespacename"
8+
export OBJECTSTORAGE_BUCKETNAME="myobjectstorebucketname"
9+
export ORDS_ENDPOINT_URL="https://myordsendpointurl"
10+
export ORDS_ENDPOINT_URL="https://rddainsuh6u1okc-aidatabaseworkshop.adb.us-ashburn-1.oraclecloudapps.com/ords/aiuser/_sdw/"
11+
export OCI_VISION_SERVICE_ENDPOINT="https://vision.aiservice.myregion.oci.oraclecloud.com"
12+
export OCI_SPEECH_SERVICE_ENDPOINT="https://speech.aiservice.myregion.oci.oraclecloud.com"
13+
export OCI_GENAI_SERVICE_ENDPOINT="https://genai.aiservice.us-chicago-1.oci.oraclecloud.com"
14+
15+
export COHERE_KEY="mykeyvalue"
16+
export OPENAI_KEY="mykeyvalue"
1717

1818
## The following are only applicable when using Kubernetes...
1919
#export KUBECONFIG=~/.kube/config-mykubeconfig
2020
#export DOCKER_REGISTRY=us-myregion-1.ocir.io/myocirnamespacename/myocirfolder
21-

sql/aiuser-tables-indexes-functions.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
--run as aiuser
2-
31
CREATE TABLE aivision_results
42
(id RAW (16) NOT NULL,
53
date_loaded TIMESTAMP WITH TIME ZONE,
@@ -10,10 +8,12 @@ CREATE TABLE aivision_results
108
/
119

1210
create index aivisionresultsindex on aivision_results(textfromai) indextype is ctxsys.context;
11+
/
12+
1313
--select index_name, index_type, status from user_indexes where index_name = 'AIVISIONAIRESULTSINDEX';
1414
--select idx_name, idx_table, idx_text_name from ctx_user_indexes;
1515
--select token_text from dr$aivisionresultsindex$i;
16-
/
16+
1717

1818
CREATE OR REPLACE FUNCTION VISIONAI_RESULTS_TEXT_SEARCH(p_sql IN VARCHAR2) RETURN SYS_REFCURSOR AS refcursor SYS_REFCURSOR;
1919
BEGIN
@@ -50,10 +50,10 @@ dbms_cloud.create_credential (
5050
);
5151
END;
5252

53-
--The following two functions (text and object detection) are indentical
53+
--The following two functions (text and object detection) are identical
5454
--except for the json_table parsing for the textfromai field,
5555
--and so technically the p_featureType is not necessary and the function could be made to handle/parse both types,
56-
--however, for readability they are broken into two distinct functions
56+
--however, for readability they are broken into two distinct functions.
5757

5858

5959
CREATE OR REPLACE FUNCTION VISIONAI_TEXTDETECTION (

sql/create_aiuser.sql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
--run as admin
2-
31
CREATE USER aiuser identified BY [Yourpassword];
42
grant CREATE session TO aiuser;
5-
grant RESOURCE, db_developer_role TO aiuser;
3+
grant RESOURCE TO aiuser;
64
grant unlimited tablespace TO aiuser;
7-
grant EXECUTE ON javascript TO aiuser;
8-
grant EXECUTE dynamic mle TO aiuser;
95
grant execute on DBMS_CLOUD to aiuser;
6+

0 commit comments

Comments
 (0)