Skip to content

Commit 7519cb1

Browse files
paulparkinsonRichardExleyrenagranat
authored
MongoDB/kafka/postgres version of order inventory and other multi cloud etc changes (#101)
* 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 * Update main-setup.sh * Update main-setup.sh * Update main-setup.sh * 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 * inventory-springboot * inventory-helidon fix * mongodb install * mongodm * mongodb install * mongodm * mongodm * mongo-kafka-postgres work * mongodb-kafka-postgres work * mongo * postgres work * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongodm * mongo etc work * mongo kafka postgres work * mongo kafka postgres work Co-authored-by: RichardExley <[email protected]> Co-authored-by: irina granat <[email protected]>
1 parent 2873be3 commit 7519cb1

File tree

70 files changed

+2940
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2940
-114
lines changed

grabdish/destroy-multicloud.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
echo Deleting the Verrazzano custom resource....
88
kubectl delete verrazzano example-verrazzano
99

10+
echo Set verrazzano-managed=false istio-injection=disabled ...
11+
kubectl label namespace msdataworkshop verrazzano-managed=false istio-injection=disabled --overwrite
12+
1013
echo Viewing the uninstall logs...
1114
kubectl logs -f $(kubectl get pod -l job-name=uninstall-example-verrazzano -o jsonpath="{.items[0].metadata.name}")

grabdish/frontend-helidon/src/main/resources/web/index.html

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ <h1 class="oj-sm-only-hide oj-web-applayout-header-title" title="Application Nam
144144
<oj-button disabled="[[inProgress]]" on-oj-action="[[lab9AddInventoryAction]]">Add Inventory</oj-button>
145145
<oj-button disabled="[[inProgress]]" on-oj-action="[[lab9RemoveInventoryAction]]">Remove Inventory</oj-button>
146146
<oj-button disabled="[[inProgress]]" on-oj-action="[[lab9GetInventoryAction]]">Get Inventory</oj-button>
147+
<br><br>
148+
<br>Transactional Exactly-Once Message Delivery Tests...
149+
<br>
150+
<oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterInsertAction]]">Crash order service after Order is inserted (before Order message is sent to Inventory service)</oj-button>
151+
<br><oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterOrderMessageReceivedAction]]">Crash Inventory service after Order message is received (before inventory for order is checked)</oj-button>
152+
<br><oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterOrderMessageProcessedAction]]">Crash Inventory service after inventory for order is checked (before Inventory status message is sent)</oj-button>
153+
<br><oj-button disabled="[[inProgress]]" on-oj-action="[[lab11CrashAfterOrderMessageProcessedAction]]">Crash Inventory service after inventory for order is checked (before Inventory status message is sent)</oj-button>
147154
</div>
148155
<!-- lab10 -->
149156
<div slot="lab10">
@@ -799,6 +806,82 @@ <h1 class="oj-sm-only-hide oj-web-applayout-header-title" title="Application Nam
799806
};
800807

801808

809+
// Lab 11. ---------Transaction crash tests including MongoDB, Kafka, Postgres version---- //
810+
811+
812+
this.lab11CrashAfterInsertAction = function (event, vm) {
813+
vm.inProgress(true);
814+
var order = {
815+
serviceName: 'order',
816+
commandName: 'crashAfterInsert',
817+
orderId: -1,
818+
orderItem: '',
819+
deliverTo: ''
820+
};
821+
var fetchOptions = {
822+
method: 'POST',
823+
headers: { 'Content-Type': 'application/json' },
824+
body: JSON.stringify(order)
825+
};
826+
827+
fetch('/command', fetchOptions).then(fetchResult => {
828+
vm.httpCode(fetchResult.status);
829+
fetchResult.text().then(payload => {
830+
vm.labResult(payload);
831+
vm.inProgress(false);
832+
});
833+
});
834+
};
835+
836+
this.lab11CrashAfterOrderMessageReceivedAction = function (event, vm) {
837+
vm.inProgress(true);
838+
var order = {
839+
serviceName: 'inventory',
840+
commandName: 'crashAfterOrderMessageReceived',
841+
orderId: -1,
842+
orderItem: '',
843+
deliverTo: ''
844+
};
845+
var fetchOptions = {
846+
method: 'POST',
847+
headers: { 'Content-Type': 'application/json' },
848+
body: JSON.stringify(order)
849+
};
850+
851+
fetch('/command', fetchOptions).then(fetchResult => {
852+
vm.httpCode(fetchResult.status);
853+
fetchResult.text().then(payload => {
854+
vm.labResult(payload);
855+
vm.inProgress(false);
856+
});
857+
});
858+
};
859+
860+
this.lab11CrashAfterOrderMessageProcessedAction = function (event, vm) {
861+
vm.inProgress(true);
862+
var order = {
863+
serviceName: 'inventory',
864+
commandName: 'crashAfterOrderMessageProcessed',
865+
orderId: -1,
866+
orderItem: '',
867+
deliverTo: ''
868+
};
869+
var fetchOptions = {
870+
method: 'POST',
871+
headers: { 'Content-Type': 'application/json' },
872+
body: JSON.stringify(order)
873+
};
874+
875+
fetch('/command', fetchOptions).then(fetchResult => {
876+
vm.httpCode(fetchResult.status);
877+
fetchResult.text().then(payload => {
878+
vm.labResult(payload);
879+
vm.inProgress(false);
880+
});
881+
});
882+
};
883+
884+
802885
// Footer
803886
this.footerLinks = [
804887
{ name: 'About Oracle', linkId: 'aboutOracle', linkTarget: 'http://www.oracle.com/us/corporate/index.html#menu-about' },

grabdish/inventory-helidon/deploy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ if [ -z "$1" ]; then
2626
else
2727
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/inventory-helidon-deployment-$CURRENTTIME.yaml) -n msdataworkshop
2828
fi
29+
30+
kubectl create -f inventory-service.yaml -n msdataworkshop

grabdish/inventory-helidon/inventory-helidon-deployment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
##
31
## Copyright (c) 2021 Oracle and/or its affiliates.
42
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
53
apiVersion: apps/v1

grabdish/inventory-helidon/undeploy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
echo delete inventory-helidon deployment...
77

88
kubectl delete deployment inventory-helidon -n msdataworkshop
9+
10+
kubectl delete service inventory -n msdataworkshop
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM openjdk:11-jre-slim
2+
3+
ENTRYPOINT ["java", "-jar", "/usr/share/myservice/myservice.jar"]
4+
5+
# Add Maven dependencies
6+
ADD target/libs /usr/share/myservice/libs
7+
# Add the service itself
8+
ARG JAR_FILE
9+
ADD target/${JAR_FILE} /usr/share/myservice/myservice.jar
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
## Copyright (c) 2021 Oracle and/or its affiliates.
3+
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
6+
IMAGE_NAME=inventory-postgres-kafka
7+
IMAGE_VERSION=0.1
8+
9+
export DOCKER_REGISTRY=$(state_get DOCKER_REGISTRY)
10+
11+
if [ -z "$DOCKER_REGISTRY" ]; then
12+
echo "Error: DOCKER_REGISTRY env variable needs to be set!"
13+
exit 1
14+
fi
15+
16+
export IMAGE=${DOCKER_REGISTRY}/${IMAGE_NAME}:${IMAGE_VERSION}
17+
18+
# mvn install
19+
# mvn package docker:build
20+
mvn package
21+
22+
docker push $IMAGE
23+
if [ $? -eq 0 ]; then
24+
docker rmi ${IMAGE}
25+
fi
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
## Copyright (c) 2021 Oracle and/or its affiliates.
3+
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
6+
SCRIPT_DIR=$(dirname $0)
7+
8+
export DOCKER_REGISTRY="$(state_get DOCKER_REGISTRY)"
9+
export INVENTORY_PDB_NAME="$(state_get INVENTORY_DB_NAME)"
10+
export OCI_REGION="$(state_get OCI_REGION)"
11+
export VAULT_SECRET_OCID=""
12+
13+
echo create inventory-postgres-kafka OAM Component and ApplicationConfiguration
14+
export CURRENTTIME=$( date '+%F_%H:%M:%S' )
15+
echo CURRENTTIME is $CURRENTTIME ...this will be appended to generated deployment yaml
16+
17+
cp inventory-postgres-kafka-comp.yaml inventory-postgres-kafka-comp-$CURRENTTIME.yaml
18+
19+
#may hit sed incompat issue with mac
20+
sed -i "s|%DOCKER_REGISTRY%|${DOCKER_REGISTRY}|g" inventory-postgres-kafka-comp-$CURRENTTIME.yaml
21+
sed -i "s|%INVENTORY_PDB_NAME%|${INVENTORY_PDB_NAME}|g" inventory-postgres-kafka-comp-${CURRENTTIME}.yaml
22+
sed -i "s|%OCI_REGION%|${OCI_REGION}|g" inventory-postgres-kafka-comp-${CURRENTTIME}.yaml
23+
sed -i "s|%VAULT_SECRET_OCID%|${VAULT_SECRET_OCID}|g" inventory-postgres-kafka-comp-${CURRENTTIME}.yaml
24+
25+
if [ -z "$1" ]; then
26+
kubectl apply -f $SCRIPT_DIR/inventory-postgres-kafka-comp-$CURRENTTIME.yaml
27+
kubectl apply -f $SCRIPT_DIR/inventory-postgres-kafka-app.yaml
28+
else
29+
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/inventory-postgres-kafka-comp-$CURRENTTIME.yaml) -n msdataworkshop
30+
fi
31+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
## Copyright (c) 2021 Oracle and/or its affiliates.
3+
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
SCRIPT_DIR=$(dirname $0)
6+
7+
export DOCKER_REGISTRY="$(state_get DOCKER_REGISTRY)"
8+
export INVENTORY_PDB_NAME="$(state_get INVENTORY_DB_NAME)"
9+
export OCI_REGION="$(state_get OCI_REGION)"
10+
export VAULT_SECRET_OCID=""
11+
12+
echo create inventory-postgres-kafka deployment and service...
13+
14+
export CURRENTTIME=$( date '+%F_%H:%M:%S' )
15+
echo CURRENTTIME is $CURRENTTIME ...this will be appended to generated deployment yaml
16+
cp inventory-postgres-kafka-deployment.yaml inventory-postgres-kafka-deployment-$CURRENTTIME.yaml
17+
18+
#may hit sed incompat issue with mac
19+
sed -i "s|%DOCKER_REGISTRY%|${DOCKER_REGISTRY}|g" inventory-postgres-kafka-deployment-$CURRENTTIME.yaml
20+
sed -i "s|%INVENTORY_PDB_NAME%|${INVENTORY_PDB_NAME}|g" inventory-postgres-kafka-deployment-$CURRENTTIME.yaml
21+
sed -i "s|%OCI_REGION%|${OCI_REGION}|g" inventory-postgres-kafka-deployment-${CURRENTTIME}.yaml
22+
sed -i "s|%VAULT_SECRET_OCID%|${VAULT_SECRET_OCID}|g" inventory-postgres-kafka-deployment-${CURRENTTIME}.yaml
23+
24+
if [ -z "$1" ]; then
25+
kubectl apply -f $SCRIPT_DIR/inventory-postgres-kafka-deployment-$CURRENTTIME.yaml -n msdataworkshop
26+
else
27+
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/inventory-postgres-kafka-deployment-$CURRENTTIME.yaml) -n msdataworkshop
28+
fi
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
apiVersion: core.oam.dev/v1alpha2
4+
kind: ApplicationConfiguration
5+
metadata:
6+
name: inventory-postgres-kafka-appconf
7+
namespace: msdataworkshop
8+
annotations:
9+
version: v1.0.0
10+
description: "Inventory Helidon application"
11+
spec:
12+
components:
13+
- componentName: inventory-postgres-kafka-component
14+
traits:
15+
- trait:
16+
apiVersion: oam.verrazzano.io/v1alpha1
17+
kind: MetricsTrait
18+
spec:
19+
scraper: verrazzano-system/vmi-system-prometheus-0
20+
# - trait:
21+
# apiVersion: oam.verrazzano.io/v1alpha1
22+
# kind: IngressTrait
23+
# metadata:
24+
# name: inventory-postgres-kafka-ingress
25+
# spec:
26+
# rules:
27+
# - paths:
28+
# - path: "/"
29+
# pathType: Prefix

0 commit comments

Comments
 (0)