Skip to content

Commit

Permalink
Merge branch 'main' into al3xne-patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderHodicke authored Feb 10, 2025
2 parents 24d9ece + aca1509 commit c513289
Show file tree
Hide file tree
Showing 66 changed files with 672 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ IAM user option will work on both cases above, as local and as OCI Function.

## Build and test

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>.
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#76">line 76</a> to match your <code>compartment OCID</code> and 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#77">line 77</a> to match your <code>GenAI service model OCID</code>.

<p>

Expand All @@ -75,13 +75,25 @@ Testing with curl (or copy-pasting the API Gateway deployment url to a browser):
<pre>
curl https://n3yu.....ghhi.apigateway.eu-frankfurt-1.oci.customer-oci.com/

What happened today 01/17/2025 100 years ago ?
On January 17th, 1925, 100 years ago, the following events took place:
- 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.
- The first Winter Sports Week was held in Chamonix, France. This event eventually evolved into the prestigious Chamonix International Festival of Sports and Cinema.
- 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.
- 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.
- 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.
What happened at 1925-02-07 ?

On February 7, 1925, several significant events took place around the world:

- In the United States, the Grand Ole Opry, a famous country music stage and radio show, made its debut on WSM radio in Nashville, Tennessee. It was initially called the "WSM Barn Dance" and has since become one of the longest-running radio programs in history.

- The first issue of "The New Yorker" magazine was published in New York City. Founded by Harold Ross, the magazine quickly gained a reputation for its sophisticated and witty writing, featuring contributions from renowned writers and artists.

- In the field of aviation, the first non-stop flight from England to India was completed by Squadron Leader John Henry "Jack" Moore-Brabazon, 1st Baron Brabazon of Tara. He flew a modified Airco DH.9A biplane, covering a distance of approximately 4,130 miles (6,646 kilometers) in about 50 hours and 37 minutes.

- In sports, the 1925 Rose Bowl game was played in Pasadena, California. The game, which is an annual college football bowl game, saw the Dartmouth Indians defeat the California Golden Bears by a score of 14-0.

- In the world of literature, the novel "The Great Gatsby" by F. Scott Fitzgerald was published in the United States. The book, set in the 1920s, explores themes of social class, wealth, and the American Dream, and has since become a classic of American literature.

- In the realm of science, the American chemist Wallace Carothers filed a patent for the synthetic polymer nylon. Nylon, known for its strength and versatility, would go on to revolutionize the textile industry and find applications in various products.

- In Europe, the Locarno Treaties were signed in Switzerland. These treaties aimed to promote peace and security in Europe after World War I. They included mutual guarantees of borders and commitments to resolve disputes peacefully.

These are just a few notable events that occurred on February 7, 1925. The day witnessed advancements in entertainment, aviation, sports, literature, science, and international diplomacy.
</pre>

# Native image using GraalVM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ FROM fnproject/fn-java-fdk:jre17-1.0.198 as fdk

FROM container-registry.oracle.com/os/oraclelinux:8-slim
COPY --from=native /app/Hello .
COPY --from=fdk /function/runtime/* .
COPY --from=fdk /function/runtime/* ./
ENTRYPOINT [ "./Hello" ]
CMD [ "com.example.HelloAIFunction::handleRequest", "-Djava.library.path=/lib"]
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on
import com.oracle.bmc.generativeaiinference.model.TextContent;
import com.oracle.bmc.retrier.RetryConfiguration;

import java.time.LocalDate;
import java.io.*;
import java.util.*;
import java.text.*;
Expand All @@ -72,9 +73,10 @@ public class HelloAIFunction {
// FILL IN PROPER VALUES FOR OCI GENAI SERVICE
private static final String ENDPOINT = "https://inference.generativeai.eu-frankfurt-1.oci.oraclecloud.com";
private static final Region REGION = Region.EU_FRANKFURT_1;
private static final String COMPARTMENT_ID = "ocid1.compartment.oc1..";
private static final String GENAI_OCID = "ocid1.generativeaimodel.oc1.eu-frankfurt-1.amaaaaaa....wtig4q";

// FILL IN PROPER VALUES FOR IAM USER WHEN NOT USING INSTANCE_PRINCIPAL IN OCI FUNCTION
private static final String COMPARTMENT_ID = "ocid1.compartment.oc1..";
private static final String TENANCY_ID = "ocid1.tenancy.oc1..";
private static final String USER_ID = "ocid1.user.oc1..";
private static final String FINGERPRINT = "ef:4d:..";
Expand All @@ -85,10 +87,9 @@ public String handleRequest(String input) {
GenerativeAiInferenceClient generativeAiInferenceClient;
String answer = "";
try {
Date date = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
String currentDate = dateFormat. format(date);
String questionToAI = (input == null || input.isEmpty()) ? "What happened today " + currentDate + " 100 years ago ?": input;

LocalDate date = LocalDate.now().minusYears(100);
String questionToAI = (input == null || input.isEmpty()) ? "What happened at " + date + " ?": input;

if(System.getenv("AUTH_INSTANCE_PRINCIPAL") != null) {
System.out.println("AUTH_INSTANCE_PRINCIPAL");
Expand Down Expand Up @@ -128,7 +129,7 @@ public String handleRequest(String input) {
.build();

ChatDetails chatDetails = ChatDetails.builder()
.servingMode(OnDemandServingMode.builder().modelId("ocid1.generativeaimodel.oc1.eu-frankfurt-1.amaaaaaa....wtig4q").build()) // Replace this with the actual OCID of the GenAI service
.servingMode(OnDemandServingMode.builder().modelId(GENAI_OCID).build())
.compartmentId(COMPARTMENT_ID)
.chatRequest(chatRequest)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This page contains information and useful links regarding Compute services that
- [Transfer data to and from Oracle Cloud Infrastructure using OS tools such as sftp, scp, oci cli, curl](https://github.com/mariusscholtz/Oracle-Cloud-Infrastructure-resources/blob/main/VM-shapes/data%20transfer%20to%20OCI%20v1.0.pdf)
- [Quering Compute Capacity using CloudShell](https://github.com/Olygo/OCI_ComputeCapacityReport)
- [Cockpit – Web console to manage Oracle Linux](https://github.com/mariusscholtz/Oracle-Cloud-Infrastructure-resources/tree/main/cockpit) - Installation instructions for Cockpit, the System administration graphical web console for Oracle Linux
- This [Document](https://github.com/skbkkl/sharkuma/blob/main/Oracle-Cloud-Infrastructure-resources/Oracle-OCI-Troubleshooting/Troubleshooting-OCI-Win-VM-Console-Connection.pdf) explain about how to troubleshoot Windows VM console connection via SAC.

# Useful Links

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# OpenShift Agent-Based Installation

This repository provides a comprehensive guide for performing an OpenShift Agent-based connected installation. To simplify the process and reduce manual steps, a custom script is included in the bundle to automate resource provisioning.

This guide is structured into two parts:

Part 1: Covers the creation of necessary resources and sets up the OpenShift control plane.
Part 2: Focuses on scaling the OpenShift cluster by adding worker nodes to support containerized workloads.

Reviewed: 05.02.2025

# When to use this asset?

This document is designed for individuals and organizations looking to install OpenShift clusters on Oracle Cloud Infrastructure (OCI) starting from version 4.13 using the Agent-based installation method.

# Instructions for Utilizing This Asset

Follow this document as a step-by-step guide to deploy OpenShift on OCI using the Agent-based installation method.

# Conclusion

The OpenShift Agent-Based Installation Guide is intended to be a definitive resource for this deployment method. We encourage all users to share feedback, ask questions, and contribute to further improve this project.

# License

Copyright (c) 2025 Oracle and/or its affiliates.

Licensed under the Universal Permissive License (UPL), Version 1.0.

See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.

Binary file not shown.
Loading

0 comments on commit c513289

Please sign in to comment.