Skip to content

Commit 1ab6094

Browse files
paulparkinsonRichardExleyrenagranat
authored
verrazzano/multi-cloud work (#67)
* first-round * second-set * third-push * push4 * push5 * push6 * push * push * push * push * fixes * fixes * fixes * fixes * fixes * fixes * fixes * terra optimizations * terra fixes * env.sh and fixes * docker login fix * take out vaults for now * fixes * fixes * fixes * fixes * fixes * fixes * fixes * Deploy fixes and new terraform * terraform reorg and fixes * oci_core_services fix * Update core.tf * Update core.tf * Update main-destroy.sh * fixes * Update core.tf * fixes * Update oke-setup.sh * fixes * Boost Node CPU and Memory * Rename states for clarity * Update containerengine.tf * Update main-setup.sh * Build perf and main-setup.sh restart * fix * compute shape and docker login enhancements * Update main-setup.sh * build perf tuning * build fixes * Update build-all.sh * Update oci-cli-cs-key-auth.sh * terraform 3 AD * Update oci-cli-cs-key-auth.sh * Update core.tf * fixes * Update core.tf * fixes Uncomment Internet Gateway Comment DHCP settings Move SSL creation to earlier Add wait for OKE to warm up * fixes PropSetup Back to single domain Wait for OKE nodes msdataworkshop alias cwallet.sso name change remove terraform-orig * fixes wallet.zip VM.Standard.B1.1 image Prune terraform status to 60 characters * fixes add cwallet.sso link rm wallet folder (for security) * fixes Destroy new object atp secrets wait for OKE improved logging and setup handling * minor fixes * Fixes Remove RUN_TYPE for now Execute JAVA_BUILD and NON_JAVA_BUILD from main-setup * Fixes No Key Generated messages Improve end of setup * Update containerengine.tf Change image shape * Fixes Hardening oke-setup Different Shape * Update oke-setup.sh Hardening * Parallel Destroy Make destroy run in parallel * chmod * Update main-setup.sh More hardening * Update main-setup.sh * Update oke-setup.sh More defensive code * Typo * SODA build + cleanup Replace SODA jar with maven dependency Remove old scripts Fix global deploy/undeploy scripts * Reorg Jaeger * Jaeger Fixes * DB Prep in Setup and DB Name Changes Moved DB Setup from Java to Shell Change DB Name to o and i * Fixes and Start of GB Integration * DB Name Changes * Update db-setup.sh Fixes * dotnet inventorylocation query * Update main-setup.sh * dotnet inventorylocation query * Update db-setup.sh * GB Integration and Prop Fixes * fixes * Update oci-cli-cs-key-auth.sh * Removed DB Setup from UI * Update oci-cli-cs-key-auth.sh * Dot Net and Go * Fixes * Update main-setup.sh * Manage Non-Java Builds Better * inventory-go work * Update main-destroy.sh * inventory-go work * inventory-go aq dequeue added * Build Reorg * Update main-setup.sh Reorg password collection * Update main-setup.sh Minor fixes * Minor Fixes * Binding Changes * Fixes * Remove Legacy Code Removed admin-helidon, atp-setup, Removed initContainers from deployment yamls * inventory-go working with pl/sql * Fixed inventory-helidon-se * Minor fixes * Update main-setup.sh * Update main-setup.sh * Update main-setup.sh * Update db-setup.sh * Update main-setup.sh * Update main-setup.sh * Update db-setup.sh * Update main-setup.sh * Update main-setup.sh * Update main-setup.sh * Update db-setup.sh * Fixes go build.sh fix * Update java-builds.sh * Update non-java-builds.sh * Update oke-setup.sh * Update oke-setup.sh * Update db-setup.sh * Update non-java-builds.sh * Update java-builds.sh * Update non-java-builds.sh * Update java-builds.sh * Update db-setup.sh * Update oke-setup.sh * Update java-builds.sh * Update non-java-builds.sh * Update java-builds.sh * Update non-java-builds.sh * Update oke-setup.sh * Simpler Approach * Update main-setup.sh * Update main-setup.sh * Update main-setup.sh * Update main-setup.sh * Update main-setup.sh * Update main-setup.sh * Update main-setup.sh Remove API Key based authentication as bug is fixed * Update main-destroy.sh Complete API Key removal * Update destroy.sh * Fix Inventory DotNet and Go * Update logback.xml Fixed inventory-helidon-se * Update db-setup.sh Protect password in it contains case special characters * dotnet and go services: switch to polling for msgs * verrazzano/multi-cloud work * verrazzano comp files * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * polyglot inventory service mods * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work * verrazzano/multi-cloud work Co-authored-by: RichardExley <Richard.exley@oracle.com> Co-authored-by: irina granat <irina.granat@oracle.com>
1 parent 772c191 commit 1ab6094

File tree

6 files changed

+119
-4
lines changed

6 files changed

+119
-4
lines changed

README-multicloud.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@
4343
- Step 2 (`./setup-multicloud.sh`) in this readme will have made the `./deploy-multicloud.sh` call which in turn
4444
deploys the GrabDish microservices in the Verrazzano/OAM framework and so there is no need to explicitly deploy.
4545
- Proceed with all other steps. Step 1 is the only difference.
46+
- Use the `logpodistio` shortcut command instead of the `logpod` shortcut command to view microservice logs
4647

4748
4. Optionally, do labs 3, 4, and 5
4849
- Optionally do `Lab 3: Polyglot Microservices` to test with other languages such as Python, JS, .NET, and Go
4950
- Instead of running `cd $GRABDISH_HOME;./deploy.sh` run `cd $GRABDISH_HOME;./deploy-multicloud.sh`
5051
- Optionally do `Lab 4: Scaling` to show how the application can be scaled at the application and database tiers to maintain optimal performance.
5152
- The creation of the LB in Step 1 is not necessary as the gateway can be used.
52-
- Instead of running `export LB=[LB_IPADDRESS]` run `export LB=$(kubectl get gateway msdataworkshop-order-helidon-appconf-gw -n msdataworkshop -o jsonpath='{.spec.servers[0].hosts[0]}'`
53+
- Instead of running `export LB=[LB_IPADDRESS]` run `export LB=$(kubectl get gateway msdataworkshop-order-helidon-appconf-gw -n msdataworkshop -o jsonpath='{.spec.servers[0].hosts[0]}')`
5354
- Optionally do `Lab 5: Tracing Using Jaeger` to show microservice activity using OpenTracing and Jaeger.
5455
- Can be run without modification
5556

grabdish/order-helidon/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@
206206
<groupId>com.fasterxml.jackson.core</groupId>
207207
<artifactId>jackson-databind</artifactId>
208208
</dependency>
209+
<dependency>
210+
<groupId>org.mongodb</groupId>
211+
<artifactId>mongo-java-driver</artifactId>
212+
<version>3.12.8</version>
213+
</dependency>
209214
<dependency>
210215
<groupId>com.oracle.oci.sdk</groupId>
211216
<artifactId>oci-java-sdk-vault</artifactId>
@@ -221,6 +226,7 @@
221226
<artifactId>oci-java-sdk-secrets</artifactId>
222227
<version>1.32.2</version>
223228
</dependency>
229+
224230
</dependencies>
225231

226232
</project>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
package io.helidon.data.examples;
2+
3+
import java.net.UnknownHostException;
4+
5+
import com.mongodb.MongoClient;
6+
import com.mongodb.MongoClientURI;
7+
import com.mongodb.ServerAddress;
8+
9+
import com.mongodb.client.MongoDatabase;
10+
import com.mongodb.client.MongoCollection;
11+
12+
import org.bson.Document;
13+
import java.util.Arrays;
14+
import com.mongodb.Block;
15+
16+
import com.mongodb.client.MongoCursor;
17+
import static com.mongodb.client.model.Filters.*;
18+
import com.mongodb.client.result.DeleteResult;
19+
import static com.mongodb.client.model.Updates.*;
20+
import com.mongodb.client.result.UpdateResult;
21+
import java.util.ArrayList;
22+
import java.util.List;
23+
24+
public class MongoDBAccess {
25+
public void quicktest() {
26+
// Create seed data
27+
28+
List<Document> seedData = new ArrayList<Document>();
29+
30+
seedData.add(new Document("decade", "1970s")
31+
.append("artist", "Debby Boone")
32+
.append("song", "You Light Up My Life")
33+
.append("weeksAtOne", 10)
34+
);
35+
36+
seedData.add(new Document("decade", "1980s")
37+
.append("artist", "Olivia Newton-John")
38+
.append("song", "Physical")
39+
.append("weeksAtOne", 10)
40+
);
41+
42+
seedData.add(new Document("decade", "1990s")
43+
.append("artist", "Mariah Carey")
44+
.append("song", "One Sweet Day")
45+
.append("weeksAtOne", 16)
46+
);
47+
48+
// Standard URI format: mongodb://[dbuser:dbpassword@]host:port/dbname
49+
50+
MongoClientURI uri = new MongoClientURI("mongodb://user:pass@host:port/db");
51+
MongoClient client = new MongoClient(uri);
52+
MongoDatabase db = client.getDatabase(uri.getDatabase());
53+
54+
/*
55+
* First we'll add a few songs. Nothing is required to create the
56+
* songs collection; it is created automatically when we insert.
57+
*/
58+
59+
MongoCollection<Document> songs = db.getCollection("songs");
60+
61+
// Note that the insert method can take either an array or a document.
62+
63+
songs.insertMany(seedData);
64+
65+
/*
66+
* Then we need to give Boyz II Men credit for their contribution to
67+
* the hit "One Sweet Day".
68+
*/
69+
70+
Document updateQuery = new Document("song", "One Sweet Day");
71+
songs.updateOne(updateQuery, new Document("$set", new Document("artist", "Mariah Carey ft. Boyz II Men")));
72+
73+
/*
74+
* Finally we run a query which returns all the hits that spent 10
75+
* or more weeks at number 1.
76+
*/
77+
78+
Document findQuery = new Document("weeksAtOne", new Document("$gte",10));
79+
Document orderBy = new Document("decade", 1);
80+
81+
MongoCursor<Document> cursor = songs.find(findQuery).sort(orderBy).iterator();
82+
83+
try {
84+
while (cursor.hasNext()) {
85+
Document doc = cursor.next();
86+
System.out.println(
87+
"In the " + doc.get("decade") + ", " + doc.get("song") +
88+
" by " + doc.get("artist") + " topped the charts for " +
89+
doc.get("weeksAtOne") + " straight weeks."
90+
);
91+
}
92+
} finally {
93+
cursor.close();
94+
}
95+
96+
// Since this is an example, we'll clean up after ourselves.
97+
98+
songs.drop();
99+
100+
// Only close the connection when your app is terminating
101+
102+
client.close();
103+
}
104+
}

grabdish/setup-multicloud.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ kubectl wait \
5050
echo Adding labels identifying the msdataworkshop namespace as managed by Verrazzano and enabled for Istio...
5151
kubectl label namespace msdataworkshop verrazzano-managed=true istio-injection=enabled
5252

53+
echo Creating msdataworkshop namespace... If the namespace already exists there will be an error to that effect that can safely be ignored.
54+
kubectl create namespace msdataworkshop
55+
5356
echo Adding VerrazzanoProject
5457
#export CLUSTERS_NAME="$(state_get CLUSTER_NAME)" # eg cluster-cyxypetwerq, also notice the plural/CLUSTERS_NAME and singular/CLUSTER_NAME
5558
export CLUSTERS_NAME=$1

grabdish/utils/getistio

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
## Copyright (c) 2021 Oracle and/or its affiliates.
33
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
44

5-
echo displaying gateways, virtualservices, destinationrules, and authorizationpolicies...
5+
echo displaying gateways, virtualservices, destinationrules, authorizationpolicies, and frontend gw host...
66
kubectl get gateway -n msdataworkshop
77
kubectl get virtualservice -n msdataworkshop
88
kubectl get destinationrules -n msdataworkshop #canaray circuit breakers etc.
9-
kubectl get authorizationpolicy --all-namespaces
9+
kubectl get authorizationpolicy --all-namespaces
10+
kubectl get gateway msdataworkshop-order-helidon-appconf-gw -n msdataworkshop -o jsonpath='{.spec.servers[0].hosts[0]}'

grabdish/utils/getverrazzano

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
echo displaying VerrazzanoProjects...
66

7-
k get VerrazzanoProjects --all-namespaces
7+
kubectl get VerrazzanoProjects --all-namespaces

0 commit comments

Comments
 (0)