Skip to content

Commit

Permalink
Merge branch 'oracle-livelabs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LesiaChaban authored Feb 10, 2025
2 parents f4aaa72 + 440f0a9 commit f0b6614
Show file tree
Hide file tree
Showing 101 changed files with 2,871 additions and 201 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Visit [LiveLabs](https://livelabs.oracle.com) now to get started. Workshops are
Pull requests are currently not being accepted. See [CONTRIBUTING](CONTRIBUTING.md) for details.

## License
Copyright (c) 2014, 2022 Oracle and/or its affiliates
Copyright (c) 2014, 2025 Oracle and/or its affiliates
The Universal Permissive License (UPL), Version 1.0
See [LICENSE](LICENSE.txt) for details.

Expand Down
10 changes: 9 additions & 1 deletion oci-starter-lab/advanced/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ You can choose other Java VM to run your program:
- These advantage come also with a long time to compile. So, it is better to first start first with JIT (JDK or GraalVM). Then to compile with GraalVM Native
- [More info: see https://www.graalvm.org/22.0/reference-manual/native-image/](https://www.graalvm.org/22.0/reference-manual/native-image/)

## Task 3 - Security

To enable login using OAuth / OpenID using your application, choose the Security / OpenID flag.

It will add needed resources in your application to configure it:
- an OCI Identity Domain Confidential App,
- and login configuration for that Confidential App inside API Gateway.

## Task 4 - HTTPS = DNS + TLS

It is nicer to have a website with a HTTPS protocol. Like https://www.ocistarter.com.
Expand Down Expand Up @@ -101,4 +109,4 @@ There are 4 ways to have a TLS certificate:

* Author - Marc Gueury
* Contributors - Ewan Slater
* Last Updated - Nov, 2th 2023
* Last Updated - Jan, 20th 2025
Binary file modified oci-starter-lab/advanced/images/starter-advanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
46 changes: 24 additions & 22 deletions oci-starter-lab/container_instance/container_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,22 @@ Please read the chapter: Introduction and Get Started.
- Click *Open*
![Editor File Open](images/starter-compute-dir.png)
2. The main files are:
#### Commands
- build.sh : Build the whole program: Run Terraform, Configure the DB, Build the App, Build the UI
- destroy.sh : Destroy the objects created by Terraform
- env.sh : Contains the settings of your project
#### Directories
- src : Sources files
- app : Source of the Backend Application (Command: build_app.sh)
- ui : Source of the User Interface (Command: build_ui.sh)
- db : SQL files of the database
- terraform : Terraform scripts (Command: plan.sh / apply.sh)
- compute : Contains the deployment files to Compute
- bin : with some helper commands
- bin/ssh\_compute.sh (to ssh to the Compute)
- bin/ssh\_bastion.sh (to ssh to the Bastion)
3. Edit the env.sh file:
| | | | Description |
| ----------- | ---------- | --------- | ---|
| Commands | | | |
| | starter.sh | | Build or destroy a project. Show a menu with commands if not argument is given |
| | env.sh | | Settings of your project |
| Directories | | | Commands used by starter.sh |
| | bin/ | | Commands used by starter.sh |
| | src/ | | Sources files |
| | | app | Backend Application (Command: build_app.sh) |
| | | ui | User Interface (Command: build_ui.sh) |
| | | db | Database initialisation files (SQL, ...) |
| | | terraform | Terraform scripts |
| | target/ | | Output directory |
3. (Optional) Edit the env.sh file:
- Choose the env.sh file.
- Look for \_\_TO_FILL\_\_ in the file
- You may leave it like this.
Expand All @@ -79,7 +80,7 @@ Please read the chapter: Introduction and Get Started.
- If not, the script will create a "oci-starter" compartment
![Editor env.sh](images/starter-kubernetes-env.png)
## Task 3: Build.sh
## Task 3: Starter.sh
During the build, Terraform will create:
- Network resources: VCN, Subnet
Expand All @@ -92,11 +93,12 @@ During the build, Terraform will create:
- then run:
```
<copy>
./build.sh
./starter.sh
</copy>
```
It will build all and at the end you will see:
- Choose **Build**
![Result](../public_compute/images/starter-starter-build.png)
- It will build all and at the end you will see:
```
<copy>
- User Interface : https://xxxx.apigateway.eu-xxxx.oci.customer-oci.com/starter/
Expand All @@ -115,14 +117,14 @@ During the build, Terraform will create:
### Customize
Please also check the "Lab 6 - How to Customize" to see how to customize this sample to your needs
Please also check the "Lab 7 - How to Customize" to see how to customize this sample to your needs
### Cleanup
1. To clean up, run
```
<copy>
./destroy.sh
./starter.sh destroy
</copy>
```
Expand All @@ -137,4 +139,4 @@ Please also check the "Lab 6 - How to Customize" to see how to customize this s
* Author - Marc Gueury
* Contributors - Ewan Slater
* Last Updated - Nov, 2th 2023
* Last Updated - Jan, 20th 2025
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 7 additions & 12 deletions oci-starter-lab/customize/customize.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Let's say that we deploy a Java / SpringBoot on a Compute with an Database.
unzip starter.zip
cd starter
cat README.md
# ./build.sh
# ./starter.sh build
</copy>
````
2. When you run the build.sh script, the program will:
2. When you run the **./starter.sh build** script, the program will:
1. Create resources (compute/database/....) with "Terraform" (src/terraform)
2. Create tables in the database (src/db)
3. Compile the "Backend Application (app)" (src/app)
Expand Down Expand Up @@ -58,15 +58,10 @@ In the next task, we will go inside each directory to see what it contains.
````
````
<copy>
apply.sh atp.tf bastion.tf compute.tf datasource.tf destroy.sh network.tf output.tf plan.sh terraform_local.tf variable.tf
atp.tf bastion.tf compute.tf datasource.tf network.tf output.tf terraform_local.tf variable.tf
</copy>
````
2. We see 2 type of files:
1. *.sh : scripts to run terraform (normal or resource manager):
- plan.sh: test the terraform resources to see if apply will work. But it does nothing.
- apply.sh: create the terraform resources
- destroy.sh: destroy the terrraform resources
2. *.tf : terraform files to create resources
2. We see *.tf files. They are terraform files to create resources
- compute.tf : create the compute
- atp.tf: create an autonomous database
- network.tf: create the network (VCN, subnets, security list)
Expand Down Expand Up @@ -123,7 +118,7 @@ In the next task, we will go inside each directory to see what it contains.
3. You may customize all these files to your needs. For example, to use your own SpringBoot Application.
- overwrite the pom.xml and src directory with your files.
- change the start.sh
- and rerun $STARTER_HOME/build.sh
- and rerun $STARTER_HOME/starter.sh build
## Task 5 - Check User Interface Directory: src/ui
Expand All @@ -148,10 +143,10 @@ In the next task, we will go inside each directory to see what it contains.
- directory ui: containing static HTML files
3. You may customize all these files to your needs. For example, to use your own HTML files
- overwrite the HTML files in the ui directory with your files.
- Then rerun $STARTER_HOME/build.sh to update the server
- Then rerun $STARTER_HOME/starter.sh build to update the server
## Acknowledgements
* Author - Marc Gueury
* Contributors - Ewan Slater
* Last Updated - Nov, 2th 2023
* Last Updated - Jan, 20th 2025
42 changes: 23 additions & 19 deletions oci-starter-lab/function/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,21 @@ Please read the chapter: Introduction and Get Started.
- Click *Open*
![Editor File Open](images/starter-compute-dir.png)
2. The main files are:
- Commands
- build.sh : Build the whole program: Run Terraform, Configure the DB, Build the App, Build the UI
- destroy.sh : Destroy the objects created by Terraform
- env.sh : Contains the settings of your project
- Directories
- src : Sources files
- app : Source of the Backend Application (Command: build_app.sh)
- ui : Source of the User Interface (Command: build_ui.sh)
- db : SQL files of the database
- terraform : Terraform scripts (Command: plan.sh / apply.sh)
- bin : with some helper commands
- bin/ssh\_bastion.sh (to ssh to the Bastion)
| | | | Description |
| ----------- | ---------- | --------- | ---|
| Commands | | | |
| | starter.sh | | Build or destroy a project. Show a menu with commands if not argument is given |
| | env.sh | | Settings of your project |
| Directories | | | Commands used by starter.sh |
| | bin/ | | Commands used by starter.sh |
| | src/ | | Sources files |
| | | app | Backend Application (Command: build_app.sh) |
| | | ui | User Interface (Command: build_ui.sh) |
| | | db | Database initialisation files (SQL, ...) |
| | | terraform | Terraform scripts |
| | target/ | | Output directory |
3. We will need an AUTH Token to login to the Docker Container Registry. Let's create one:
- Click on the top left icon
- Click your username
Expand All @@ -85,7 +88,7 @@ Please read the chapter: Introduction and Get Started.
- If not, the script will create a "oci-starter" compartment
![Editor env.sh](images/starter-function-env.png)
## Task 3: Build.sh
## Task 3: Starter.sh
Before to run the build. Notice that the build will create:
- Network resources: VCN, Subnet
Expand All @@ -100,11 +103,12 @@ Before to run the build. Notice that the build will create:
- then run:
```
<copy>
./build.sh
./starter.sh
</copy>
```
It will build all and at the end you will see:
- Choose **Build**
![Result](../public_compute/images/starter-starter-build.png)
- It will build all and at the end you will see:
```
<copy>
- User Interface : https://xxxxxx.apigateway.eu-xxxx.oci.customer-oci.com/starter/
Expand All @@ -122,7 +126,7 @@ Before to run the build. Notice that the build will create:
## Task 4: More info
### Customize
Please also check the "Lab 6 - How to Customize" to see how to customize this sample to your needs
Please also check the "Lab 7 - How to Customize" to see how to customize this sample to your needs
### Object Storage
During the build, it will generate an Object Storage to store the HTML file.
Expand All @@ -142,7 +146,7 @@ You will find a Application starter-fn-application
1. To clean up, run
```
<copy>
./destroy.sh
./starter.sh destroy
</copy>
```
Expand All @@ -157,5 +161,5 @@ You will find a Application starter-fn-application
* Author - Marc Gueury
* Contributors - Ewan Slater
* Last Updated - Nov, 2th 2023
* Last Updated - Jan, 20th 2025
Binary file modified oci-starter-lab/function/images/architecture_function.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion oci-starter-lab/green_button/green_button.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ Congratulation. You are ready to start your next lab.

* Author - Marc Gueury
* Contributors - Ewan Slater
* Last Updated - Nov, 2th 2023
* Last Updated - Jan, 20th 2025

30 changes: 24 additions & 6 deletions oci-starter-lab/group/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ But when you enable the *Advanced* option, you have 3 choices for Group: *None /

## Architecture

### Compute
### Public Virtual Machine

Here is the architecture of a group of applications sharing common resources with Compute
Here is the architecture of a group of applications sharing common resources with Public Virtual Machine

![Group Compute](images/architecture_common_compute.png =80%x*)
![Group Public Compute](images/architecture_common_public_compute.png =80%x*)

### Private Virtual Machine

Here is the architecture of a group of applications sharing common resources with Private Virtual Machine

![Group Private Compute](images/architecture_common_public_compute.png =80%x*)

### Kubernetes

Expand Down Expand Up @@ -56,10 +62,12 @@ Let's create a group and a first application (micro-service).
![Group App1](images/starter-group-app1.png =80%x*)
7. Copy the command
```
<copy>
curl "https://www.ocistarter.com/app/zip?prefix=starter&group_name=dev&group_common=atp,oke&deploy=kubernetes&ui=html&language=java&database=atp" --output dev.zip
unzip dev.zip
cd dev
cat README.md
</copy>
```
8. Notice that you have 2 directories:
- group\_common for the common resources of the group (OKE, ATP)
Expand All @@ -70,12 +78,16 @@ Let's create a group and a first application (micro-service).
![Group App1 Env](images/starter-group-app1-env.png =80%x*)
10. Run
```
<copy>
./build_group.sh
</copy>
```
The *build\_group.sh* will first build the directory *group\_common* and then the directory *starter*.
11. When done, check if the application works:
```
<copy>
http://123.123.123.123/starter/
</copy>
```
It is also interesting to look at the created file: group\_common\_env.sh. It contains all the settings of the group.
It is reused by all applications.
Expand All @@ -94,20 +106,26 @@ In this case, this means that it will just create new PODS in Kubernetes.
7. Click *Cloud Shell*
![Group App2](images/starter-group-app2.png =80%x*)
```
<copy>
cd dev
curl "https://www.ocistarter.com/app/zip?prefix=starter2&deploy=compute&ui=html&language=java&database=atp" --output starter2.zip
unzip starter2.zip
cd starter2
cat README.md
</copy>
```
8. Run the build. Itt will take the environment variables from the group\_common\_env.sh created above.
8. Run the build. It will take the environment variables from the group\_common\_env.sh created above.
```
./build.sh
<copy>
./starter.sh build
</copy>
```
9. Test if it works. Notice, the first app is using Java, the second one NodeJS.
```
<copy>
http://123.123.123.123/starter/
http://123.123.123.123/starter2/
</copy>
```
Congratulation, if you reached this point, you created a group of 2 microservices using the same common resources !!
Expand All @@ -125,4 +143,4 @@ Congratulation, if you reached this point, you created a group of 2 microservice
* Author - Marc Gueury
* Contributors - Ewan Slater
* Last Updated - Nov, 2th 2023
* Last Updated - Jan, 20th 2025
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified oci-starter-lab/group/images/architecture_common_function.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f0b6614

Please sign in to comment.