Skip to content

Commit 5ef6106

Browse files
committed
init 3
1 parent 779abb2 commit 5ef6106

File tree

10 files changed

+72
-73
lines changed

10 files changed

+72
-73
lines changed

Dockerfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
FROM maven:3.6.3-openjdk-11 AS maven_build
2-
#COPY pom.xml /tmp/
3-
#COPY src /tmp/src/
4-
COPY * /tmp/
2+
COPY pom.xml /tmp/pom.xml
3+
COPY env.properties /tmp/env.properties
4+
COPY src /tmp/src
5+
COPY lib /tmp/lib
6+
COPY lib/oci-java-sdk-generativeai-3.25.1-preview1-20230906.204234-1.jar /tmp/lib/oci-java-sdk-generativeai-3.25.1-preview1-20230906.204234-1.jar
57
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"]
148

9+
RUN mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=/tmp/lib/oci-java-sdk-generativeai-3.25.1-preview1-20230906.204234-1.jar
10+
RUN mvn -f /tmp/pom.xml clean package
1511

12+
FROM openjdk
13+
EXPOSE 8080
1614

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
15+
CMD ls /tmp
16+
COPY --from=maven_build /tmp/target/oracleai-0.0.1-SNAPSHOT.jar /app/oracleai-0.0.1-SNAPSHOT.jar
17+
ENTRYPOINT ["java","-jar","/app/oracleai-0.0.1-SNAPSHOT.jar"]

build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22

3-
source env.properties
4-
53
#The following is temporary until release is available in maven and only required to be called once...
64
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=lib/oci-java-sdk-generativeai-3.25.1-preview1-20230906.204234-1.jar
75
mvn clean package

build_and_push.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

build_and_run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

33
#source ~/Downloads/env.properties
4-
source env.properties
4+
export `cat env.properties`
55

66
mvn clean package ; java -jar target/oracleai-0.0.1-SNAPSHOT.jar

build_docker.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
export IMAGE_NAME=oracleai
4+
export IMAGE_VERSION=0.1
5+
6+
7+
if [ -z "$DOCKER_REGISTRY" ]; then
8+
echo "DOCKER_REGISTRY not set. Will set it to 'test"
9+
export DOCKER_REGISTRY=test
10+
fi
11+
12+
export IMAGE=${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_VERSION}
13+
14+
docker build -t=$IMAGE .
15+
16+
#docker push "$IMAGE"
17+
#if [ $? -eq 0 ]; then
18+
# docker rmi "$IMAGE"
19+
#fi
20+

env.properties

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
#!/bin/bash
2-
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"
17-
18-
## The following are only applicable when using Kubernetes...
19-
#export KUBECONFIG=~/.kube/config-mykubeconfig
20-
#export DOCKER_REGISTRY=us-myregion-1.ocir.io/myocirnamespacename/myocirfolder
1+
OCICONFIG_FILE=~/.oci/config
2+
OCICONFIG_PROFILE=DEFAULT
3+
COMPARTMENT_ID="ocid1.compartment.oc1..mycompartmentvalue"
4+
OBJECTSTORAGE_NAMESPACE="myobjectstorenamespacename"
5+
OBJECTSTORAGE_BUCKETNAME="myobjectstorebucketname"
6+
ORDS_ENDPOINT_URL="https://myordsendpointurl"
7+
ORDS_ENDPOINT_URL="https://rddainsuh6u1okc-aidatabaseworkshop.adb.us-ashburn-1.oraclecloudapps.com/ords/aiuser/_sdw/"
8+
OCI_VISION_SERVICE_ENDPOINT="https://vision.aiservice.myregion.oci.oraclecloud.com"
9+
OCI_SPEECH_SERVICE_ENDPOINT="https://speech.aiservice.myregion.oci.oraclecloud.com"
10+
OCI_GENAI_SERVICE_ENDPOINT="https://genai.aiservice.us-chicago-1.oci.oraclecloud.com"

pom.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
<spring.boot.version>2.7.6</spring.boot.version>
2121
<spring.vault.version>3.1.1</spring.vault.version>
2222
<oci.sdk.version>3.29.0</oci.sdk.version>
23-
24-
2523
<jib-maven-plugin.version>3.3.1</jib-maven-plugin.version>
2624
<liquibase.version>4.17.2</liquibase.version>
2725
<docker.registry>${env.DOCKER_REGISTRY}</docker.registry>
@@ -176,19 +174,14 @@
176174
</dependencyManagement>
177175
<build>
178176
<plugins>
179-
<plugin>
180-
<groupId>org.springframework.boot</groupId>
181-
<artifactId>spring-boot-maven-plugin</artifactId>
182-
</plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>9</source><target>9</target></configuration></plugin>
183-
184177
<plugin>
185178
<groupId>org.springframework.boot</groupId>
186179
<artifactId>spring-boot-maven-plugin</artifactId>
187180
</plugin>
188181
<plugin>
189182
<groupId>org.apache.maven.plugins</groupId>
190183
<artifactId>maven-compiler-plugin</artifactId>
191-
<configuration><source>8</source><target>8</target></configuration>
184+
<configuration><source>11</source><target>11</target></configuration>
192185
</plugin>
193186

194187
</plugins>

run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
source env.properties
3+
export `cat env.properties`
44

5-
mvn clean package ; java -jar target/oracleai-0.0.1-SNAPSHOT.jar
5+
java -jar target/oracleai-0.0.1-SNAPSHOT.jar

run_docker.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
source env.properties
4+
5+
export IMAGE_NAME=oracleai
6+
export IMAGE_VERSION=0.1
7+
8+
9+
if [ -z "$DOCKER_REGISTRY" ]; then
10+
echo "DOCKER_REGISTRY not set. Will set it to 'test"
11+
export DOCKER_REGISTRY=test
12+
fi
13+
14+
export IMAGE=${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_VERSION}
15+
16+
docker run --env-file env.properties -p 127.0.0.1:8080:8080/tcp $IMAGE
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
OCICONFIG_FILE=~/.oci/config
2+
OCICONFIG_PROFILE=DEFAULT
3+
COMPARTMENT_ID="ocid1.compartment.oc1..mycompartmentvalue"
4+
OBJECTSTORAGE_NAMESPACE="myobjectstorenamespacename"
5+
OBJECTSTORAGE_BUCKETNAME="myobjectstorebucketname"
6+
ORDS_ENDPOINT_URL="https://myordsendpointurl"
7+
ORDS_ENDPOINT_URL="https://rddainsuh6u1okc-aidatabaseworkshop.adb.us-ashburn-1.oraclecloudapps.com/ords/aiuser/_sdw/"
8+
OCI_VISION_SERVICE_ENDPOINT="https://vision.aiservice.myregion.oci.oraclecloud.com"
9+
OCI_SPEECH_SERVICE_ENDPOINT="https://speech.aiservice.myregion.oci.oraclecloud.com"
10+
OCI_GENAI_SERVICE_ENDPOINT="https://genai.aiservice.us-chicago-1.oci.oraclecloud.com"

0 commit comments

Comments
 (0)