From f91765ea7aeac5acddc0b04db6be34706c82f6c9 Mon Sep 17 00:00:00 2001 From: ggreen Date: Wed, 5 Jun 2024 14:52:59 -0400 Subject: [PATCH] Fixing for CF --- .../jdbc-sql-console-app.yaml | 2 +- ...p.yaml => retail-analytics-app-mysql.yaml} | 2 +- .../retail-cache-sink-app.yaml | 2 +- .../retail-source-app/retail-source-app.yaml | 2 +- .../apps/retail-web-app/retail-web-app.yaml | 5 +- .../cloud/cloudFoundry/scripts/cf-setup.sh | 67 +++++++++++++++---- 6 files changed, 60 insertions(+), 20 deletions(-) rename deployments/cloud/cloudFoundry/apps/retail-analytics-app/{retail-analytics-app.yaml => retail-analytics-app-mysql.yaml} (97%) diff --git a/deployments/cloud/cloudFoundry/apps/jdbc-sql-console-app/jdbc-sql-console-app.yaml b/deployments/cloud/cloudFoundry/apps/jdbc-sql-console-app/jdbc-sql-console-app.yaml index 08146e4..fb161b0 100644 --- a/deployments/cloud/cloudFoundry/apps/jdbc-sql-console-app/jdbc-sql-console-app.yaml +++ b/deployments/cloud/cloudFoundry/apps/jdbc-sql-console-app/jdbc-sql-console-app.yaml @@ -1,6 +1,6 @@ applications: - name: jdbc-sql-console-app - memory: 14000M + memory: 1400M log-rate-limit-per-second: -1 services: - retail-sql diff --git a/deployments/cloud/cloudFoundry/apps/retail-analytics-app/retail-analytics-app.yaml b/deployments/cloud/cloudFoundry/apps/retail-analytics-app/retail-analytics-app-mysql.yaml similarity index 97% rename from deployments/cloud/cloudFoundry/apps/retail-analytics-app/retail-analytics-app.yaml rename to deployments/cloud/cloudFoundry/apps/retail-analytics-app/retail-analytics-app-mysql.yaml index 5c4ab9a..bab66d6 100644 --- a/deployments/cloud/cloudFoundry/apps/retail-analytics-app/retail-analytics-app.yaml +++ b/deployments/cloud/cloudFoundry/apps/retail-analytics-app/retail-analytics-app-mysql.yaml @@ -1,6 +1,6 @@ applications: - name: retail-analytics-app - memory: 14000M + memory: 1400M log-rate-limit-per-second: -1 services: - retail-rabbitmq diff --git a/deployments/cloud/cloudFoundry/apps/retail-cache-sink-app/retail-cache-sink-app.yaml b/deployments/cloud/cloudFoundry/apps/retail-cache-sink-app/retail-cache-sink-app.yaml index 8b259b0..7775f4b 100644 --- a/deployments/cloud/cloudFoundry/apps/retail-cache-sink-app/retail-cache-sink-app.yaml +++ b/deployments/cloud/cloudFoundry/apps/retail-cache-sink-app/retail-cache-sink-app.yaml @@ -4,7 +4,7 @@ applications: log-rate-limit-per-second: -1 services: - retail-rabbitmq - - retail-gf-redis + - retail-gemfire env: JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 17.+}}' SPRING_PROFILES_ACTIVE: 'gemfire' \ No newline at end of file diff --git a/deployments/cloud/cloudFoundry/apps/retail-source-app/retail-source-app.yaml b/deployments/cloud/cloudFoundry/apps/retail-source-app/retail-source-app.yaml index 617afe5..0acdea7 100644 --- a/deployments/cloud/cloudFoundry/apps/retail-source-app/retail-source-app.yaml +++ b/deployments/cloud/cloudFoundry/apps/retail-source-app/retail-source-app.yaml @@ -1,6 +1,6 @@ applications: - name: retail-source-app - memory: 14000M + memory: 1400M log-rate-limit-per-second: -1 services: - retail-rabbitmq diff --git a/deployments/cloud/cloudFoundry/apps/retail-web-app/retail-web-app.yaml b/deployments/cloud/cloudFoundry/apps/retail-web-app/retail-web-app.yaml index a146099..492b847 100644 --- a/deployments/cloud/cloudFoundry/apps/retail-web-app/retail-web-app.yaml +++ b/deployments/cloud/cloudFoundry/apps/retail-web-app/retail-web-app.yaml @@ -1,9 +1,10 @@ applications: - name: retail-cache-sink-app - memory: 14000M + memory: 1400M log-rate-limit-per-second: -1 services: - - retail-gf-redis + - retail-gemfire env: + spring.profiles.active: gemfire JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 17.+}}' retail.customer.id: 'nyla' \ No newline at end of file diff --git a/deployments/cloud/cloudFoundry/scripts/cf-setup.sh b/deployments/cloud/cloudFoundry/scripts/cf-setup.sh index 79c753f..6cc0715 100755 --- a/deployments/cloud/cloudFoundry/scripts/cf-setup.sh +++ b/deployments/cloud/cloudFoundry/scripts/cf-setup.sh @@ -11,24 +11,36 @@ cf marketplace -## GemFire for Redis +## GemFire #small -cf create-service p-cloudcache extra-small retail-gf-redis -c '{"gemfire_for_redis_enabled":"true","gemfire_for_redis_redundant_copies":2,"gemfire_for_redis_region_name": "GF_REDIS"}' -t redis +cf create-service p-cloudcache extra-small retail-gemfire -t gemfire ## SQL -cf create-service postgres on-demand-postgres-small retail-sql +cf create-service postgres on-demand-postgres-db retail-sql + +cf create-service p.mysql db-small retail-scdf-sql ## RabbitMQ -cf create-service p.rabbitmq single-node retail-rabbitmq +cf create-service p.rabbitmq on-demand-plan retail-rabbitmq #cf create-service p.rabbitmq single-node retail-rabbitmq -c '{ "plugins": { "rabbitmq_stream": true, "rabbitmq_stream_management": true } }' #cf update-service retail-rabbitmq -c '{ "plugins": { "rabbitmq_stream": true, "rabbitmq_stream_management": true } }' +# Prometheus + +cf push prometheus --docker-image prom/prometheus --var PORT=9090 +# ---------------- +# SCDF DataFlow + +cf create-service p-dataflow standard scdf + + -c '{"services": ["retail-scdf-sql","retail-rabbitmq"] }' + # ----------------------------- # WAIT FOR SERVICE to be available @@ -52,41 +64,62 @@ do done -gemfire_status=`cf service retail-gf-redis | grep status:` +gemfire_status=`cf service retail-gemfire | grep status:` echo "Waiting for gemfire, current status:" $gemfire_status while [[ "$gemfire_status" != *"create succeeded"* ]] do echo "Waiting for gemfire, current status:" $gemfire_status - gemfire_status=`cf service retail-gf-redis | grep status:` + gemfire_status=`cf service retail-gemfire | grep status:` + sleep 1 +done + + +mysql_status=`cf service retail-scdf-sql | grep status:` +echo "Waiting for retail-scdf-sql, current status:" $mysql_status +while [[ "$mysql_status" != *"create succeeded"* ]] +do + echo "Waiting for retail-scdf-sql, current status:" $mysql_status + mysql_status=`cf service retail-scdf-sql | grep status:` sleep 1 done +data_flow_status=`cf service data-flow | grep status:` +echo "Waiting for data-flow, current status:" $data-flow_status +while [[ "$data-flow_status" != *"create succeeded"* ]] +do + echo "Waiting for retail-scdf-sql, current status:" $data-flow_status + data_flow_status=`cf service data-flow | grep status:` + sleep 1 +done + + + #-------------------- # Push Applications -cf push retail-cache-sink-app -f deployments/cloud/cloudFoundry/apps/retail-cache-sink-app/retail-cache-sink-app.yaml -p applications/retail-cache-sink-app/target/retail-cache-sink-app-0.0.1-SNAPSHOT.jar +cf push retail-cache-sink-app -f deployments/cloud/cloudFoundry/apps/retail-cache-sink-app/retail-cache-sink-app.yaml -p applications/retail-cache-sink-app/target/retail-cache-sink-app-0.1.2-SNAPSHOT.jar # retail-source-app -cf push retail-source-app -f deployments/cloud/cloudFoundry/apps/retail-source-app/retail-source-app.yaml -p applications/retail-source-app/target/retail-source-app-0.0.1-SNAPSHOT.jar +cf push retail-source-app -f deployments/cloud/cloudFoundry/apps/retail-source-app/retail-source-app.yaml -p applications/retail-source-app/target/retail-source-app-0.0.2-SNAPSHOT.jar # retail-web-app -cf push retail-web-app -f deployments/cloud/cloudFoundry/apps/retail-web-app/retail-web-app.yaml -p applications/retail-web-app/target/retail-web-app-0.0.1-SNAPSHOT.jar +cf push retail-web-app -f deployments/cloud/cloudFoundry/apps/retail-web-app/retail-web-app.yaml -p applications/retail-web-app/target/retail-web-app-0.1.0-SNAPSHOT.jar # retail-analytics-app -cf push retail-analytics-app -f deployments/cloud/cloudFoundry/apps/retail-analytics-app/retail-analytics-app.yaml -p applications/retail-analytics-app/target/retail-analytics-app-0.0.3-SNAPSHOT.jar +cf push retail-analytics-app -f deployments/cloud/cloudFoundry/apps/retail-analytics-app/retail-analytics-app-postgres.yaml -p applications/retail-analytics-app/target/retail-analytics-app-0.0.3-SNAPSHOT.jar # jdbc-sql-console-app -cf push jdbc-sql-console-app -f deployments/cloud/cloudFoundry/apps/jdbc-sql-console-app/jdbc-sql-console-app.yaml -p applications/jdbc-sql-console-app/target/jdbc-sql-console-app-0.0.1-SNAPSHOT.jar +cf push jdbc-sql-console-app -f deployments/cloud/cloudFoundry/apps/jdbc-sql-console-app/jdbc-sql-console-app.yaml -p applications/jdbc-sql-console-app/target/jdbc-sql-console-app-0.0.2-SNAPSHOT.jar #------------------- # Create a service key GemFire -cf create-service-key retail-gf-redis retail-gf-redis-key +cf create-service-key retail-gemfire retail-gemfire-key # Inspect the service key: -cf service-key retail-gf-redis retail-gf-redis-key +cf service-key retail-gemfire retail-gemfire-key #------------------- @@ -98,8 +131,14 @@ cf service-key retail-rabbitmq retail-rabbitmq-key #------------------- -# Create a service key MySQL +# Create a service key SQL cf create-service-key retail-sql retail-sql-key # Inspect the service key: cf service-key retail-sql retail-sql-key + + +./deployments/cloud/cloudFoundry/apps/gemfire-gideon-console/cf-push.sh + + +