Skip to content

Commit 26cc457

Browse files
authored
Merge branch 'main' into jbj980125
2 parents 9d052c0 + 80527d5 commit 26cc457

File tree

29 files changed

+215
-290
lines changed

29 files changed

+215
-290
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
streamlit==1.33.0
1+
streamlit==1.37.0
22
oci==3.50.1
33
Pillow
44
opencv-python-headless==4.10.0.84
5-
tqdm==4.66.1
5+
tqdm==4.66.3

ai/generative-ai-service/rag-genai/files/LangChainRAG.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from langchain_core.prompts import PromptTemplate
55
from langchain_community.llms import OCIGenAI
66
from langchain_community.document_loaders import UnstructuredURLLoader
7-
compartment_id = "ocid1.compartment.oc1..aaaaaaaa7ggqkd4ptkeb7ugk6ipsl3gqjofhkr6yacluwj4fitf2ufrdm65q"
7+
compartment_id = "<compartment ID>"
88
embeddings = OCIGenAIEmbeddings(model_id="cohere.embed-english-light-v3.0",service_endpoint="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com",compartment_id= compartment_id,)
99
testurls = ['https://docs.oracle.com/iaas/odsaz/odsa-rotate-wallet.html', 'https://docs.oracle.com/iaas/odsaz/odsa-change-password.html', 'https://docs.oracle.com/iaas/odsaz/odsa-database-actions.html']
1010
loader = UnstructuredURLLoader(urls=testurls)

app-dev/devops-and-containers/functions/java-helloworld-AI-with-local-dev-and-oci-functions/README.md

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ IAM user option will work on both cases above, as local and as OCI Function.
6464

6565
## Build and test
6666

67-
During following the steps of the <a href="../java-helloworld-with-local-dev-and-oci-functions">Hello function example </a> adjust the <a href="https://github.com/oracle-devrel/technology-engineering/blob/main/app-dev/devops-and-containers/functions/java-helloworld-AI-with-local-dev-and-oci-functions/files/src/main/java/com/example/HelloAIFunction.java#L93">line 93</a> to match your <code>GenAI service OCID</code>.
67+
During following the steps of the <a href="../java-helloworld-with-local-dev-and-oci-functions">Hello function example </a> adjust the <a href="https://github.com/oracle-devrel/technology-engineering/blob/main/app-dev/devops-and-containers/functions/java-helloworld-AI-with-local-dev-and-oci-functions/files/src/main/java/com/example/HelloAIFunction.java#L131">line 131</a> to match your <code>GenAI service model OCID</code>.
6868

6969
<p>
7070

@@ -74,21 +74,56 @@ Testing with curl (or copy-pasting the API Gateway deployment url to a browser):
7474

7575
<pre>
7676
curl https://n3yu.....ghhi.apigateway.eu-frankfurt-1.oci.customer-oci.com/
77-
What happened today 06/13/2024 100 years ago ?
7877

79-
June 13, 2024 is June 13, 1924. Here are some events that occurred on this date:
78+
What happened today 01/17/2025 100 years ago ?
79+
On January 17th, 1925, 100 years ago, the following events took place:
80+
- In the US, President Calvin Coolidge delivered his annual State of the Union address to Congress. He discussed the thriving state of the national economy, emphasizing the record-high production of American industries and the growth of the country's merchant marine fleet. Coolidge also urged Congress to pass legislation facilitating world trade and improving diplomatic relations.
81+
- The first Winter Sports Week was held in Chamonix, France. This event eventually evolved into the prestigious Chamonix International Festival of Sports and Cinema.
82+
- The play "The New York Idea" by Langdon Mitchell premiered at the Ambassador Theatre on Broadway. It ran for 144 performances and received critical acclaim.
83+
- The silent film "The Gold Rush" directed by Charlie Chaplin was released in the United States. It's a classic comedy that tells the story of a prospector during the Klondike Gold Rush. Chaplin's unique brand of physical comedy and the film's innovative effects delighted audiences.
84+
- In Germany, the Weimar Republic experienced a political scandal known as the "German-Russian Trade and Credit Agreement." The agreement, which granted Germany a loan of 300 million marks from Russia, was signed secretly, leading to accusations of mismanagement and lack of transparency in the government. This incident further destabilized the already fragile Weimar Republic.
85+
</pre>
8086

81-
1. The German airline Deutsche Lufthansa (DL) was officially founded on June 13, 1924. It is Germany's largest airline and is one of the world's largest airlines in terms of overall passengers carried.
82-
83-
2. The British Broadcasting Corporation (BBC) aired its first radio broadcast.
87+
# Native image using GraalVM
88+
89+
GraalVM compiles your Java functions ahead of time into standalone binaries that start instantly, provide peak performance with no warmup, and use fewer resources. The key GraalVM benefits are: Low Resource Usage: Java applications compiled ahead-of-time by GraalVM require less memory and CPU to run.
90+
91+
<p>
92+
93+
To do this a Docker multi-stage build is used.
94+
95+
<p>
96+
97+
Before building the native image let's do a full maven build for the project to create the necessary libraries under <code>target/lib</code>:
98+
99+
<pre>
100+
mvn clean install
101+
</pre>
84102

85-
3. The Hollywood Sign was officially dedicated in California, marking the beginning of Hollywood's rise to prominence in the American film industry.
103+
Then build the Docker container using <a href="./files/Dockerfile.native">multi-stage Docker file</a> including the GraalVM native image compilation:
86104

87-
4. The Ford Motor Company introduced the firstassembly line to mass produce cars, making cars more accessible to the general public.
105+
<pre>
106+
docker build -f Dockerfile.native -t fra.ocir.io/&lt;YOUR OCI TENANCY NAMESPACE&gt;/helloworldai-java:2 .
107+
</pre>
108+
109+
The GraalVM compilation stage requires quite a bit resources from your localhost so in case for example using Rancher desktop
110+
think of increasing the CPU and memory for it to make the build faster.
111+
112+
<p>
113+
114+
In the <a href="./files/Dockerfile.native">Dockerfile.native</a> two things are important: Including the <a href="./files/reflection.json">reflection.json</a> with the proper function class name and passing Fn FDK libraries with <code>"-Djava.library.path=/lib"</code> in the container CMD along with the <code>"com.example.HelloAIFunction::handleRequest"</code> function handler.
88115

89-
5. The German aerospace company Zeppelin began constructing the Hindenburg, a large passenger airship.
116+
<p>
117+
118+
After the build push the container to OCIR repo:
119+
120+
<pre>
121+
docker push fra.ocir.io/&lt;YOUR OCI TENANCY NAMESPACE&gt;/helloworldai-java:2
90122
</pre>
91123

124+
Finally deploy the container to your OCI Function by replacing the container using the Cloud UI by editing the function and changing the container from <code>helloworldai-java:1</code> to <code>helloworldai-java:2</code>. Then test it.
125+
126+
92127
# Useful Links
93128

94129
- [OCI Functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm)
@@ -99,6 +134,8 @@ June 13, 2024 is June 13, 1924. Here are some events that occurred on this date:
99134
- The Fn project is an open-source container-native serverless platform that you can run anywhere -- any cloud or on-premise. It’s easy to use, supports every programming language, and is extensible and performant
100135
- [OCI GenAI](https://www.oracle.com/artificial-intelligence/generative-ai/generative-ai-service/)
101136
- Discover the power of generative AI models equipped with advanced language comprehension for building the next generation of enterprise applications. Oracle Cloud Infrastructure (OCI) Generative AI is a fully managed service for seamlessly integrating these versatile language models into a wide range of use cases, including writing assistance, summarization, analysis, and chat
137+
- [OCI Functions with GraalVM](https://github.com/shaunsmith/graalvm-fn-init-images)
138+
- Discover GraalVM Native Image -based functions with this example GitHub repo
102139
- [Oracle](https://www.oracle.com/)
103140
- Oracle Website
104141

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM container-registry.oracle.com/graalvm/native-image:23-ol8 AS native
2+
WORKDIR /app
3+
4+
COPY target .
5+
ADD reflection.json .
6+
7+
RUN native-image \
8+
-H:ReflectionConfigurationFiles=/app/reflection.json \
9+
-Ob \
10+
-H:Name=Hello \
11+
-cp "/app/Helloaifunc-1.0-SNAPSHOT.jar:/app/lib/*" \
12+
com.fnproject.fn.runtime.EntryPoint
13+
14+
FROM fnproject/fn-java-fdk:jre17-1.0.198 as fdk
15+
16+
FROM container-registry.oracle.com/os/oraclelinux:8-slim
17+
COPY --from=native /app/Hello .
18+
COPY --from=fdk /function/runtime/* .
19+
ENTRYPOINT [ "./Hello" ]
20+
CMD [ "com.example.HelloAIFunction::handleRequest", "-Djava.library.path=/lib"]

app-dev/devops-and-containers/functions/java-helloworld-AI-with-local-dev-and-oci-functions/files/pom.xml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@
88
<artifactId>Helloaifunc</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11+
<build>
12+
<plugins>
13+
<plugin>
14+
<!-- Copy dependencies -->
15+
<artifactId>maven-dependency-plugin</artifactId>
16+
<executions>
17+
<execution>
18+
<phase>install</phase>
19+
<goals>
20+
<goal>copy-dependencies</goal>
21+
</goals>
22+
<configuration>
23+
<outputDirectory>${project.build.directory}/lib</outputDirectory>
24+
</configuration>
25+
</execution>
26+
</executions>
27+
</plugin>
28+
</plugins>
29+
</build>
30+
1131
<properties>
1232
<maven.compiler.source>17</maven.compiler.source>
1333
<maven.compiler.target>17</maven.compiler.target>
@@ -33,7 +53,7 @@
3353
<dependency>
3454
<groupId>junit</groupId>
3555
<artifactId>junit</artifactId>
36-
<version>4.13.1</version>
56+
<version>4.12</version>
3757
<scope>test</scope>
3858
</dependency>
3959
<dependency>
@@ -67,6 +87,11 @@
6787
<scope>runtime</scope>
6888
<version>3.37.2</version>
6989
</dependency>
90+
<dependency>
91+
<groupId>org.bouncycastle</groupId>
92+
<artifactId>bcprov-jdk18on</artifactId>
93+
<version>1.79</version>
94+
</dependency>
7095
</dependencies>
7196

7297
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"name": "com.example.HelloAIFunction",
4+
"allDeclaredMethods": true,
5+
"methods": [
6+
{ "name": "<init>", "parameterTypes": [] }
7+
]
8+
}
9+
]
10+

app-dev/devops-and-containers/functions/java-helloworld-AI-with-local-dev-and-oci-functions/files/src/main/java/com/example/HelloAIFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on
7070
public class HelloAIFunction {
7171

7272
// FILL IN PROPER VALUES FOR OCI GENAI SERVICE
73-
private static final String ENDPOINT = "https://inference.generativeai.us-chicago-1.oci.oraclecloud.com";
73+
private static final String ENDPOINT = "https://inference.generativeai.eu-frankfurt-1.oci.oraclecloud.com";
7474
private static final Region REGION = Region.EU_FRANKFURT_1;
7575

7676
// FILL IN PROPER VALUES FOR IAM USER WHEN NOT USING INSTANCE_PRINCIPAL IN OCI FUNCTION

app-dev/devops-and-containers/functions/java-helloworld-with-local-dev-and-oci-functions/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ docker login ams.ocir.io -u '&lt;YOUR OCI TENANCY NAMESPACE&gt;/oracleidentitycl
130130
docker push fra.ocir.io/&lt;YOUR OCI TENANCY NAMESPACE&gt;/helloworld-java:1
131131
</pre>
132132

133-
<p>
134-
135133
The last step is to create the Function Application and the function deployment for it. This can be easily done using the Cloud UI.
136134

137135
<p>

cloud-infrastructure/ai-infra-gpu/ai-infrastructure/rag-langchain-vllm-mistral/files/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ hyperframe==6.0.1
4141
idna==3.7
4242
interegular==0.3.3
4343
jieba3k==0.35.1
44-
Jinja2==3.1.4
44+
Jinja2==3.1.5
4545
joblib==1.4.0
4646
jsonpatch==1.33
4747
jsonpointer==2.4

data-platform/core-converged-db/ai-vector-search/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ Oracle AI Vector Search is designed for Artificial Intelligence (AI) workloads a
44

55
If you are interested in Database 23ai , [please see our page here](https://github.com/oracle-devrel/technology-engineering/tree/main/data-platform/core-converged-db/database-23ai).
66

7-
Reviewed Date: 20.08.2024
7+
Reviewed Date: 21.01.2025
88

99
# Useful Links
1010

1111
## Documentation
1212

13+
- [What is a Vector Database](https://www.oracle.com/database/vector-database/)
1314
- [Oracle.com](https://www.oracle.com/database/ai-vector-search/)
15+
- [Oracle AI Vector Search Technical Architecture (interactive diagram)](https://docs.oracle.com/en/database/oracle/oracle-database/23/vsiad/aivs_genarch.html)
1416
- [Oracle AI Vector Search User's Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/overview-ai-vector-search.html)
1517
- [PL/SQL Packages and Types Reference: DBMS_VECTOR](https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/dbms_vector1.html#GUID-F9FCB225-821A-4CCA-92B5-58B9927234FA)
1618
- [PL/SQL Packages and Types Reference: DBMS_VECTOR_CHAIN](https://docs.oracle.com/en/database/oracle/oracle-database/23/arpls/dbms_vector_chain1.html#GUID-D80DDBEF-F1A9-4267-9D3C-A54D237D95C1)
19+
- [DBMS_HYBRID_VECTOR.SEARCH PL/SQL function](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/search.html#GUID-A386BDB0-35D0-41E1-8F41-49AEBEC13BFC)
1720
- [Oracle AI Vector Search FAQ](https://www.oracle.com/database/ai-vector-search/faq/)
1821

1922
## Blogs & Videos
@@ -36,10 +39,11 @@ Reviewed Date: 20.08.2024
3639
## Blogs
3740

3841
- [Getting started with vectors in 23ai](https://blogs.oracle.com/coretec/post/getting-started-with-vectors-in-23ai)
42+
- [Hybrid Vector Index - a combination of AI Vector Search with Text Search](https://blogs.oracle.com/coretec/post/hybrid-vector-index-the-combination-of-full-text-and-semantic-vector-search)
3943

4044
## Videos
4145

42-
- [Ai Vector Search](https://youtu.be/_tOGB9l8cvg)
46+
- [AI Vector Search](https://youtu.be/_tOGB9l8cvg)
4347

4448
# License
4549

0 commit comments

Comments
 (0)