diff --git a/README.md b/README.md index 2ecb35980..93b33c58c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ Microservices are loosely-coupled service-oriented architectures with a bounded * [Kubernetes for DBAs Live Lab](http://bit.ly/KubernetesForDBAs) * [Oracle Spring Boot Starters](https://oracle.github.io/microservices-datadriven/spring/starters/) * [Data Refactoring Advisor](./data-refactoring-advisor/README.md) -* [Data Refactoring Advisor for Migrating a Monolith to Microservices Live Lab](https://bit.ly/datarefactoringadvisor) * [Read our blogs](https://oracle.github.io/microservices-datadriven/spring/blogs) * [Sample code for Oracle Transactional Event Queues](./code-teq) @@ -31,7 +30,4 @@ Copyright (c) 2021, 2024, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at . [ATP]: https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html -[LiveLabs]: https://apexapps.oracle.com/pls/apex/f?p=133:1 -[Workshops]: https://apexapps.oracle.com/pls/apex/dbpm/r/livelabs/livelabs-workshop-cards?p100_role=12&p100_focus_area=35&me=126 -[DRC]: https://developer.oracle.com diff --git a/SummaryOfWorkshops.md b/SummaryOfWorkshops.md deleted file mode 100644 index 78d4902e5..000000000 --- a/SummaryOfWorkshops.md +++ /dev/null @@ -1,37 +0,0 @@ -# Summary of workshops included in this repos - -Includes title, ID, link to doc, short description, resources required, and any other relevant info - -##Existing workshops... -OSaga workshop 8781: -Cloud Shell -2 ADB-S 21c databases with public IP addresses - -WMS#8021: Requirements for oracle AQ/TEQ workshop: -Cloud shell -Cx_oracle 8.3 -Two ADB-s 21c - -TEQ/Okafka workshop #8022 : -1- Cloud shell (with Docker engine — to install Kafka and microservices) -2- ADB-S 19c database (one only) * the public IP address helps with DB interaction but it is not a strong requirement if DB with internal IP is accessible by Cloud Shell (TBH I don’t remember) - -##Workshops currently being developed... - -Requirements for the Grabdish Two-Tier Workshop with MLE JavaScript Implementation #11025: -VCN + the usual sub components -Load Balancer with public IP -Compute instance with at least 4GB memory with public IP address -ADB-S 21c database (one only) with public IP address - -WMS ID#8481: Modern CI/CD Pipelines for App Dev with converged Oracle Database -1. Compute instance with public IP address -2. Bastion Service -3. Load Balancer with public IP -4. VCN + the usual sub components -5. OCIR & OKE & Cloud Shell -6. 2 ADB-S 19c - -Data Refactoring workshop: (11016) -ADB-S 21c database with public address, access to database actions, graph studio -Cloud shell (we could potentially eliminate this one if needed) \ No newline at end of file diff --git a/cloudbank-v2/flutter-app/README.md b/cloudbank-v2/flutter-app/README.md deleted file mode 100755 index b8905378c..000000000 --- a/cloudbank-v2/flutter-app/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# CloudBank - -This Flutter project is used in the [Oracle Backend Platform for Microservices with Oracle Database](https://apexapps.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=3607) Live Lab, in Lab 7. Please visit the Live Lab for more information. - diff --git a/cloudbank-v2/flutter-app/analysis_options.yaml b/cloudbank-v2/flutter-app/analysis_options.yaml deleted file mode 100755 index a7acf2459..000000000 --- a/cloudbank-v2/flutter-app/analysis_options.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/cloudbank-v2/flutter-app/android/.gitignore b/cloudbank-v2/flutter-app/android/.gitignore deleted file mode 100755 index 5d99765d9..000000000 --- a/cloudbank-v2/flutter-app/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties -**/*.keystore -**/*.jks diff --git a/cloudbank-v2/flutter-app/android/app/build.gradle b/cloudbank-v2/flutter-app/android/app/build.gradle deleted file mode 100755 index 65d6c2039..000000000 --- a/cloudbank-v2/flutter-app/android/app/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.loginapp" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/cloudbank-v2/flutter-app/android/app/src/main/AndroidManifest.xml b/cloudbank-v2/flutter-app/android/app/src/main/AndroidManifest.xml deleted file mode 100755 index 6e5c97582..000000000 --- a/cloudbank-v2/flutter-app/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/cloudbank-v2/flutter-app/android/app/src/main/kotlin/com/example/loginapp/MainActivity.kt b/cloudbank-v2/flutter-app/android/app/src/main/kotlin/com/example/loginapp/MainActivity.kt deleted file mode 100755 index c7c43bc0a..000000000 --- a/cloudbank-v2/flutter-app/android/app/src/main/kotlin/com/example/loginapp/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.example.loginapp - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/drawable-v21/launch_background.xml b/cloudbank-v2/flutter-app/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100755 index 1cb7aa2f6..000000000 --- a/cloudbank-v2/flutter-app/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/drawable/launch_background.xml b/cloudbank-v2/flutter-app/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100755 index 84037589b..000000000 --- a/cloudbank-v2/flutter-app/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100755 index db77bb4b7..000000000 Binary files a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100755 index 17987b79b..000000000 Binary files a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100755 index 09d439148..000000000 Binary files a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100755 index d5f1c8d34..000000000 Binary files a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100755 index 4d6372eeb..000000000 Binary files a/cloudbank-v2/flutter-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/values-night/styles.xml b/cloudbank-v2/flutter-app/android/app/src/main/res/values-night/styles.xml deleted file mode 100755 index 360a1605c..000000000 --- a/cloudbank-v2/flutter-app/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/cloudbank-v2/flutter-app/android/app/src/main/res/values/styles.xml b/cloudbank-v2/flutter-app/android/app/src/main/res/values/styles.xml deleted file mode 100755 index 5fac67961..000000000 --- a/cloudbank-v2/flutter-app/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/cloudbank-v2/flutter-app/android/app/src/profile/AndroidManifest.xml b/cloudbank-v2/flutter-app/android/app/src/profile/AndroidManifest.xml deleted file mode 100755 index 16fa03566..000000000 --- a/cloudbank-v2/flutter-app/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/cloudbank-v2/flutter-app/android/build.gradle b/cloudbank-v2/flutter-app/android/build.gradle deleted file mode 100755 index 104a4864b..000000000 --- a/cloudbank-v2/flutter-app/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.6.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/cloudbank-v2/flutter-app/android/gradle.properties b/cloudbank-v2/flutter-app/android/gradle.properties deleted file mode 100755 index 46c1f169a..000000000 --- a/cloudbank-v2/flutter-app/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/cloudbank-v2/flutter-app/android/gradle/wrapper/gradle-wrapper.properties b/cloudbank-v2/flutter-app/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100755 index 2108ceb9b..000000000 --- a/cloudbank-v2/flutter-app/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/cloudbank-v2/flutter-app/android/settings.gradle b/cloudbank-v2/flutter-app/android/settings.gradle deleted file mode 100755 index 33f0745d1..000000000 --- a/cloudbank-v2/flutter-app/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/cloudbank-v2/flutter-app/assets/ora-people-computer.png b/cloudbank-v2/flutter-app/assets/ora-people-computer.png deleted file mode 100755 index e26710ba0..000000000 Binary files a/cloudbank-v2/flutter-app/assets/ora-people-computer.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/.gitignore b/cloudbank-v2/flutter-app/ios/.gitignore deleted file mode 100755 index ad322bc09..000000000 --- a/cloudbank-v2/flutter-app/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/cloudbank-v2/flutter-app/ios/Flutter/AppFrameworkInfo.plist b/cloudbank-v2/flutter-app/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100755 index 0d9747fad..000000000 --- a/cloudbank-v2/flutter-app/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 11.0 - - diff --git a/cloudbank-v2/flutter-app/ios/Flutter/Debug.xcconfig b/cloudbank-v2/flutter-app/ios/Flutter/Debug.xcconfig deleted file mode 100755 index 553cface1..000000000 --- a/cloudbank-v2/flutter-app/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/cloudbank-v2/flutter-app/ios/Flutter/Release.xcconfig b/cloudbank-v2/flutter-app/ios/Flutter/Release.xcconfig deleted file mode 100755 index 4b6e1f664..000000000 --- a/cloudbank-v2/flutter-app/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/cloudbank-v2/flutter-app/ios/Podfile b/cloudbank-v2/flutter-app/ios/Podfile deleted file mode 100755 index 5689f552a..000000000 --- a/cloudbank-v2/flutter-app/ios/Podfile +++ /dev/null @@ -1,41 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '11.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/cloudbank-v2/flutter-app/ios/Podfile.lock b/cloudbank-v2/flutter-app/ios/Podfile.lock deleted file mode 100755 index daebcf1b0..000000000 --- a/cloudbank-v2/flutter-app/ios/Podfile.lock +++ /dev/null @@ -1,49 +0,0 @@ -PODS: - - connectivity_plus (0.0.1): - - Flutter - - ReachabilitySwift - - Flutter (1.0.0) - - package_info_plus (0.4.5): - - Flutter - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - - ReachabilitySwift (5.0.0) - - shared_preferences_foundation (0.0.1): - - Flutter - - FlutterMacOS - -DEPENDENCIES: - - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - - Flutter (from `Flutter`) - - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) - - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`) - -SPEC REPOS: - trunk: - - ReachabilitySwift - -EXTERNAL SOURCES: - connectivity_plus: - :path: ".symlinks/plugins/connectivity_plus/ios" - Flutter: - :path: Flutter - package_info_plus: - :path: ".symlinks/plugins/package_info_plus/ios" - path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/ios" - shared_preferences_foundation: - :path: ".symlinks/plugins/shared_preferences_foundation/ios" - -SPEC CHECKSUMS: - connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e - path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852 - ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca - -PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 - -COCOAPODS: 1.11.3 diff --git a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.pbxproj b/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100755 index 32434af8f..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,549 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 339AC93468038882DA35AF66 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29DE7C56043ABF0BA7EC37C5 /* Pods_Runner.framework */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 25339D09E447FB9BEABFEE5F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 29DE7C56043ABF0BA7EC37C5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 4374722E3BFC7618E5770CDE /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 6401F6AF3950ECB3EC8B4E50 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 339AC93468038882DA35AF66 /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 6485AFE6D8E269A009EDAEDC /* Frameworks */ = { - isa = PBXGroup; - children = ( - 29DE7C56043ABF0BA7EC37C5 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - D60E91ACD576A601615BE2F6 /* Pods */, - 6485AFE6D8E269A009EDAEDC /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - D60E91ACD576A601615BE2F6 /* Pods */ = { - isa = PBXGroup; - children = ( - 25339D09E447FB9BEABFEE5F /* Pods-Runner.debug.xcconfig */, - 4374722E3BFC7618E5770CDE /* Pods-Runner.release.xcconfig */, - 6401F6AF3950ECB3EC8B4E50 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - D65116E33182D6C75D9A0EB4 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 86FE6B1B6BDB099D95F5A30B /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 86FE6B1B6BDB099D95F5A30B /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - D65116E33182D6C75D9A0EB4 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.loginapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.loginapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.loginapp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index c4b79bd8c..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100755 index fc6bf8074..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100755 index af0309c4d..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100755 index f9cbb254d..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/contents.xcworkspacedata b/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 17ccc03e6..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100755 index fc6bf8074..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100755 index af0309c4d..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner/AppDelegate.swift b/cloudbank-v2/flutter-app/ios/Runner/AppDelegate.swift deleted file mode 100755 index 376368379..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100755 index 1950fd80e..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100755 index dc9ada472..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100755 index 28c6bf030..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100755 index 2ccbfd967..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100755 index f091b6b0b..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100755 index 4cde12118..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100755 index d0ef06e7e..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100755 index dcdc2306c..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100755 index 2ccbfd967..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100755 index c8f9ed8f5..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100755 index a6d6b8609..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100755 index a6d6b8609..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100755 index 75b2d164a..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100755 index c4df70d39..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100755 index 6a84f41e1..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100755 index d0e1f5853..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100755 index d08a4de32..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100755 index 9da19eaca..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100755 index 9da19eaca..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100755 index 9da19eaca..000000000 Binary files a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100755 index 65a94b5db..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/cloudbank-v2/flutter-app/ios/Runner/Base.lproj/LaunchScreen.storyboard b/cloudbank-v2/flutter-app/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100755 index 497371ea2..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner/Base.lproj/Main.storyboard b/cloudbank-v2/flutter-app/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100755 index bbb83caae..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner/Info.plist b/cloudbank-v2/flutter-app/ios/Runner/Info.plist deleted file mode 100755 index 39c1df50b..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner/Info.plist +++ /dev/null @@ -1,51 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Loginapp - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - loginapp - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - - diff --git a/cloudbank-v2/flutter-app/ios/Runner/Runner-Bridging-Header.h b/cloudbank-v2/flutter-app/ios/Runner/Runner-Bridging-Header.h deleted file mode 100755 index fae207f9e..000000000 --- a/cloudbank-v2/flutter-app/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/cloudbank-v2/flutter-app/lib/components/accountdetailarguments.dart b/cloudbank-v2/flutter-app/lib/components/accountdetailarguments.dart deleted file mode 100755 index 4efd3b75c..000000000 --- a/cloudbank-v2/flutter-app/lib/components/accountdetailarguments.dart +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'credentials.dart'; - -class AccountDetailArguments { - final Credentials creds; - final int accountId; - - AccountDetailArguments(this.creds, this.accountId); -} diff --git a/cloudbank-v2/flutter-app/lib/components/appbar.dart b/cloudbank-v2/flutter-app/lib/components/appbar.dart deleted file mode 100755 index d5dde7539..000000000 --- a/cloudbank-v2/flutter-app/lib/components/appbar.dart +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; - -class CloudBankAppBar extends StatefulWidget implements PreferredSizeWidget { - CloudBankAppBar({Key? key}) - : preferredSize = const Size.fromHeight(kToolbarHeight), - super(key: key); - - @override - final Size preferredSize; // default is 56.0 - - @override - _CloudBankAppBarState createState() => _CloudBankAppBarState(); -} - -class _CloudBankAppBarState extends State { - static const String _title = 'Cloud Bank'; - - @override - Widget build(BuildContext context) { - return AppBar( - title: const Text(_title), - ); - } -} diff --git a/cloudbank-v2/flutter-app/lib/components/bottombuttonbar.dart b/cloudbank-v2/flutter-app/lib/components/bottombuttonbar.dart deleted file mode 100755 index 1c053ae6d..000000000 --- a/cloudbank-v2/flutter-app/lib/components/bottombuttonbar.dart +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; - -class BottomButtonBar extends StatelessWidget { - const BottomButtonBar({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Wrap( - children: [ - Row( - children: [ - ElevatedButton( - onPressed: () => GoRouter.of(context).go('/deposit'), - child: const Padding( - padding: EdgeInsets.all(16), - child: Text('Deposit'), - ), - ), - const SizedBox(width: 8), - ElevatedButton( - onPressed: () => GoRouter.of(context).go('/transfer'), - child: const Padding( - padding: EdgeInsets.all(16), - child: Text('Transfer'), - ), - ), - const SizedBox(width: 8), - ElevatedButton( - onPressed: () => GoRouter.of(context).go('/'), - child: const Padding( - padding: EdgeInsets.all(16), - child: Text('Log out'), - ), - ), - ], - ), - const SizedBox(height: 10), - ], - ); - } -} diff --git a/cloudbank-v2/flutter-app/lib/components/credentials.dart b/cloudbank-v2/flutter-app/lib/components/credentials.dart deleted file mode 100755 index ca8779324..000000000 --- a/cloudbank-v2/flutter-app/lib/components/credentials.dart +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -class Credentials { - final String username; - final String email; - final String objectID; - final String backendUrl; - - Credentials(this.username, this.email, this.objectID, this.backendUrl); -} diff --git a/cloudbank-v2/flutter-app/lib/components/myaccounts.dart b/cloudbank-v2/flutter-app/lib/components/myaccounts.dart deleted file mode 100755 index 876f45fb8..000000000 --- a/cloudbank-v2/flutter-app/lib/components/myaccounts.dart +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'dart:ffi'; - -import 'package:flutter/material.dart'; -import 'package:loginapp/components/credentials.dart'; -import 'package:loginapp/screens/accountdetail.dart'; -import 'package:http/http.dart' as http; -import 'dart:convert'; -import 'package:intl/intl.dart'; - -import 'accountdetailarguments.dart'; - -final formatCurrency = new NumberFormat.simpleCurrency(); - -class Accounts { - final List accounts; - - const Accounts({ - required this.accounts, - }); - - List getAccounts() { - return accounts; - } - - factory Accounts.fromJson({required accounts}) { - return Accounts( - accounts: accounts, - ); - } -} - -class MyAccounts extends StatefulWidget { - final Credentials creds; - - const MyAccounts({Key? key, required this.creds}) : super(key: key); - - @override - State createState() => _MyAccountsState(); -} - -class _MyAccountsState extends State { - late Future futureData; - - @override - void initState() { - super.initState(); - futureData = fetchData(); - } - - Future fetchData() async { - String accountsUrl = - '${widget.creds.backendUrl}/api/v1/account/getAccounts/${widget.creds.objectID}'; - final response = await http.get(Uri.parse(accountsUrl)); - - if (response.statusCode == 200) { - // If the server did return a 200 OK response, - // then parse the JSON. - var accounts = jsonDecode(response.body); - print(accounts); - return Accounts.fromJson(accounts: accounts); - } else { - // If the server did not return a 200 OK response, - // then throw an exception. - throw Exception('Failed to retrieve Account List'); - } - } - - @override - Widget build(BuildContext context) { - Widget accountsSection = Container( - child: Column( - children: [ - FutureBuilder( - future: futureData, - builder: (context, snapshot) { - if (snapshot.hasData) { - print(snapshot.data!.accounts.length); - List data = snapshot.data!.accounts; - print(data); - return ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: const ClampingScrollPhysics(), - itemCount: snapshot.data!.accounts.length, - itemBuilder: (context, index) { - return Card( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ListTile( - leading: const Icon(Icons.attach_money), - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(data[index]['accountName'].toString()), - Text( - formatCurrency - .format(data[index]['accountBalance']), - textScaleFactor: 1.5, - ), - ], - ), - subtitle: - Text("CB ACCT-${data[index]['accountId']}"), - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - child: const Text('TRANSACTIONS'), - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AccountDetail( - args: AccountDetailArguments( - widget.creds, - data[index]['accountId'], - ), - ), - ), - ); - }), - const SizedBox(width: 8), - TextButton( - child: const Text('PAY'), - onPressed: () {/* ... */}, - ), - const SizedBox(width: 8), - ], - ), - ], - ), - ); - }, - ); - } else if (snapshot.hasError) { - return Text('${snapshot.error}'); - } - // By default, show a loading spinner. - return const CircularProgressIndicator(); - }, - ) - ], - ), - ); - - print(widget.creds); - return Wrap( - children: [ - const Text( - 'My Accounts', - textScaleFactor: 2, - ), - const SizedBox(height: 20), - Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - accountsSection, - ], - ), - ], - ); - } -} diff --git a/cloudbank-v2/flutter-app/lib/components/mycreditcards.dart b/cloudbank-v2/flutter-app/lib/components/mycreditcards.dart deleted file mode 100755 index 321f33f10..000000000 --- a/cloudbank-v2/flutter-app/lib/components/mycreditcards.dart +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; - -class MyCreditCards extends StatelessWidget { - const MyCreditCards({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Wrap( - children: [ - const Text( - 'My Credit Cards', - textScaleFactor: 2, - ), - const SizedBox(height: 20), - Card( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ListTile( - leading: const Icon(Icons.credit_card), - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ - Text('Cloud Credit Gold'), - Text( - '\$6,123', - textScaleFactor: 1.5, - ), - ], - ), - subtitle: const Text( - '4545-0101-0202-0345\nNext payment due: March 15'), - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - child: const Text('TRANSACTIONS'), - onPressed: () => GoRouter.of(context).go('/accountdetail'), - ), - const SizedBox(width: 8), - TextButton( - child: const Text('PAY'), - onPressed: () {/* ... */}, - ), - const SizedBox(width: 8), - ], - ), - ], - ), - ), - ], - ); - } -} diff --git a/cloudbank-v2/flutter-app/lib/main.dart b/cloudbank-v2/flutter-app/lib/main.dart deleted file mode 100755 index 15fcedade..000000000 --- a/cloudbank-v2/flutter-app/lib/main.dart +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'dart:io'; - -import 'package:flutter/material.dart'; -import 'package:loginapp/screens/accountdetail.dart'; -import 'package:loginapp/screens/applycc.dart'; -import 'package:loginapp/screens/deposit.dart'; -import 'package:loginapp/screens/home.dart'; -import 'package:loginapp/screens/login.dart'; -import 'package:loginapp/screens/signup.dart'; -import 'package:loginapp/screens/transfer.dart'; -import 'package:parse_server_sdk_flutter/parse_server_sdk.dart'; -import 'package:go_router/go_router.dart'; - -const String backendUrl = 'http://1.2.3.4'; - -// GoRouter configuration -final _router = GoRouter( - routes: [ - GoRoute( - path: '/', - builder: (context, state) => const Login( - backendUrl: backendUrl, - ), - ), - GoRoute( - path: '/signup', - builder: (context, state) => const SignUp( - backendUrl: backendUrl, - ), - ), - GoRoute( - path: '/home', - builder: (context, state) => const Home(), - ), - GoRoute( - path: '/deposit', - builder: (context, state) => const Deposit(), - ), - GoRoute( - path: '/transfer', - builder: (context, state) => const Transfer(), - ), - GoRoute( - path: '/applycc', - builder: (context, state) => const ApplyForCreditCard(), - ), - ], -); - -void main() async { - // Initialize Parse - WidgetsFlutterBinding.ensureInitialized(); - const keyApplicationId = 'APPLICATION_ID'; - const keyParseServerUrl = '$backendUrl/parse'; - - var response = await Parse().initialize(keyApplicationId, keyParseServerUrl); - if (!response.hasParseBeenInitialized()) { - exit(0); - } - var firstObject = ParseObject('FirstClass') - ..set('message', 'LoginApp is Connected 3'); - await firstObject.save(); - // Parse code done - - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return MaterialApp.router( - routerConfig: _router, - ); - } -} diff --git a/cloudbank-v2/flutter-app/lib/screens/accountdetail.dart b/cloudbank-v2/flutter-app/lib/screens/accountdetail.dart deleted file mode 100755 index 712b3f9d9..000000000 --- a/cloudbank-v2/flutter-app/lib/screens/accountdetail.dart +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; -import 'package:loginapp/components/accountdetailarguments.dart'; - -import '../components/credentials.dart'; -import 'home.dart'; -import 'package:http/http.dart' as http; -import 'package:intl/intl.dart'; -import 'dart:convert'; - -final formatCurrency = new NumberFormat.simpleCurrency(); - -class AccountDetail extends StatefulWidget { - final AccountDetailArguments args; - - const AccountDetail({Key? key, required this.args}) : super(key: key); - - @override - State createState() => _AccountDetailState(); -} - -class Account { - // {"accountId":2,"accountName":"Mark's CCard","accountType":"CC","accountCustomerId":"bkzLp8cozi", - //"accountOpenedDate":"2023-03-12T16:06:03.000+00:00","accountOtherDetails":"Mastercard account", - //"accountBalance":800} - final int accountId; - final String accountName; - final String accountType; - final String accountCustomerId; - final String accountOpenedDate; - final String accountOtherDetails; - final double accountBalance; - - const Account({ - required this.accountId, - required this.accountName, - required this.accountType, - required this.accountCustomerId, - required this.accountOpenedDate, - required this.accountOtherDetails, - required this.accountBalance, - }); - - factory Account.fromJson(Map json) { - return Account( - accountId: json['accountId'], - accountName: json['accountName'], - accountType: json['accountType'], - accountCustomerId: json['accountCustomerId'], - accountOpenedDate: json['accountOpenedDate'], - accountOtherDetails: json['accountOtherDetails'], - accountBalance: double.parse(json['accountBalance'].toString()), - ); - } -} - -class Transactions { - final List transactions; - - const Transactions({ - required this.transactions, - }); - - List getTransactions() { - return transactions; - } - - factory Transactions.fromJson({required transactions}) { - return Transactions( - transactions: transactions, - ); - } -} - -class _AccountDetailState extends State { - late Future futureAccountData; - late Future futureTransactionData; - - @override - void initState() { - super.initState(); - futureAccountData = fetchAccountData(); - futureTransactionData = fetchTransactionData(); - } - - Future fetchAccountData() async { - String accountsUrl = - '${widget.args.creds.backendUrl}/api/v1/account/${widget.args.accountId}'; - final response = await http.get(Uri.parse(accountsUrl)); - - if (response.statusCode == 200) { - // If the server did return a 200 OK response, - // then parse the JSON. - return Account.fromJson(jsonDecode(response.body)); - } else { - // If the server did not return a 200 OK response, - // then throw an exception. - throw Exception('Failed to retrieve score'); - } - } - - Future fetchTransactionData() async { - String transcationsUrl = - '${widget.args.creds.backendUrl}/api/v1/account/${widget.args.accountId}/transactions'; - final response = await http.get(Uri.parse(transcationsUrl)); - - if (response.statusCode == 200) { - // If the server did return a 200 OK response, - // then parse the JSON. - return Transactions.fromJson(transactions: jsonDecode(response.body)); - } else { - // If the server did not return a 200 OK response, - // then throw an exception. - throw Exception('Failed to retrieve score'); - } - } - - @override - Widget build(BuildContext context) { - // final args = - // ModalRoute.of(context)!.settings.arguments as AccountDetailArguments; - print(widget.args.creds.username); - print(widget.args.creds.email); - print(widget.args.accountId); - return Scaffold( - appBar: AppBar(title: const Text("Your Transactions")), - body: Center( - child: Container( - padding: const EdgeInsets.all(16), - child: ListView( - children: [ - const Text("Account Details", textScaleFactor: 1.5), - FutureBuilder( - future: futureAccountData, - builder: (context, snapshot) { - if (snapshot.hasData) { - print(snapshot.data); - return Card( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ListTile( - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(snapshot.data!.accountName), - Text( - formatCurrency - .format(snapshot.data!.accountBalance), - textScaleFactor: 1.5, - ), - ], - ), - subtitle: - Text("CB ACCT-${snapshot.data!.accountId}"), - ), - ], - ), - ); - } else if (snapshot.hasError) { - return Text('${snapshot.error}'); - } - // By default, show a loading spinner. - return const Text("Loading..."); - }, - ), - const SizedBox(height: 20), - const Text("Recent Transactions", textScaleFactor: 1.5), - const SizedBox(height: 20), - FutureBuilder( - future: futureTransactionData, - builder: (context, snapshot) { - // {"journalId":3, - // "journalType":"WITHDRAW", - // "accountId":2, - // "lraId":"http://otmm-tcs.otmm.svc.cluster.local:9000/api/v1/lra-coordinator/144d7ad8-653e-4540-987c-cc2fcf0643e0", - // "lraState":"Closed", - // "journalAmount":100} - if (snapshot.hasData) { - print(snapshot.data!.transactions.length); - List data = snapshot.data!.transactions; - print(data); - return ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: const ClampingScrollPhysics(), - itemCount: snapshot.data!.transactions.length, - itemBuilder: (context, index) { - return Card( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ListTile( - leading: const Icon(Icons.attach_money), - title: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text(data[index]['journalType'].toString()), - Text( - formatCurrency - .format(data[index]['journalAmount']), - textScaleFactor: 1.5, - ), - ], - ), - subtitle: Text(data[index]['lraState']), - ), - ], - ), - ); - }, - ); - } else if (snapshot.hasError) { - return Text('${snapshot.error}'); - } - // By default, show a loading spinner. - return const CircularProgressIndicator(); - }, - ), - const SizedBox( - height: 20, - ), - ElevatedButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const Home(), - // Pass the arguments as part of the RouteSettings. The - // DetailScreen reads the arguments from these settings. - settings: RouteSettings( - arguments: widget.args.creds, - ), - ), - ); - }, - //=> GoRouter.of(context).go('/home'), - child: const Padding( - padding: EdgeInsets.all(16), - child: Text('Account List'), - ), - ) - ], - ), - ), - ), - ); - } -} diff --git a/cloudbank-v2/flutter-app/lib/screens/applycc.dart b/cloudbank-v2/flutter-app/lib/screens/applycc.dart deleted file mode 100755 index ee3ebbace..000000000 --- a/cloudbank-v2/flutter-app/lib/screens/applycc.dart +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:parse_server_sdk_flutter/parse_server_sdk.dart'; -import 'package:go_router/go_router.dart'; -import 'package:http/http.dart' as http; -import 'dart:convert'; - -class CreditScore { - final String date; - final String score; - - const CreditScore({ - required this.date, - required this.score, - }); - - factory CreditScore.fromJson(Map json) { - return CreditScore( - date: json['Date'], - score: json['Credit Score'], - ); - } -} - -class ApplyForCreditCard extends StatefulWidget { - const ApplyForCreditCard({Key? key}) : super(key: key); - - @override - State createState() => _ApplyForCreditCardState(); -} - -const List cardTypeList = [ - 'Cloud Credit', - 'Cloud Credit Gold', - 'Cloud Credit Diamond' -]; - -class _ApplyForCreditCardState extends State { - late Future futureCreditScore; - - @override - void initState() { - super.initState(); - futureCreditScore = fetchCreditScore(); - } - - Future fetchCreditScore() async { - final response = - await http.get(Uri.parse('http://129.158.244.40/api/v1/creditscore')); - - if (response.statusCode == 200) { - // If the server did return a 200 OK response, - // then parse the JSON. - return CreditScore.fromJson(jsonDecode(response.body)); - } else { - // If the server did not return a 200 OK response, - // then throw an exception. - throw Exception('Failed to retrieve score'); - } - } - - TextEditingController incomeController = TextEditingController(); - TextEditingController expensesController = TextEditingController(); - TextEditingController limitController = TextEditingController(); - String cardTypeDropdownValue = cardTypeList.first; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: const Text("Apply for Credit Card")), - body: Center( - child: Container( - padding: const EdgeInsets.all(16), - child: ListView( - children: [ - Container( - alignment: Alignment.center, - padding: const EdgeInsets.all(10), - child: const Text( - 'Which card would you like?', - style: TextStyle(fontSize: 20), - )), - Container( - padding: const EdgeInsets.all(10), - child: DropdownButton( - value: cardTypeDropdownValue, - icon: const Icon(Icons.arrow_drop_down), - isExpanded: true, - elevation: 16, - style: const TextStyle(color: Colors.deepPurple), - underline: Container( - height: 2, - color: Colors.deepPurpleAccent, - ), - onChanged: (String? value) { - setState(() { - cardTypeDropdownValue = value!; - }); - }, - items: cardTypeList - .map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value), - ); - }).toList(), - ), - ), - Container( - padding: const EdgeInsets.all(10), - child: TextField( - controller: limitController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Requested credit limit', - ), - ), - ), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.all(10), - child: const Text( - 'About you', - style: TextStyle(fontSize: 20), - )), - Container( - padding: const EdgeInsets.all(10), - child: TextField( - controller: incomeController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Monthly income before tax', - ), - ), - ), - Container( - padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), - child: TextField( - controller: expensesController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Monthly expenses', - ), - ), - ), - const SizedBox(height: 20), - Container( - padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), - child: FutureBuilder( - future: futureCreditScore, - builder: (context, snapshot) { - if (snapshot.hasData) { - return Text( - "Your credit score: ${snapshot.data!.score}"); - } else if (snapshot.hasError) { - return Text('${snapshot.error}'); - } - // By default, show a loading spinner. - return const CircularProgressIndicator(); - }, - ), - ), - const SizedBox( - height: 20, - ), - Container( - height: 50, - padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), - child: ElevatedButton( - child: const Text('Submit Application'), - onPressed: () { - print("Controller name = ${incomeController.text}"); - print( - "Controller password = ${expensesController.text}"); - processCCApplication( - context, - incomeController.text, - expensesController.text, - cardTypeDropdownValue, - limitController.text); - }, - )), - ], - )), - ), - ); - } - - processCCApplication(context, income, expenses, cardType, limit) async { - print("processCCApplication income = $income"); - print("processCCApplication expenses = $expenses"); - print("processCCApplication cardType = $cardType"); - print("processCCApplication limit = $limit"); - var application = ParseObject("CCApplication"); - application.set("income", income); - application.set("expenses", expenses); - application.set("cardType", cardType); - application.set("limit", limit); - var response = await application.save(); - - print("saved = $response"); - // set up the button - Widget okButton = TextButton( - child: const Text("OK"), - onPressed: () => GoRouter.of(context).go('/home'), - ); - - // set up the AlertDialog - AlertDialog alert = AlertDialog( - title: const Text("Application submitted"), - icon: Icon(Icons.account_balance_rounded), - content: const Text( - "Thanks for your application! We'll get back to you as soon as we can."), - actions: [ - okButton, - ], - ); - - // show the dialog - showDialog( - context: context, - builder: (BuildContext context) { - return alert; - }, - ); - } -} diff --git a/cloudbank-v2/flutter-app/lib/screens/deposit.dart b/cloudbank-v2/flutter-app/lib/screens/deposit.dart deleted file mode 100755 index bfb40db86..000000000 --- a/cloudbank-v2/flutter-app/lib/screens/deposit.dart +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; - -class Deposit extends StatefulWidget { - const Deposit({Key? key}) : super(key: key); - - @override - State createState() => _DepositState(); -} - -class _DepositState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: const Text("Deposit")), - body: Center( - child: Container( - padding: const EdgeInsets.all(16), - child: ListView( - children: [ - const Text( - 'Account chooser goes here', - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.w800, - fontFamily: 'Roboto', - letterSpacing: 0.5, - fontSize: 20, - ), - ), - const SizedBox( - height: 20, - ), - ElevatedButton( - onPressed: () => GoRouter.of(context).go('/home'), - child: const Padding( - padding: EdgeInsets.all(16), - child: Text('Go back to Home'), - ), - ) - ], - ), - ), - ), - ); - } -} diff --git a/cloudbank-v2/flutter-app/lib/screens/home.dart b/cloudbank-v2/flutter-app/lib/screens/home.dart deleted file mode 100755 index 4c578dace..000000000 --- a/cloudbank-v2/flutter-app/lib/screens/home.dart +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; -import 'package:loginapp/components/appbar.dart'; -import 'package:loginapp/components/myaccounts.dart'; -import 'package:loginapp/components/mycreditcards.dart'; -import 'package:loginapp/components/bottombuttonbar.dart'; - -import '../components/credentials.dart'; - -class Home extends StatefulWidget { - const Home({Key? key}) : super(key: key); - - @override - State createState() => _HomeState(); -} - -class _HomeState extends State { - @override - Widget build(BuildContext context) { - final creds = ModalRoute.of(context)!.settings.arguments as Credentials; - print(creds.username); - print(creds.email); - return Scaffold( - appBar: CloudBankAppBar(), - body: Center( - child: ListView( - padding: const EdgeInsets.all(10), - children: [ - const SizedBox(height: 8), - MyAccounts( - creds: creds, - ), - const SizedBox(height: 8), - const MyCreditCards(), - const SizedBox(height: 20), - // -------------------- - const Text( - 'What else can I do?', - textScaleFactor: 2, - ), - const SizedBox(height: 16), - const SizedBox(height: 16), - const SizedBox(height: 16), - Card( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - ListTile( - leading: const Icon(Icons.wallet), - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ - Text('Apply for a Credit Card'), - ], - ), - subtitle: const Text( - 'We have several cards to suit your needs'), - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - TextButton( - child: const Text('APPLY NOW'), - onPressed: () => GoRouter.of(context).go('/applycc'), - ), - const SizedBox(width: 8), - ], - ), - ], - ), - ), - const SizedBox( - height: 10, - ), - // ADD CLOUD CASH CARD HERE - const SizedBox( - height: 20, - ), - // -------------------- - const BottomButtonBar(), - ], - ), - )); - } -} diff --git a/cloudbank-v2/flutter-app/lib/screens/login.dart b/cloudbank-v2/flutter-app/lib/screens/login.dart deleted file mode 100755 index f905f6a2d..000000000 --- a/cloudbank-v2/flutter-app/lib/screens/login.dart +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:loginapp/components/appbar.dart'; -import 'package:loginapp/screens/home.dart'; -import 'package:parse_server_sdk_flutter/parse_server_sdk.dart'; -import 'package:go_router/go_router.dart'; - -import '../components/credentials.dart'; - -class Login extends StatefulWidget { - final String backendUrl; - - const Login({Key? key, required this.backendUrl}) : super(key: key); - - @override - State createState() => _LoginState(); -} - -class _LoginState extends State { - TextEditingController nameController = TextEditingController(); - TextEditingController passwordController = TextEditingController(); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: CloudBankAppBar(), - body: Padding( - padding: const EdgeInsets.all(10), - child: ListView( - children: [ - Container( - alignment: Alignment.center, - padding: const EdgeInsets.all(10), - child: const Text( - 'CloudBank', - style: TextStyle( - color: Colors.blue, - fontWeight: FontWeight.w500, - fontSize: 30), - )), - Container( - alignment: Alignment.center, - padding: const EdgeInsets.all(10), - child: const Text( - 'Sign in', - style: TextStyle(fontSize: 20), - )), - Container( - padding: const EdgeInsets.all(10), - child: TextField( - controller: nameController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'User Name', - ), - ), - ), - Container( - padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), - child: TextField( - obscureText: true, - controller: passwordController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'Password', - ), - ), - ), - TextButton( - onPressed: () { - //forgot password screen - }, - child: const Text( - 'Forgot Password', - ), - ), - Container( - height: 50, - padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), - child: ElevatedButton( - child: const Text('Login'), - onPressed: () { - print("Controller name = ${nameController.text}"); - print( - "Controller password = ${passwordController.text}"); - processLogin(context, nameController.text, - passwordController.text); - }, - )), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text('Need an account?'), - TextButton( - child: const Text( - 'Join us now', - //style: TextStyle(fontSize: 20), - ), - onPressed: () { - //signup screen - GoRouter.of(context).go('/signup'); - }, - ) - ], - ), - ], - ))); - } - - processLogin(context, username, password) async { - print("processLogin name = $username"); - print("processLogin password = $password"); - var user = ParseUser(username, password, ""); - var response = await user.login(); - if (response.success) { - user = response.result; - print("user = $user"); - Credentials creds = Credentials( - user.username.toString(), - user.emailAddress.toString(), - user.objectId.toString(), - widget.backendUrl); - print(creds); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const Home(), - // Pass the arguments as part of the RouteSettings. - settings: RouteSettings( - arguments: creds, - ), - ), - ); - } else { - // set up the button - Widget okButton = TextButton( - child: const Text("OK"), - onPressed: () => Navigator.pop(context), - ); - // set up the AlertDialog - AlertDialog alert = AlertDialog( - title: const Text("Error Dialog"), - content: Text('${response.error?.message}'), - actions: [ - okButton, - ], - ); - - // show the dialog - showDialog( - context: context, - builder: (BuildContext context) { - return alert; - }, - ); - } - } -} diff --git a/cloudbank-v2/flutter-app/lib/screens/signup.dart b/cloudbank-v2/flutter-app/lib/screens/signup.dart deleted file mode 100755 index dc76b43e6..000000000 --- a/cloudbank-v2/flutter-app/lib/screens/signup.dart +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:loginapp/screens/home.dart'; -import 'package:parse_server_sdk_flutter/parse_server_sdk.dart'; - -import '../components/credentials.dart'; - -class SignUp extends StatefulWidget { - final String backendUrl; - const SignUp({Key? key, required this.backendUrl}) : super(key: key); - - @override - State createState() => _SignUpState(); -} - -class _SignUpState extends State { - @override - void initState() { - super.initState(); - } - - TextEditingController usernameController = TextEditingController(); - TextEditingController passwordController = TextEditingController(); - TextEditingController emailController = TextEditingController(); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: const Text("Account SignUp")), - body: Center( - child: Container( - padding: const EdgeInsets.all(16), - child: ListView( - children: [ - Container( - padding: const EdgeInsets.all(10), - child: TextField( - controller: usernameController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'User Name', - ), - ), - ), - Container( - padding: const EdgeInsets.all(10), - child: TextField( - controller: passwordController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'User Password', - ), - ), - ), - Container( - padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), - child: TextField( - controller: emailController, - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'User Email', - ), - ), - ), - const SizedBox( - height: 20, - ), - Container( - height: 50, - padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), - child: ElevatedButton( - child: const Text('Create Account'), - onPressed: () { - print( - "Controller user name = ${usernameController.text}"); - print( - "Controller password = ${passwordController.text}"); - print("Controller password = ${emailController.text}"); - processSignUp(context, usernameController.text, - passwordController.text, emailController.text); - }, - )), - ], - )), - ), - ); - } - - processSignUp(context, username, password, email) async { - print("processSignUp name = $username"); - print("processSignUp password = $password"); - print("processSignUp email = $email"); - var user = ParseUser(username, password, ""); - var response = await ParseUser(username, password, email).create(); - if (response.success) { - user = response.result; - print("user = $user"); - Credentials creds = Credentials( - user.username.toString(), - user.emailAddress.toString(), - user.objectId.toString(), - widget.backendUrl); - print(creds); - // set up the button - Widget okButton = TextButton( - child: const Text("OK"), - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const Home(), - // Pass the arguments as part of the RouteSettings. - settings: RouteSettings( - arguments: creds, - ), - ), - ); - }); - // set up the AlertDialog - AlertDialog alert = AlertDialog( - title: const Text("Success"), - content: const Text("Account successfully created"), - actions: [ - okButton, - ], - ); - - // show the dialog - showDialog( - context: context, - builder: (BuildContext context) { - return alert; - }, - ); - } else { - // set up the button - Widget okButton = TextButton( - child: const Text("OK"), - onPressed: () => Navigator.pop(context), - ); - // set up the AlertDialog - AlertDialog alert = AlertDialog( - title: const Text("Error Dialog"), - content: Text('${response.error?.message}'), - actions: [ - okButton, - ], - ); - - // show the dialog - showDialog( - context: context, - builder: (BuildContext context) { - return alert; - }, - ); - } - } -} diff --git a/cloudbank-v2/flutter-app/lib/screens/transfer.dart b/cloudbank-v2/flutter-app/lib/screens/transfer.dart deleted file mode 100755 index cc47071db..000000000 --- a/cloudbank-v2/flutter-app/lib/screens/transfer.dart +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; - -class Transfer extends StatefulWidget { - const Transfer({Key? key}) : super(key: key); - - @override - State createState() => _TransferState(); -} - -class _TransferState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: const Text("Transfer")), - body: Center( - child: Container( - padding: const EdgeInsets.all(16), - child: ListView( - children: [ - const Text( - 'To and from account chooser, amount, etc., goes here', - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.w800, - fontFamily: 'Roboto', - letterSpacing: 0.5, - fontSize: 20, - ), - ), - const SizedBox( - height: 20, - ), - ElevatedButton( - onPressed: () => GoRouter.of(context).go('/home'), - child: const Padding( - padding: EdgeInsets.all(16), - child: Text('Go back to Home'), - ), - ) - ], - ), - ), - ), - ); - } -} diff --git a/cloudbank-v2/flutter-app/linux/.gitignore b/cloudbank-v2/flutter-app/linux/.gitignore deleted file mode 100755 index c7ea17fcf..000000000 --- a/cloudbank-v2/flutter-app/linux/.gitignore +++ /dev/null @@ -1 +0,0 @@ -flutter/ephemeral diff --git a/cloudbank-v2/flutter-app/linux/CMakeLists.txt b/cloudbank-v2/flutter-app/linux/CMakeLists.txt deleted file mode 100755 index 2fde83157..000000000 --- a/cloudbank-v2/flutter-app/linux/CMakeLists.txt +++ /dev/null @@ -1,138 +0,0 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.10) -project(runner LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "loginapp") -# The unique GTK application identifier for this application. See: -# https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.loginapp") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(SET CMP0063 NEW) - -# Load bundled libraries from the lib/ directory relative to the binary. -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Root filesystem for cross-building. -if(FLUTTER_TARGET_PLATFORM_SYSROOT) - set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -# Define build configuration options. -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") -endif() - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_14) - target_compile_options(${TARGET} PRIVATE -Wall -Werror) - target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") - target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) - -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Define the application target. To change its name, change BINARY_NAME above, -# not the value here, or `flutter run` will no longer work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) - -# Only the install-generated bundle's copy of the executable will launch -# correctly, since the resources must in the right relative locations. To avoid -# people trying to run the unbundled copy, put it in a subdirectory instead of -# the default top-level location. -set_target_properties(${BINARY_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" -) - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# By default, "installing" just makes a relocatable bundle in the build -# directory. -set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -# Start with a clean build bundle directory every time. -install(CODE " - file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") - " COMPONENT Runtime) - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) - install(FILES "${bundled_library}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endforeach(bundled_library) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") - install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() diff --git a/cloudbank-v2/flutter-app/linux/flutter/CMakeLists.txt b/cloudbank-v2/flutter-app/linux/flutter/CMakeLists.txt deleted file mode 100755 index 27860e801..000000000 --- a/cloudbank-v2/flutter-app/linux/flutter/CMakeLists.txt +++ /dev/null @@ -1,88 +0,0 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.10) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. - -# Serves the same purpose as list(TRANSFORM ... PREPEND ...), -# which isn't available in 3.10. -function(list_prepend LIST_NAME PREFIX) - set(NEW_LIST "") - foreach(element ${${LIST_NAME}}) - list(APPEND NEW_LIST "${PREFIX}${element}") - endforeach(element) - set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) -endfunction() - -# === Flutter Library === -# System-level dependencies. -find_package(PkgConfig REQUIRED) -pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) -pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) - -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "fl_basic_message_channel.h" - "fl_binary_codec.h" - "fl_binary_messenger.h" - "fl_dart_project.h" - "fl_engine.h" - "fl_json_message_codec.h" - "fl_json_method_codec.h" - "fl_message_codec.h" - "fl_method_call.h" - "fl_method_channel.h" - "fl_method_codec.h" - "fl_method_response.h" - "fl_plugin_registrar.h" - "fl_plugin_registry.h" - "fl_standard_message_codec.h" - "fl_standard_method_codec.h" - "fl_string_codec.h" - "fl_value.h" - "fl_view.h" - "flutter_linux.h" -) -list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") -target_link_libraries(flutter INTERFACE - PkgConfig::GTK - PkgConfig::GLIB - PkgConfig::GIO -) -add_dependencies(flutter flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CMAKE_CURRENT_BINARY_DIR}/_phony_ - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" - ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} -) diff --git a/cloudbank-v2/flutter-app/linux/flutter/generated_plugin_registrant.cc b/cloudbank-v2/flutter-app/linux/flutter/generated_plugin_registrant.cc deleted file mode 100755 index e71a16d23..000000000 --- a/cloudbank-v2/flutter-app/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,11 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - - -void fl_register_plugins(FlPluginRegistry* registry) { -} diff --git a/cloudbank-v2/flutter-app/linux/flutter/generated_plugin_registrant.h b/cloudbank-v2/flutter-app/linux/flutter/generated_plugin_registrant.h deleted file mode 100755 index e0f0a47bc..000000000 --- a/cloudbank-v2/flutter-app/linux/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void fl_register_plugins(FlPluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/cloudbank-v2/flutter-app/linux/flutter/generated_plugins.cmake b/cloudbank-v2/flutter-app/linux/flutter/generated_plugins.cmake deleted file mode 100755 index 2e1de87a7..000000000 --- a/cloudbank-v2/flutter-app/linux/flutter/generated_plugins.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/cloudbank-v2/flutter-app/linux/main.cc b/cloudbank-v2/flutter-app/linux/main.cc deleted file mode 100755 index 4340ffc17..000000000 --- a/cloudbank-v2/flutter-app/linux/main.cc +++ /dev/null @@ -1,6 +0,0 @@ -#include "my_application.h" - -int main(int argc, char** argv) { - g_autoptr(MyApplication) app = my_application_new(); - return g_application_run(G_APPLICATION(app), argc, argv); -} diff --git a/cloudbank-v2/flutter-app/linux/my_application.cc b/cloudbank-v2/flutter-app/linux/my_application.cc deleted file mode 100755 index a4951b098..000000000 --- a/cloudbank-v2/flutter-app/linux/my_application.cc +++ /dev/null @@ -1,104 +0,0 @@ -#include "my_application.h" - -#include -#ifdef GDK_WINDOWING_X11 -#include -#endif - -#include "flutter/generated_plugin_registrant.h" - -struct _MyApplication { - GtkApplication parent_instance; - char** dart_entrypoint_arguments; -}; - -G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) - -// Implements GApplication::activate. -static void my_application_activate(GApplication* application) { - MyApplication* self = MY_APPLICATION(application); - GtkWindow* window = - GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); - - // Use a header bar when running in GNOME as this is the common style used - // by applications and is the setup most users will be using (e.g. Ubuntu - // desktop). - // If running on X and not using GNOME then just use a traditional title bar - // in case the window manager does more exotic layout, e.g. tiling. - // If running on Wayland assume the header bar will work (may need changing - // if future cases occur). - gboolean use_header_bar = TRUE; -#ifdef GDK_WINDOWING_X11 - GdkScreen* screen = gtk_window_get_screen(window); - if (GDK_IS_X11_SCREEN(screen)) { - const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); - if (g_strcmp0(wm_name, "GNOME Shell") != 0) { - use_header_bar = FALSE; - } - } -#endif - if (use_header_bar) { - GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); - gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "loginapp"); - gtk_header_bar_set_show_close_button(header_bar, TRUE); - gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); - } else { - gtk_window_set_title(window, "loginapp"); - } - - gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); - - g_autoptr(FlDartProject) project = fl_dart_project_new(); - fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); - - FlView* view = fl_view_new(project); - gtk_widget_show(GTK_WIDGET(view)); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); - - fl_register_plugins(FL_PLUGIN_REGISTRY(view)); - - gtk_widget_grab_focus(GTK_WIDGET(view)); -} - -// Implements GApplication::local_command_line. -static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { - MyApplication* self = MY_APPLICATION(application); - // Strip out the first argument as it is the binary name. - self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); - - g_autoptr(GError) error = nullptr; - if (!g_application_register(application, nullptr, &error)) { - g_warning("Failed to register: %s", error->message); - *exit_status = 1; - return TRUE; - } - - g_application_activate(application); - *exit_status = 0; - - return TRUE; -} - -// Implements GObject::dispose. -static void my_application_dispose(GObject* object) { - MyApplication* self = MY_APPLICATION(object); - g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); - G_OBJECT_CLASS(my_application_parent_class)->dispose(object); -} - -static void my_application_class_init(MyApplicationClass* klass) { - G_APPLICATION_CLASS(klass)->activate = my_application_activate; - G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; - G_OBJECT_CLASS(klass)->dispose = my_application_dispose; -} - -static void my_application_init(MyApplication* self) {} - -MyApplication* my_application_new() { - return MY_APPLICATION(g_object_new(my_application_get_type(), - "application-id", APPLICATION_ID, - "flags", G_APPLICATION_NON_UNIQUE, - nullptr)); -} diff --git a/cloudbank-v2/flutter-app/linux/my_application.h b/cloudbank-v2/flutter-app/linux/my_application.h deleted file mode 100755 index 8f20fb55a..000000000 --- a/cloudbank-v2/flutter-app/linux/my_application.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef FLUTTER_MY_APPLICATION_H_ -#define FLUTTER_MY_APPLICATION_H_ - -#include - -G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, - GtkApplication) - -/** - * my_application_new: - * - * Creates a new Flutter-based application. - * - * Returns: a new #MyApplication. - */ -MyApplication* my_application_new(); - -#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/cloudbank-v2/flutter-app/macos/.gitignore b/cloudbank-v2/flutter-app/macos/.gitignore deleted file mode 100755 index d4e056954..000000000 --- a/cloudbank-v2/flutter-app/macos/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Flutter-related -**/Flutter/ephemeral/ -**/Pods/ - -# Xcode-related -**/dgph -**/xcuserdata/ diff --git a/cloudbank-v2/flutter-app/macos/Flutter/Flutter-Debug.xcconfig b/cloudbank-v2/flutter-app/macos/Flutter/Flutter-Debug.xcconfig deleted file mode 100755 index 63eaa61da..000000000 --- a/cloudbank-v2/flutter-app/macos/Flutter/Flutter-Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/cloudbank-v2/flutter-app/macos/Flutter/Flutter-Release.xcconfig b/cloudbank-v2/flutter-app/macos/Flutter/Flutter-Release.xcconfig deleted file mode 100755 index 88d14e02d..000000000 --- a/cloudbank-v2/flutter-app/macos/Flutter/Flutter-Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/cloudbank-v2/flutter-app/macos/Flutter/GeneratedPluginRegistrant.swift b/cloudbank-v2/flutter-app/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100755 index bf6375f88..000000000 --- a/cloudbank-v2/flutter-app/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - -import connectivity_plus_macos -import package_info_plus_macos -import path_provider_foundation -import shared_preferences_foundation - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) - FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) -} diff --git a/cloudbank-v2/flutter-app/macos/Podfile b/cloudbank-v2/flutter-app/macos/Podfile deleted file mode 100755 index 077cc7cc3..000000000 --- a/cloudbank-v2/flutter-app/macos/Podfile +++ /dev/null @@ -1,40 +0,0 @@ -platform :osx, '10.11' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/project.pbxproj b/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/project.pbxproj deleted file mode 100755 index c3ba1ef9d..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,572 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXAggregateTarget section */ - 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; - buildPhases = ( - 33CC111E2044C6BF0003C045 /* ShellScript */, - ); - dependencies = ( - ); - name = "Flutter Assemble"; - productName = FLX; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC111A2044C6BA0003C045; - remoteInfo = FLX; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* loginapp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "loginapp.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; - 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; - 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; - 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 33CC10EA2044A3C60003C045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 33BA886A226E78AF003329D5 /* Configs */ = { - isa = PBXGroup; - children = ( - 33E5194F232828860026EE4D /* AppInfo.xcconfig */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, - ); - path = Configs; - sourceTree = ""; - }; - 33CC10E42044A3C60003C045 = { - isa = PBXGroup; - children = ( - 33FAB671232836740065AC1E /* Runner */, - 33CEB47122A05771004F2AC0 /* Flutter */, - 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, - ); - sourceTree = ""; - }; - 33CC10EE2044A3C60003C045 /* Products */ = { - isa = PBXGroup; - children = ( - 33CC10ED2044A3C60003C045 /* loginapp.app */, - ); - name = Products; - sourceTree = ""; - }; - 33CC11242044D66E0003C045 /* Resources */ = { - isa = PBXGroup; - children = ( - 33CC10F22044A3C60003C045 /* Assets.xcassets */, - 33CC10F42044A3C60003C045 /* MainMenu.xib */, - 33CC10F72044A3C60003C045 /* Info.plist */, - ); - name = Resources; - path = ..; - sourceTree = ""; - }; - 33CEB47122A05771004F2AC0 /* Flutter */ = { - isa = PBXGroup; - children = ( - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - ); - path = Flutter; - sourceTree = ""; - }; - 33FAB671232836740065AC1E /* Runner */ = { - isa = PBXGroup; - children = ( - 33CC10F02044A3C60003C045 /* AppDelegate.swift */, - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, - 33E51913231747F40026EE4D /* DebugProfile.entitlements */, - 33E51914231749380026EE4D /* Release.entitlements */, - 33CC11242044D66E0003C045 /* Resources */, - 33BA886A226E78AF003329D5 /* Configs */, - ); - path = Runner; - sourceTree = ""; - }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 33CC10EC2044A3C60003C045 /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 33CC10E92044A3C60003C045 /* Sources */, - 33CC10EA2044A3C60003C045 /* Frameworks */, - 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 33CC11202044C79F0003C045 /* PBXTargetDependency */, - ); - name = Runner; - productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* loginapp.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 33CC10E52044A3C60003C045 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 33CC10EC2044A3C60003C045 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.Sandbox = { - enabled = 1; - }; - }; - }; - 33CC111A2044C6BA0003C045 = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 33CC10E42044A3C60003C045; - productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 33CC10EC2044A3C60003C045 /* Runner */, - 33CC111A2044C6BA0003C045 /* Flutter Assemble */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 33CC10EB2044A3C60003C045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; - }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, - ); - outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 33CC10E92044A3C60003C045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; - targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 33CC10F52044A3C60003C045 /* Base */, - ); - name = MainMenu.xib; - path = Runner; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 338D0CE9231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Profile; - }; - 338D0CEA231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Profile; - }; - 338D0CEB231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profile; - }; - 33CC10F92044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 33CC10FA2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - 33CC10FC2044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 33CC10FD2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 33CC111C2044C6BA0003C045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 33CC111D2044C6BA0003C045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10F92044A3C60003C045 /* Debug */, - 33CC10FA2044A3C60003C045 /* Release */, - 338D0CE9231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10FC2044A3C60003C045 /* Debug */, - 33CC10FD2044A3C60003C045 /* Release */, - 338D0CEA231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC111C2044C6BA0003C045 /* Debug */, - 33CC111D2044C6BA0003C045 /* Release */, - 338D0CEB231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 33CC10E52044A3C60003C045 /* Project object */; -} diff --git a/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100755 index fc6bf8074..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100755 index 6b9ff649a..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cloudbank-v2/flutter-app/macos/Runner.xcworkspace/contents.xcworkspacedata b/cloudbank-v2/flutter-app/macos/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100755 index 59c6d3946..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/cloudbank-v2/flutter-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cloudbank-v2/flutter-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100755 index fc6bf8074..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/cloudbank-v2/flutter-app/macos/Runner/AppDelegate.swift b/cloudbank-v2/flutter-app/macos/Runner/AppDelegate.swift deleted file mode 100755 index 553a135b0..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/AppDelegate.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Cocoa -import FlutterMacOS - -@NSApplicationMain -class AppDelegate: FlutterAppDelegate { - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return true - } -} diff --git a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100755 index 8d4e7cb8e..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" - }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png deleted file mode 100755 index 82b6f9d9a..000000000 Binary files a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png deleted file mode 100755 index 13b35eba5..000000000 Binary files a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png deleted file mode 100755 index 0a3f5fa40..000000000 Binary files a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png deleted file mode 100755 index bdb57226d..000000000 Binary files a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png deleted file mode 100755 index f083318e0..000000000 Binary files a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png deleted file mode 100755 index 326c0e72c..000000000 Binary files a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png deleted file mode 100755 index 2f1632cfd..000000000 Binary files a/cloudbank-v2/flutter-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/macos/Runner/Base.lproj/MainMenu.xib b/cloudbank-v2/flutter-app/macos/Runner/Base.lproj/MainMenu.xib deleted file mode 100755 index 4632c6967..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/Base.lproj/MainMenu.xib +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cloudbank-v2/flutter-app/macos/Runner/Configs/AppInfo.xcconfig b/cloudbank-v2/flutter-app/macos/Runner/Configs/AppInfo.xcconfig deleted file mode 100755 index 83ec234de..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/Configs/AppInfo.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// Application-level settings for the Runner target. -// -// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the -// future. If not, the values below would default to using the project name when this becomes a -// 'flutter create' template. - -// The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = loginapp - -// The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.loginapp - -// The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. diff --git a/cloudbank-v2/flutter-app/macos/Runner/Configs/Debug.xcconfig b/cloudbank-v2/flutter-app/macos/Runner/Configs/Debug.xcconfig deleted file mode 100755 index b39882372..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/Configs/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Debug.xcconfig" -#include "Warnings.xcconfig" diff --git a/cloudbank-v2/flutter-app/macos/Runner/Configs/Release.xcconfig b/cloudbank-v2/flutter-app/macos/Runner/Configs/Release.xcconfig deleted file mode 100755 index d93e5dc4a..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/Configs/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Release.xcconfig" -#include "Warnings.xcconfig" diff --git a/cloudbank-v2/flutter-app/macos/Runner/Configs/Warnings.xcconfig b/cloudbank-v2/flutter-app/macos/Runner/Configs/Warnings.xcconfig deleted file mode 100755 index fb4d7d3fb..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/Configs/Warnings.xcconfig +++ /dev/null @@ -1,13 +0,0 @@ -WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES -CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_PRAGMA_PACK = YES -CLANG_WARN_STRICT_PROTOTYPES = YES -CLANG_WARN_COMMA = YES -GCC_WARN_STRICT_SELECTOR_MATCH = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -GCC_WARN_SHADOW = YES -CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/cloudbank-v2/flutter-app/macos/Runner/DebugProfile.entitlements b/cloudbank-v2/flutter-app/macos/Runner/DebugProfile.entitlements deleted file mode 100755 index 51d096708..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/DebugProfile.entitlements +++ /dev/null @@ -1,12 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - diff --git a/cloudbank-v2/flutter-app/macos/Runner/Info.plist b/cloudbank-v2/flutter-app/macos/Runner/Info.plist deleted file mode 100755 index 3733c1a8e..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/cloudbank-v2/flutter-app/macos/Runner/MainFlutterWindow.swift b/cloudbank-v2/flutter-app/macos/Runner/MainFlutterWindow.swift deleted file mode 100755 index 4cb95dc98..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/MainFlutterWindow.swift +++ /dev/null @@ -1,15 +0,0 @@ -import Cocoa -import FlutterMacOS - -class MainFlutterWindow: NSWindow { - override func awakeFromNib() { - let flutterViewController = FlutterViewController.init() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - - RegisterGeneratedPlugins(registry: flutterViewController) - - super.awakeFromNib() - } -} diff --git a/cloudbank-v2/flutter-app/macos/Runner/Release.entitlements b/cloudbank-v2/flutter-app/macos/Runner/Release.entitlements deleted file mode 100755 index 04336df3c..000000000 --- a/cloudbank-v2/flutter-app/macos/Runner/Release.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.security.app-sandbox - - - diff --git a/cloudbank-v2/flutter-app/pubspec.lock b/cloudbank-v2/flutter-app/pubspec.lock deleted file mode 100755 index be742e883..000000000 --- a/cloudbank-v2/flutter-app/pubspec.lock +++ /dev/null @@ -1,642 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - args: - dependency: transitive - description: - name: args - sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" - url: "https://pub.dev" - source: hosted - version: "2.4.0" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.dev" - source: hosted - version: "1.17.1" - connectivity_plus: - dependency: transitive - description: - name: connectivity_plus - sha256: "3f8fe4e504c2d33696dac671a54909743bc6a902a9bb0902306f7a2aed7e528e" - url: "https://pub.dev" - source: hosted - version: "2.3.9" - connectivity_plus_linux: - dependency: transitive - description: - name: connectivity_plus_linux - sha256: "3caf859d001f10407b8e48134c761483e4495ae38094ffcca97193f6c271f5e2" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - connectivity_plus_macos: - dependency: transitive - description: - name: connectivity_plus_macos - sha256: "488d2de1e47e1224ad486e501b20b088686ba1f4ee9c4420ecbc3b9824f0b920" - url: "https://pub.dev" - source: hosted - version: "1.2.6" - connectivity_plus_platform_interface: - dependency: transitive - description: - name: connectivity_plus_platform_interface - sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a - url: "https://pub.dev" - source: hosted - version: "1.2.4" - connectivity_plus_web: - dependency: transitive - description: - name: connectivity_plus_web - sha256: "81332be1b4baf8898fed17bb4fdef27abb7c6fd990bf98c54fd978478adf2f1a" - url: "https://pub.dev" - source: hosted - version: "1.2.5" - connectivity_plus_windows: - dependency: transitive - description: - name: connectivity_plus_windows - sha256: "535b0404b4d5605c4dd8453d67e5d6d2ea0dd36e3b477f50f31af51b0aeab9dd" - url: "https://pub.dev" - source: hosted - version: "1.2.2" - crypto: - dependency: transitive - description: - name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 - url: "https://pub.dev" - source: hosted - version: "3.0.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be - url: "https://pub.dev" - source: hosted - version: "1.0.5" - dbus: - dependency: transitive - description: - name: dbus - sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" - url: "https://pub.dev" - source: hosted - version: "0.7.8" - dio: - dependency: transitive - description: - name: dio - sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" - url: "https://pub.dev" - source: hosted - version: "4.0.6" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - file: - dependency: transitive - description: - name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" - source: hosted - version: "6.1.4" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c - url: "https://pub.dev" - source: hosted - version: "2.0.1" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - go_router: - dependency: "direct main" - description: - name: go_router - sha256: "22c1e44fced320c4a7dbdf16545cad71829dd617910fe2604449267f2c6c11ce" - url: "https://pub.dev" - source: hosted - version: "6.0.8" - http: - dependency: "direct main" - description: - name: http - sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" - url: "https://pub.dev" - source: hosted - version: "0.13.5" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - idb_shim: - dependency: transitive - description: - name: idb_shim - sha256: "7e2ad3d36a4eb549813d1ef10694c0f1fd5b4713a2021f19569c752e74b54cef" - url: "https://pub.dev" - source: hosted - version: "2.3.0+1" - intl: - dependency: "direct main" - description: - name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 - url: "https://pub.dev" - source: hosted - version: "0.18.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" - lints: - dependency: transitive - description: - name: lints - sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" - url: "https://pub.dev" - source: hosted - version: "2.0.1" - logging: - dependency: transitive - description: - name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - matcher: - dependency: transitive - description: - name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" - url: "https://pub.dev" - source: hosted - version: "0.12.15" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.dev" - source: hosted - version: "0.2.0" - meta: - dependency: transitive - description: - name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - mime_type: - dependency: transitive - description: - name: mime_type - sha256: "2ad6e67d3d2de9ac0f8ef5352d998fd103cb21351ae8c02fb0c78b079b37d275" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - nm: - dependency: transitive - description: - name: nm - sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" - url: "https://pub.dev" - source: hosted - version: "0.5.0" - package_info_plus: - dependency: transitive - description: - name: package_info_plus - sha256: f62d7253edc197fe3c88d7c2ddab82d68f555e778d55390ccc3537eca8e8d637 - url: "https://pub.dev" - source: hosted - version: "1.4.3+1" - package_info_plus_linux: - dependency: transitive - description: - name: package_info_plus_linux - sha256: "04b575f44233d30edbb80a94e57cad9107aada334fc02aabb42b6becd13c43fc" - url: "https://pub.dev" - source: hosted - version: "1.0.5" - package_info_plus_macos: - dependency: transitive - description: - name: package_info_plus_macos - sha256: a2ad8b4acf4cd479d4a0afa5a74ea3f5b1c7563b77e52cc32b3ee6956d5482a6 - url: "https://pub.dev" - source: hosted - version: "1.3.0" - package_info_plus_platform_interface: - dependency: transitive - description: - name: package_info_plus_platform_interface - sha256: f7a0c8f1e7e981bc65f8b64137a53fd3c195b18d429fba960babc59a5a1c7ae8 - url: "https://pub.dev" - source: hosted - version: "1.0.2" - package_info_plus_web: - dependency: transitive - description: - name: package_info_plus_web - sha256: f0829327eb534789e0a16ccac8936a80beed4e2401c4d3a74f3f39094a822d3b - url: "https://pub.dev" - source: hosted - version: "1.0.6" - package_info_plus_windows: - dependency: transitive - description: - name: package_info_plus_windows - sha256: "79524f11c42dd9078b96d797b3cf79c0a2883a50c4920dc43da8562c115089bc" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - parse_server_sdk: - dependency: transitive - description: - name: parse_server_sdk - sha256: "027000ce972dcbf318ede216f5b7d9e040eeb6f2f6162721b5c16bb2bf7be70e" - url: "https://pub.dev" - source: hosted - version: "3.1.13" - parse_server_sdk_flutter: - dependency: "direct main" - description: - name: parse_server_sdk_flutter - sha256: "3462b895ef87a5847de1f2996f7bc252527345f451e25bfc74373692982ae80a" - url: "https://pub.dev" - source: hosted - version: "3.1.3" - path: - dependency: transitive - description: - name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - path_provider: - dependency: transitive - description: - name: path_provider - sha256: dcea5feb97d8abf90cab9e9030b497fb7c3cbf26b7a1fe9e3ef7dcb0a1ddec95 - url: "https://pub.dev" - source: hosted - version: "2.0.12" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: a776c088d671b27f6e3aa8881d64b87b3e80201c64e8869b811325de7a76c15e - url: "https://pub.dev" - source: hosted - version: "2.0.22" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: "62a68e7e1c6c459f9289859e2fae58290c981ce21d1697faf54910fe1faa4c74" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: "2e32f1640f07caef0d3cb993680f181c79e54a3827b997d5ee221490d131fbd9" - url: "https://pub.dev" - source: hosted - version: "2.1.8" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76 - url: "https://pub.dev" - source: hosted - version: "2.0.5" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c - url: "https://pub.dev" - source: hosted - version: "2.1.3" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" - url: "https://pub.dev" - source: hosted - version: "5.1.0" - platform: - dependency: transitive - description: - name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a - url: "https://pub.dev" - source: hosted - version: "2.1.3" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" - sembast: - dependency: transitive - description: - name: sembast - sha256: "4997717aa84f0622691815d7e2739988b7f7d3a463302fc878f7d5acfa748e96" - url: "https://pub.dev" - source: hosted - version: "3.4.0+6" - sembast_web: - dependency: transitive - description: - name: sembast_web - sha256: ceed2e7df09ed553878e482e56f1cc7d4b86905df0b6735bd577d2ff4620c2c3 - url: "https://pub.dev" - source: hosted - version: "2.1.0+4" - shared_preferences: - dependency: transitive - description: - name: shared_preferences - sha256: "5949029e70abe87f75cfe59d17bf5c397619c4b74a099b10116baeb34786fad9" - url: "https://pub.dev" - source: hosted - version: "2.0.17" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - sha256: "955e9736a12ba776bdd261cf030232b30eadfcd9c79b32a3250dd4a494e8c8f7" - url: "https://pub.dev" - source: hosted - version: "2.0.15" - shared_preferences_foundation: - dependency: transitive - description: - name: shared_preferences_foundation - sha256: "2b55c18636a4edc529fa5cd44c03d3f3100c00513f518c5127c951978efcccd0" - url: "https://pub.dev" - source: hosted - version: "2.1.3" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - sha256: f8ea038aa6da37090093974ebdcf4397010605fd2ff65c37a66f9d28394cb874 - url: "https://pub.dev" - source: hosted - version: "2.1.3" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - sha256: da9431745ede5ece47bc26d5d73a9d3c6936ef6945c101a5aca46f62e52c1cf3 - url: "https://pub.dev" - source: hosted - version: "2.1.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958 - url: "https://pub.dev" - source: hosted - version: "2.0.4" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - sha256: "5eaf05ae77658d3521d0e993ede1af962d4b326cd2153d312df716dc250f00c9" - url: "https://pub.dev" - source: hosted - version: "2.1.3" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" - source: hosted - version: "1.9.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" - source: hosted - version: "1.11.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - synchronized: - dependency: transitive - description: - name: synchronized - sha256: "33b31b6beb98100bf9add464a36a8dd03eb10c7a8cf15aeec535e9b054aaf04b" - url: "https://pub.dev" - source: hosted - version: "3.0.1" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb - url: "https://pub.dev" - source: hosted - version: "0.5.1" - timezone: - dependency: transitive - description: - name: timezone - sha256: "24c8fcdd49a805d95777a39064862133ff816ebfffe0ceff110fb5960e557964" - url: "https://pub.dev" - source: hosted - version: "0.9.1" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - uuid: - dependency: transitive - description: - name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" - url: "https://pub.dev" - source: hosted - version: "3.0.7" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b - url: "https://pub.dev" - source: hosted - version: "2.3.0" - win32: - dependency: transitive - description: - name: win32 - sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 - url: "https://pub.dev" - source: hosted - version: "3.1.3" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 - url: "https://pub.dev" - source: hosted - version: "1.0.0" - xml: - dependency: transitive - description: - name: xml - sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb - url: "https://pub.dev" - source: hosted - version: "6.1.0" - xxtea: - dependency: transitive - description: - name: xxtea - sha256: edd57229638e16e88f4bb299737fe76a235d0f11da6df8573b3c7f28dec283ce - url: "https://pub.dev" - source: hosted - version: "2.1.0" -sdks: - dart: ">=3.0.0-0 <4.0.0" - flutter: ">=3.3.0" diff --git a/cloudbank-v2/flutter-app/pubspec.yaml b/cloudbank-v2/flutter-app/pubspec.yaml deleted file mode 100755 index cc7dfe11e..000000000 --- a/cloudbank-v2/flutter-app/pubspec.yaml +++ /dev/null @@ -1,95 +0,0 @@ -name: loginapp -description: A new Flutter project. - -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 - -environment: - sdk: '>=2.18.5 <3.0.0' - -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. -dependencies: - flutter: - sdk: flutter - - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 - parse_server_sdk_flutter: ^3.1.3 - go_router: ^6.0.8 - http: ^0.13.5 - intl: ^0.18.0 - -dev_dependencies: - flutter_test: - sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^2.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/cloudbank-v2/flutter-app/test/widget_test.dart b/cloudbank-v2/flutter-app/test/widget_test.dart deleted file mode 100755 index 077536ff7..000000000 --- a/cloudbank-v2/flutter-app/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:loginapp/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/cloudbank-v2/flutter-app/web/favicon.png b/cloudbank-v2/flutter-app/web/favicon.png deleted file mode 100755 index 8aaa46ac1..000000000 Binary files a/cloudbank-v2/flutter-app/web/favicon.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/web/icons/Icon-192.png b/cloudbank-v2/flutter-app/web/icons/Icon-192.png deleted file mode 100755 index b749bfef0..000000000 Binary files a/cloudbank-v2/flutter-app/web/icons/Icon-192.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/web/icons/Icon-512.png b/cloudbank-v2/flutter-app/web/icons/Icon-512.png deleted file mode 100755 index 88cfd48df..000000000 Binary files a/cloudbank-v2/flutter-app/web/icons/Icon-512.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/web/icons/Icon-maskable-192.png b/cloudbank-v2/flutter-app/web/icons/Icon-maskable-192.png deleted file mode 100755 index eb9b4d76e..000000000 Binary files a/cloudbank-v2/flutter-app/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/web/icons/Icon-maskable-512.png b/cloudbank-v2/flutter-app/web/icons/Icon-maskable-512.png deleted file mode 100755 index d69c56691..000000000 Binary files a/cloudbank-v2/flutter-app/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/cloudbank-v2/flutter-app/web/index.html b/cloudbank-v2/flutter-app/web/index.html deleted file mode 100755 index 506aabace..000000000 --- a/cloudbank-v2/flutter-app/web/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - loginapp - - - - - - - - - - diff --git a/cloudbank-v2/flutter-app/web/manifest.json b/cloudbank-v2/flutter-app/web/manifest.json deleted file mode 100755 index 9bf27d189..000000000 --- a/cloudbank-v2/flutter-app/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "loginapp", - "short_name": "loginapp", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/cloudbank-v2/flutter-app/windows/.gitignore b/cloudbank-v2/flutter-app/windows/.gitignore deleted file mode 100755 index ec4098aa6..000000000 --- a/cloudbank-v2/flutter-app/windows/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -flutter/ephemeral/ - -# Visual Studio user-specific files. -*.suo -*.user -*.userosscache -*.sln.docstates - -# Visual Studio build-related files. -x64/ -x86/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ diff --git a/cloudbank-v2/flutter-app/windows/CMakeLists.txt b/cloudbank-v2/flutter-app/windows/CMakeLists.txt deleted file mode 100755 index d6451d20e..000000000 --- a/cloudbank-v2/flutter-app/windows/CMakeLists.txt +++ /dev/null @@ -1,101 +0,0 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.14) -project(loginapp LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "loginapp") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(SET CMP0063 NEW) - -# Define build configuration option. -get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" - CACHE STRING "" FORCE) -else() - if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") - endif() -endif() -# Define settings for the Profile build mode. -set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") -set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") -set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") -set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") - -# Use Unicode for all projects. -add_definitions(-DUNICODE -D_UNICODE) - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_17) - target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") - target_compile_options(${TARGET} PRIVATE /EHsc) - target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") - target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# Support files are copied into place next to the executable, so that it can -# run in place. This is done instead of making a separate bundle (as on Linux) -# so that building and running from within Visual Studio will work. -set(BUILD_BUNDLE_DIR "$") -# Make the "install" step default, as it's required to run. -set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - CONFIGURATIONS Profile;Release - COMPONENT Runtime) diff --git a/cloudbank-v2/flutter-app/windows/flutter/CMakeLists.txt b/cloudbank-v2/flutter-app/windows/flutter/CMakeLists.txt deleted file mode 100755 index 3f71e1736..000000000 --- a/cloudbank-v2/flutter-app/windows/flutter/CMakeLists.txt +++ /dev/null @@ -1,104 +0,0 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.14) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. -set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") - -# === Flutter Library === -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "flutter_export.h" - "flutter_windows.h" - "flutter_messenger.h" - "flutter_plugin_registrar.h" - "flutter_texture_registrar.h" -) -list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") -add_dependencies(flutter flutter_assemble) - -# === Wrapper === -list(APPEND CPP_WRAPPER_SOURCES_CORE - "core_implementations.cc" - "standard_codec.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_PLUGIN - "plugin_registrar.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_APP - "flutter_engine.cc" - "flutter_view_controller.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") - -# Wrapper sources needed for a plugin. -add_library(flutter_wrapper_plugin STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} -) -apply_standard_settings(flutter_wrapper_plugin) -set_target_properties(flutter_wrapper_plugin PROPERTIES - POSITION_INDEPENDENT_CODE ON) -set_target_properties(flutter_wrapper_plugin PROPERTIES - CXX_VISIBILITY_PRESET hidden) -target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) -target_include_directories(flutter_wrapper_plugin PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_plugin flutter_assemble) - -# Wrapper sources needed for the runner. -add_library(flutter_wrapper_app STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_APP} -) -apply_standard_settings(flutter_wrapper_app) -target_link_libraries(flutter_wrapper_app PUBLIC flutter) -target_include_directories(flutter_wrapper_app PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_app flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") -set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} - ${PHONY_OUTPUT} - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - windows-x64 $ - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} -) diff --git a/cloudbank-v2/flutter-app/windows/flutter/generated_plugin_registrant.cc b/cloudbank-v2/flutter-app/windows/flutter/generated_plugin_registrant.cc deleted file mode 100755 index 8083d749b..000000000 --- a/cloudbank-v2/flutter-app/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,14 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include - -void RegisterPlugins(flutter::PluginRegistry* registry) { - ConnectivityPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); -} diff --git a/cloudbank-v2/flutter-app/windows/flutter/generated_plugin_registrant.h b/cloudbank-v2/flutter-app/windows/flutter/generated_plugin_registrant.h deleted file mode 100755 index dc139d85a..000000000 --- a/cloudbank-v2/flutter-app/windows/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void RegisterPlugins(flutter::PluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/cloudbank-v2/flutter-app/windows/flutter/generated_plugins.cmake b/cloudbank-v2/flutter-app/windows/flutter/generated_plugins.cmake deleted file mode 100755 index 8cf5d4267..000000000 --- a/cloudbank-v2/flutter-app/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - connectivity_plus_windows -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/cloudbank-v2/flutter-app/windows/runner/CMakeLists.txt b/cloudbank-v2/flutter-app/windows/runner/CMakeLists.txt deleted file mode 100755 index c832c4b1d..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} WIN32 - "flutter_window.cpp" - "main.cpp" - "utils.cpp" - "win32_window.cpp" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" - "Runner.rc" - "runner.exe.manifest" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the build version. -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") - -# Disable Windows macros that collide with C++ standard library functions. -target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") - -# Add dependency libraries and include directories. Add any application-specific -# dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/cloudbank-v2/flutter-app/windows/runner/Runner.rc b/cloudbank-v2/flutter-app/windows/runner/Runner.rc deleted file mode 100755 index 92ea99437..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/Runner.rc +++ /dev/null @@ -1,121 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#pragma code_page(65001) -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_APP_ICON ICON "resources\\app_icon.ico" - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) -#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD -#else -#define VERSION_AS_NUMBER 1,0,0,0 -#endif - -#if defined(FLUTTER_VERSION) -#define VERSION_AS_STRING FLUTTER_VERSION -#else -#define VERSION_AS_STRING "1.0.0" -#endif - -VS_VERSION_INFO VERSIONINFO - FILEVERSION VERSION_AS_NUMBER - PRODUCTVERSION VERSION_AS_NUMBER - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "loginapp" "\0" - VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "loginapp" "\0" - VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "loginapp.exe" "\0" - VALUE "ProductName", "loginapp" "\0" - VALUE "ProductVersion", VERSION_AS_STRING "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/cloudbank-v2/flutter-app/windows/runner/flutter_window.cpp b/cloudbank-v2/flutter-app/windows/runner/flutter_window.cpp deleted file mode 100755 index 3a11b51d9..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/flutter_window.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "flutter_window.h" - -#include - -#include "flutter/generated_plugin_registrant.h" - -FlutterWindow::FlutterWindow(const flutter::DartProject& project) - : project_(project) {} - -FlutterWindow::~FlutterWindow() {} - -bool FlutterWindow::OnCreate() { - if (!Win32Window::OnCreate()) { - return false; - } - - RECT frame = GetClientArea(); - - // The size here must match the window dimensions to avoid unnecessary surface - // creation / destruction in the startup path. - flutter_controller_ = std::make_unique( - frame.right - frame.left, frame.bottom - frame.top, project_); - // Ensure that basic setup of the controller was successful. - if (!flutter_controller_->engine() || !flutter_controller_->view()) { - return false; - } - RegisterPlugins(flutter_controller_->engine()); - SetChildContent(flutter_controller_->view()->GetNativeWindow()); - return true; -} - -void FlutterWindow::OnDestroy() { - if (flutter_controller_) { - flutter_controller_ = nullptr; - } - - Win32Window::OnDestroy(); -} - -LRESULT -FlutterWindow::MessageHandler(HWND hwnd, UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - // Give Flutter, including plugins, an opportunity to handle window messages. - if (flutter_controller_) { - std::optional result = - flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, - lparam); - if (result) { - return *result; - } - } - - switch (message) { - case WM_FONTCHANGE: - flutter_controller_->engine()->ReloadSystemFonts(); - break; - } - - return Win32Window::MessageHandler(hwnd, message, wparam, lparam); -} diff --git a/cloudbank-v2/flutter-app/windows/runner/flutter_window.h b/cloudbank-v2/flutter-app/windows/runner/flutter_window.h deleted file mode 100755 index 28c23839b..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/flutter_window.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef RUNNER_FLUTTER_WINDOW_H_ -#define RUNNER_FLUTTER_WINDOW_H_ - -#include -#include - -#include - -#include "win32_window.h" - -// A window that does nothing but host a Flutter view. -class FlutterWindow : public Win32Window { - public: - // Creates a new FlutterWindow hosting a Flutter view running |project|. - explicit FlutterWindow(const flutter::DartProject& project); - virtual ~FlutterWindow(); - - protected: - // Win32Window: - bool OnCreate() override; - void OnDestroy() override; - LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, - LPARAM const lparam) noexcept override; - - private: - // The project to run. - flutter::DartProject project_; - - // The Flutter instance hosted by this window. - std::unique_ptr flutter_controller_; -}; - -#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/cloudbank-v2/flutter-app/windows/runner/main.cpp b/cloudbank-v2/flutter-app/windows/runner/main.cpp deleted file mode 100755 index 1558883d1..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -#include "flutter_window.h" -#include "utils.h" - -int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, - _In_ wchar_t *command_line, _In_ int show_command) { - // Attach to console when present (e.g., 'flutter run') or create a - // new console when running with a debugger. - if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { - CreateAndAttachConsole(); - } - - // Initialize COM, so that it is available for use in the library and/or - // plugins. - ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - - flutter::DartProject project(L"data"); - - std::vector command_line_arguments = - GetCommandLineArguments(); - - project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); - - FlutterWindow window(project); - Win32Window::Point origin(10, 10); - Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"loginapp", origin, size)) { - return EXIT_FAILURE; - } - window.SetQuitOnClose(true); - - ::MSG msg; - while (::GetMessage(&msg, nullptr, 0, 0)) { - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - - ::CoUninitialize(); - return EXIT_SUCCESS; -} diff --git a/cloudbank-v2/flutter-app/windows/runner/resource.h b/cloudbank-v2/flutter-app/windows/runner/resource.h deleted file mode 100755 index ddc7f3efc..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Runner.rc -// -#define IDI_APP_ICON 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/cloudbank-v2/flutter-app/windows/runner/resources/app_icon.ico b/cloudbank-v2/flutter-app/windows/runner/resources/app_icon.ico deleted file mode 100755 index c04e20caf..000000000 Binary files a/cloudbank-v2/flutter-app/windows/runner/resources/app_icon.ico and /dev/null differ diff --git a/cloudbank-v2/flutter-app/windows/runner/runner.exe.manifest b/cloudbank-v2/flutter-app/windows/runner/runner.exe.manifest deleted file mode 100755 index 157e871fe..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/runner.exe.manifest +++ /dev/null @@ -1,20 +0,0 @@ - - - - - PerMonitorV2 - - - - - - - - - - - - - - - diff --git a/cloudbank-v2/flutter-app/windows/runner/utils.cpp b/cloudbank-v2/flutter-app/windows/runner/utils.cpp deleted file mode 100755 index 92ed54721..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/utils.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "utils.h" - -#include -#include -#include -#include - -#include - -void CreateAndAttachConsole() { - if (::AllocConsole()) { - FILE *unused; - if (freopen_s(&unused, "CONOUT$", "w", stdout)) { - _dup2(_fileno(stdout), 1); - } - if (freopen_s(&unused, "CONOUT$", "w", stderr)) { - _dup2(_fileno(stdout), 2); - } - std::ios::sync_with_stdio(); - FlutterDesktopResyncOutputStreams(); - } -} - -std::vector GetCommandLineArguments() { - // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. - int argc; - wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - if (argv == nullptr) { - return std::vector(); - } - - std::vector command_line_arguments; - - // Skip the first argument as it's the binary name. - for (int i = 1; i < argc; i++) { - command_line_arguments.push_back(Utf8FromUtf16(argv[i])); - } - - ::LocalFree(argv); - - return command_line_arguments; -} - -std::string Utf8FromUtf16(const wchar_t* utf16_string) { - if (utf16_string == nullptr) { - return std::string(); - } - int target_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr); - std::string utf8_string; - if (target_length == 0 || target_length > utf8_string.max_size()) { - return utf8_string; - } - utf8_string.resize(target_length); - int converted_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, utf8_string.data(), - target_length, nullptr, nullptr); - if (converted_length == 0) { - return std::string(); - } - return utf8_string; -} diff --git a/cloudbank-v2/flutter-app/windows/runner/utils.h b/cloudbank-v2/flutter-app/windows/runner/utils.h deleted file mode 100755 index 3f0e05cba..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/utils.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RUNNER_UTILS_H_ -#define RUNNER_UTILS_H_ - -#include -#include - -// Creates a console for the process, and redirects stdout and stderr to -// it for both the runner and the Flutter library. -void CreateAndAttachConsole(); - -// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string -// encoded in UTF-8. Returns an empty std::string on failure. -std::string Utf8FromUtf16(const wchar_t* utf16_string); - -// Gets the command line arguments passed in as a std::vector, -// encoded in UTF-8. Returns an empty std::vector on failure. -std::vector GetCommandLineArguments(); - -#endif // RUNNER_UTILS_H_ diff --git a/cloudbank-v2/flutter-app/windows/runner/win32_window.cpp b/cloudbank-v2/flutter-app/windows/runner/win32_window.cpp deleted file mode 100755 index 97f4439cd..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/win32_window.cpp +++ /dev/null @@ -1,245 +0,0 @@ -#include "win32_window.h" - -#include - -#include "resource.h" - -namespace { - -constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; - -// The number of Win32Window objects that currently exist. -static int g_active_window_count = 0; - -using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); - -// Scale helper to convert logical scaler values to physical using passed in -// scale factor -int Scale(int source, double scale_factor) { - return static_cast(source * scale_factor); -} - -// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. -// This API is only needed for PerMonitor V1 awareness mode. -void EnableFullDpiSupportIfAvailable(HWND hwnd) { - HMODULE user32_module = LoadLibraryA("User32.dll"); - if (!user32_module) { - return; - } - auto enable_non_client_dpi_scaling = - reinterpret_cast( - GetProcAddress(user32_module, "EnableNonClientDpiScaling")); - if (enable_non_client_dpi_scaling != nullptr) { - enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); - } -} - -} // namespace - -// Manages the Win32Window's window class registration. -class WindowClassRegistrar { - public: - ~WindowClassRegistrar() = default; - - // Returns the singleton registar instance. - static WindowClassRegistrar* GetInstance() { - if (!instance_) { - instance_ = new WindowClassRegistrar(); - } - return instance_; - } - - // Returns the name of the window class, registering the class if it hasn't - // previously been registered. - const wchar_t* GetWindowClass(); - - // Unregisters the window class. Should only be called if there are no - // instances of the window. - void UnregisterWindowClass(); - - private: - WindowClassRegistrar() = default; - - static WindowClassRegistrar* instance_; - - bool class_registered_ = false; -}; - -WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; - -const wchar_t* WindowClassRegistrar::GetWindowClass() { - if (!class_registered_) { - WNDCLASS window_class{}; - window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); - window_class.lpszClassName = kWindowClassName; - window_class.style = CS_HREDRAW | CS_VREDRAW; - window_class.cbClsExtra = 0; - window_class.cbWndExtra = 0; - window_class.hInstance = GetModuleHandle(nullptr); - window_class.hIcon = - LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); - window_class.hbrBackground = 0; - window_class.lpszMenuName = nullptr; - window_class.lpfnWndProc = Win32Window::WndProc; - RegisterClass(&window_class); - class_registered_ = true; - } - return kWindowClassName; -} - -void WindowClassRegistrar::UnregisterWindowClass() { - UnregisterClass(kWindowClassName, nullptr); - class_registered_ = false; -} - -Win32Window::Win32Window() { - ++g_active_window_count; -} - -Win32Window::~Win32Window() { - --g_active_window_count; - Destroy(); -} - -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { - Destroy(); - - const wchar_t* window_class = - WindowClassRegistrar::GetInstance()->GetWindowClass(); - - const POINT target_point = {static_cast(origin.x), - static_cast(origin.y)}; - HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); - UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); - double scale_factor = dpi / 96.0; - - HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, - Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), - Scale(size.width, scale_factor), Scale(size.height, scale_factor), - nullptr, nullptr, GetModuleHandle(nullptr), this); - - if (!window) { - return false; - } - - return OnCreate(); -} - -// static -LRESULT CALLBACK Win32Window::WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - if (message == WM_NCCREATE) { - auto window_struct = reinterpret_cast(lparam); - SetWindowLongPtr(window, GWLP_USERDATA, - reinterpret_cast(window_struct->lpCreateParams)); - - auto that = static_cast(window_struct->lpCreateParams); - EnableFullDpiSupportIfAvailable(window); - that->window_handle_ = window; - } else if (Win32Window* that = GetThisFromHandle(window)) { - return that->MessageHandler(window, message, wparam, lparam); - } - - return DefWindowProc(window, message, wparam, lparam); -} - -LRESULT -Win32Window::MessageHandler(HWND hwnd, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - switch (message) { - case WM_DESTROY: - window_handle_ = nullptr; - Destroy(); - if (quit_on_close_) { - PostQuitMessage(0); - } - return 0; - - case WM_DPICHANGED: { - auto newRectSize = reinterpret_cast(lparam); - LONG newWidth = newRectSize->right - newRectSize->left; - LONG newHeight = newRectSize->bottom - newRectSize->top; - - SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, - newHeight, SWP_NOZORDER | SWP_NOACTIVATE); - - return 0; - } - case WM_SIZE: { - RECT rect = GetClientArea(); - if (child_content_ != nullptr) { - // Size and position the child window. - MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, TRUE); - } - return 0; - } - - case WM_ACTIVATE: - if (child_content_ != nullptr) { - SetFocus(child_content_); - } - return 0; - } - - return DefWindowProc(window_handle_, message, wparam, lparam); -} - -void Win32Window::Destroy() { - OnDestroy(); - - if (window_handle_) { - DestroyWindow(window_handle_); - window_handle_ = nullptr; - } - if (g_active_window_count == 0) { - WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); - } -} - -Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { - return reinterpret_cast( - GetWindowLongPtr(window, GWLP_USERDATA)); -} - -void Win32Window::SetChildContent(HWND content) { - child_content_ = content; - SetParent(content, window_handle_); - RECT frame = GetClientArea(); - - MoveWindow(content, frame.left, frame.top, frame.right - frame.left, - frame.bottom - frame.top, true); - - SetFocus(child_content_); -} - -RECT Win32Window::GetClientArea() { - RECT frame; - GetClientRect(window_handle_, &frame); - return frame; -} - -HWND Win32Window::GetHandle() { - return window_handle_; -} - -void Win32Window::SetQuitOnClose(bool quit_on_close) { - quit_on_close_ = quit_on_close; -} - -bool Win32Window::OnCreate() { - // No-op; provided for subclasses. - return true; -} - -void Win32Window::OnDestroy() { - // No-op; provided for subclasses. -} diff --git a/cloudbank-v2/flutter-app/windows/runner/win32_window.h b/cloudbank-v2/flutter-app/windows/runner/win32_window.h deleted file mode 100755 index d9bcac1b6..000000000 --- a/cloudbank-v2/flutter-app/windows/runner/win32_window.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef RUNNER_WIN32_WINDOW_H_ -#define RUNNER_WIN32_WINDOW_H_ - -#include - -#include -#include -#include - -// A class abstraction for a high DPI-aware Win32 Window. Intended to be -// inherited from by classes that wish to specialize with custom -// rendering and input handling -class Win32Window { - public: - struct Point { - unsigned int x; - unsigned int y; - Point(unsigned int x, unsigned int y) : x(x), y(y) {} - }; - - struct Size { - unsigned int width; - unsigned int height; - Size(unsigned int width, unsigned int height) - : width(width), height(height) {} - }; - - Win32Window(); - virtual ~Win32Window(); - - // Creates and shows a win32 window with |title| and position and size using - // |origin| and |size|. New windows are created on the default monitor. Window - // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); - - // Release OS resources associated with window. - void Destroy(); - - // Inserts |content| into the window tree. - void SetChildContent(HWND content); - - // Returns the backing Window handle to enable clients to set icon and other - // window properties. Returns nullptr if the window has been destroyed. - HWND GetHandle(); - - // If true, closing this window will quit the application. - void SetQuitOnClose(bool quit_on_close); - - // Return a RECT representing the bounds of the current client area. - RECT GetClientArea(); - - protected: - // Processes and route salient window messages for mouse handling, - // size change and DPI. Delegates handling of these to member overloads that - // inheriting classes can handle. - virtual LRESULT MessageHandler(HWND window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Called when CreateAndShow is called, allowing subclass window-related - // setup. Subclasses should return false if setup fails. - virtual bool OnCreate(); - - // Called when Destroy is called. - virtual void OnDestroy(); - - private: - friend class WindowClassRegistrar; - - // OS callback called by message pump. Handles the WM_NCCREATE message which - // is passed when the non-client area is being created and enables automatic - // non-client DPI scaling so that the non-client area automatically - // responsponds to changes in DPI. All other messages are handled by - // MessageHandler. - static LRESULT CALLBACK WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Retrieves a class instance pointer for |window| - static Win32Window* GetThisFromHandle(HWND const window) noexcept; - - bool quit_on_close_ = false; - - // window handle for top level window. - HWND window_handle_ = nullptr; - - // window handle for hosted content. - HWND child_content_ = nullptr; -}; - -#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/cloudbank-v2/spring-apps/.placeholder b/cloudbank-v2/spring-apps/.placeholder deleted file mode 100644 index e69de29bb..000000000 diff --git a/cloudbank-v2/spring-apps/README.md b/cloudbank-v2/spring-apps/README.md deleted file mode 100644 index 132b9fb51..000000000 --- a/cloudbank-v2/spring-apps/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# CloudBank - -This Flutter project is used in the [Oracle Backend Platform for Microservices with Oracle Database](https://apexapps.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=3607) Live Lab, in Labs 3, 4 and 5. Please visit the Live Lab for more information. \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/pom.xml b/cloudbank-v2/spring-apps/account/pom.xml deleted file mode 100644 index e8ec22730..000000000 --- a/cloudbank-v2/spring-apps/account/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - 4.0.0 - - - com.example - sample-spring-apps - 0.0.1-SNAPSHOT - - - account - 0.0.1-SNAPSHOT - account - Account Application - - - 1.0 - 5.13.1.Final - 2.0.2 - 2.7.7 - 4.19.0 - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - javax.ws.rs - jsr311-api - - - javax.servlet - servlet-api - - - - - org.springframework.boot - spring-boot-starter-jersey - - - com.oracle.database.spring - oracle-spring-boot-starter-ucp - ${oracle-springboot-starter.version} - pom - - - com.oracle.database.spring - oracle-spring-boot-starter-wallet - ${oracle-springboot-starter.version} - pom - - - org.liquibase - liquibase-core - ${liquibase.version} - - - org.eclipse.microprofile.lra - microprofile-lra-api - ${microprofile-lra-api.version} - - - org.jboss.narayana.rts - narayana-lra - ${narayana-lra.version} - - - jakarta.enterprise - jakarta.enterprise.cdi-api - ${jakarta.enterprise.cdi-api.version} - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.projectlombok - lombok - - - - - - org.liquibase - liquibase-maven-plugin - - - - - diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/AccountsApplication.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/AccountsApplication.java deleted file mode 100644 index 26784ed17..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/AccountsApplication.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class AccountsApplication { - - public static void main(String[] args) { - SpringApplication.run(AccountsApplication.class, args); - } - -} diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/ApplicationConfig.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/ApplicationConfig.java deleted file mode 100644 index d6e5dda9d..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/ApplicationConfig.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts; - -import java.net.URISyntaxException; -import java.util.logging.Logger; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import io.narayana.lra.client.NarayanaLRAClient; - -@Configuration -public class ApplicationConfig { - private static final Logger log = Logger.getLogger(ApplicationConfig.class.getName()); - - public ApplicationConfig(@Value("${lra.coordinator.url}") String lraCoordinatorUrl) { - log.info(NarayanaLRAClient.LRA_COORDINATOR_URL_KEY + " = " + lraCoordinatorUrl); - System.getProperties().setProperty(NarayanaLRAClient.LRA_COORDINATOR_URL_KEY, lraCoordinatorUrl); - } - - @Bean - public NarayanaLRAClient NarayanaLRAClient() throws URISyntaxException { - return new NarayanaLRAClient(); - } -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/JerseyConfig.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/JerseyConfig.java deleted file mode 100644 index ec118436c..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/JerseyConfig.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts; - -import javax.ws.rs.ApplicationPath; - -import org.glassfish.hk2.utilities.binding.AbstractBinder; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.servlet.ServletProperties; -import org.springframework.stereotype.Component; - -import com.example.accounts.services.DepositService; -import com.example.accounts.services.WithdrawService; - -import io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipantRegistry; - -@Component -@ApplicationPath("/") -public class JerseyConfig extends ResourceConfig { - - public JerseyConfig() { - register(DepositService.class); - register(WithdrawService.class); - register(io.narayana.lra.filter.ServerLRAFilter.class); - register(new AbstractBinder(){ - @Override - protected void configure() { - bind(LRAParticipantRegistry.class) - .to(LRAParticipantRegistry.class); - } - }); - property(ServletProperties.FILTER_FORWARD_ON_404, true); - } -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/controller/AccountController.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/controller/AccountController.java deleted file mode 100644 index b57165f8d..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/controller/AccountController.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts.controller; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.example.accounts.repository.AccountRepository; -import com.example.accounts.repository.JournalRepository; -import java.util.List; -import com.example.accounts.model.Account; -import com.example.accounts.model.Journal; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PathVariable; -import java.util.ArrayList; -import java.util.Optional; -import org.springframework.web.bind.annotation.DeleteMapping; - -@RestController -@RequestMapping("/api/v1") -public class AccountController { - - final AccountRepository accountRepository; - final JournalRepository journalRepository; - - @GetMapping("/hello") - public String ping() { - return "Hello from Spring Boot"; - } - - public AccountController(AccountRepository accountRepository, JournalRepository journalRepository) { - this.accountRepository = accountRepository; - this.journalRepository = journalRepository; - } - - @GetMapping("/accounts") - public List getAllAccounts() { - return accountRepository.findAll(); - } - - @PostMapping("/account") - public ResponseEntity createAccount(@RequestBody Account account) { - try { - Account _account = accountRepository.saveAndFlush(account); - return new ResponseEntity<>(_account, HttpStatus.CREATED); - } catch (Exception e) { - return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); - } - } - - @GetMapping("/account/{accountId}") - public ResponseEntity getAccountById(@PathVariable("accountId") long accountId) { - Optional accountData = accountRepository.findById(accountId); - try { - return accountData.map(account -> new ResponseEntity<>(account, HttpStatus.OK)) - .orElseGet(() -> new ResponseEntity<>(HttpStatus.NOT_FOUND)); - } catch (Exception e) { - return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); - } - } - - @GetMapping("/account/getAccounts/{customerId}") - public ResponseEntity> getAccountsByCustomerId(@PathVariable("customerId") String customerId) { - try { - List accountData = new ArrayList(); - accountData.addAll(accountRepository.findByAccountCustomerId(customerId)); - if (accountData.isEmpty()) { - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - return new ResponseEntity<>(accountData, HttpStatus.OK); - } catch (Exception e) { - return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); - } - } - - @DeleteMapping("/account/{accountId}") - public ResponseEntity deleteAccount(@PathVariable("accountId") long accountId) { - try { - accountRepository.deleteById(accountId); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } catch (Exception e) { - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - } - - @GetMapping("/account/{accountId}/transactions") - public ResponseEntity> getTransactions(@PathVariable("accountId") long accountId) { - try { - List transactions = new ArrayList(); - transactions.addAll(journalRepository.findByAccountId(accountId)); - if (transactions.isEmpty()) { - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - return new ResponseEntity<>(transactions, HttpStatus.OK); - } catch (Exception e) { - return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); - } - } - -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/model/Account.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/model/Account.java deleted file mode 100644 index e5c2d8907..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/model/Account.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts.model; - -import java.util.Date; -import javax.persistence.Entity; -import javax.persistence.Table; -import lombok.Data; -import lombok.NoArgsConstructor; -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import org.hibernate.annotations.Generated; -import org.hibernate.annotations.GenerationTime; -import javax.persistence.Id; - -@Data -@NoArgsConstructor -@Entity -@Table(name = "ACCOUNTS") -public class Account { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "ACCOUNT_ID") - private long accountId; - - @Column(name = "ACCOUNT_NAME") - private String accountName; - - @Column(name = "ACCOUNT_TYPE") - private String accountType; - - @Column(name = "CUSTOMER_ID") - private String accountCustomerId; - - @Generated(GenerationTime.INSERT) - @Column(name = "ACCOUNT_OPENED_DATE", updatable = false, insertable = false) - private Date accountOpenedDate; - - @Column(name = "ACCOUNT_OTHER_DETAILS") - private String accountOtherDetails; - - @Column(name = "ACCOUNT_BALANCE") - private long accountBalance; - - public Account(String accountName, String accountType, String accountOtherDetails, String accountCustomerId) { - this.accountName = accountName; - this.accountType = accountType; - this.accountOtherDetails = accountOtherDetails; - this.accountCustomerId = accountCustomerId; - } -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/model/Journal.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/model/Journal.java deleted file mode 100644 index 9a2cba3ec..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/model/Journal.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts.model; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; - -import lombok.Data; -import lombok.NoArgsConstructor; - -@Entity -@Table(name = "JOURNAL") -@Data -@NoArgsConstructor -public class Journal { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "JOURNAL_ID") - private long journalId; - - // type is withdraw or deposit - @Column(name = "JOURNAL_TYPE") - private String journalType; - - @Column(name = "ACCOUNT_ID") - private long accountId; - - @Column(name = "LRA_ID") - private String lraId; - - @Column(name = "LRA_STATE") - private String lraState; - - @Column(name = "JOURNAL_AMOUNT") - private long journalAmount; - - public Journal(String journalType, long accountId, long journalAmount, String lraId, String lraState) { - this.journalType = journalType; - this.accountId = accountId; - this.lraId = lraId; - this.lraState = lraState; - this.journalAmount = journalAmount; - } -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/repository/AccountRepository.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/repository/AccountRepository.java deleted file mode 100644 index 6a9823ca3..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/repository/AccountRepository.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts.repository; - -import java.util.List; - -import org.springframework.data.jpa.repository.JpaRepository; - -import com.example.accounts.model.Account; - -public interface AccountRepository extends JpaRepository { - List findByAccountCustomerId(String customerId); - List findAccountsByAccountNameContains (String accountName); - Account findByAccountId(long accountId); -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/repository/JournalRepository.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/repository/JournalRepository.java deleted file mode 100644 index 2b75c3a37..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/repository/JournalRepository.java +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts.repository; - -import com.example.accounts.model.Journal; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.List; - -public interface JournalRepository extends JpaRepository { - Journal findJournalByLraIdAndJournalType(String lraId, String journalType); - List findByAccountId(long accountId); -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/AccountTransferDAO.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/AccountTransferDAO.java deleted file mode 100644 index e57b18e61..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/AccountTransferDAO.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts.services; - -import java.util.List; - -import javax.ws.rs.core.Response; - -import org.eclipse.microprofile.lra.annotation.ParticipantStatus; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import com.example.accounts.model.Account; -import com.example.accounts.model.Journal; -import com.example.accounts.repository.AccountRepository; -import com.example.accounts.repository.JournalRepository; - -@Component -public class AccountTransferDAO { - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - private static AccountTransferDAO singleton; - final AccountRepository accountRepository; - final JournalRepository journalRepository; - - public AccountTransferDAO(AccountRepository accountRepository, JournalRepository journalRepository) { - this.accountRepository = accountRepository; - this.journalRepository = journalRepository; - singleton = this; - System.out.println( - "AccountTransferDAO accountsRepository = " + accountRepository + ", journalRepository = " - + journalRepository); - } - - public static AccountTransferDAO instance() { - return singleton; - } - - public static String getStatusString(ParticipantStatus status) { - switch (status) { - case Compensated: - return "Compensated"; - case Completed: - return "Completed"; - case FailedToCompensate: - return "Failed to Compensate"; - case FailedToComplete: - return "Failed to Complete"; - case Active: - return "Active"; - case Compensating: - return "Compensating"; - case Completing: - return "Completing"; - default: - return "Unknown"; - } - } - - public static ParticipantStatus getStatusFromString(String statusString) { - switch (statusString) { - case "Compensated": - return ParticipantStatus.Compensated; - case "Completed": - return ParticipantStatus.Completed; - case "Failed to Compensate": - return ParticipantStatus.FailedToCompensate; - case "Failed to Complete": - return ParticipantStatus.FailedToComplete; - case "Active": - return ParticipantStatus.Active; - case "Compensating": - return ParticipantStatus.Compensating; - case "Completing": - return ParticipantStatus.Completing; - default: - return null; - } - } - - public void saveAccount(Account account) { - log.info("saveAccount account" + account.getAccountId() + " account" + account.getAccountBalance()); - accountRepository.save(account); - } - - public Response status(String lraId, String journalType) throws Exception { - Journal journal = getJournalForLRAid(lraId, journalType); - if (AccountTransferDAO.getStatusFromString(journal.getLraState()).equals(ParticipantStatus.Compensated)) { - return Response.ok(ParticipantStatus.Compensated).build(); - } else { - return Response.ok(ParticipantStatus.Completed).build(); - } - } - - public void afterLRA(String lraId, String status, String journalType) throws Exception { - Journal journal = getJournalForLRAid(lraId, journalType); - journal.setLraState(status); - journalRepository.save(journal); - } - - Account getAccountForJournal(Journal journal) throws Exception { - Account account = accountRepository.findByAccountId(journal.getAccountId()); - if (account == null) - throw new Exception("Invalid accountName:" + journal.getAccountId()); - return account; - } - - Account getAccountForAccountId(long accountId) { - Account account = accountRepository.findByAccountId(accountId); - if (account == null) - return null; - return account; - } - - Journal getJournalForLRAid(String lraId, String journalType) throws Exception { - Journal journal = journalRepository.findJournalByLraIdAndJournalType(lraId, journalType); - if (journal == null) { - journalRepository.save(new Journal("unknown", -1, 0, lraId, - AccountTransferDAO.getStatusString(ParticipantStatus.FailedToComplete))); - throw new Exception("Journal entry does not exist for lraId:" + lraId); - } - return journal; - } - - public void saveJournal(Journal journal) { - journalRepository.save(journal); - } - -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/DepositService.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/DepositService.java deleted file mode 100644 index 42d9c42a5..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/DepositService.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts.services; - -import java.util.logging.Logger; - -import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_CONTEXT_HEADER; -import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_ENDED_CONTEXT_HEADER; -import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_PARENT_CONTEXT_HEADER; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.eclipse.microprofile.lra.annotation.AfterLRA; -import org.eclipse.microprofile.lra.annotation.Compensate; -import org.eclipse.microprofile.lra.annotation.Complete; -import org.eclipse.microprofile.lra.annotation.ParticipantStatus; -import org.eclipse.microprofile.lra.annotation.Status; -import org.eclipse.microprofile.lra.annotation.ws.rs.LRA; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import com.example.accounts.model.Account; -import com.example.accounts.model.Journal; - -@RequestScoped -@Path("/deposit") -@Component -public class DepositService { - private static final Logger log = Logger.getLogger(DepositService.class.getName()); - private final static String DEPOSIT = "DEPOSIT"; - - /** - * Write journal entry re deposit amount. - * Do not increase actual bank account amount - */ - @POST - @Path("/deposit") - @Produces(MediaType.APPLICATION_JSON) - @LRA(value = LRA.Type.MANDATORY, end = false) - public Response deposit(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId, - @QueryParam("accountId") long accountId, - @QueryParam("amount") long depositAmount) { - log.info("...deposit " + depositAmount + " in account:" + accountId + - " (lraId:" + lraId + ") finished (in pending state)"); - Account account = AccountTransferDAO.instance().getAccountForAccountId(accountId); - if (account == null) { - log.info("deposit failed: account does not exist"); - AccountTransferDAO.instance().saveJournal( - new Journal( - DEPOSIT, - accountId, - 0, - lraId, - AccountTransferDAO.getStatusString(ParticipantStatus.Active) - ) - ); - return Response.ok("deposit failed: account does not exist").build(); - } - AccountTransferDAO.instance().saveJournal( - new Journal( - DEPOSIT, - accountId, - depositAmount, - lraId, - AccountTransferDAO.getStatusString(ParticipantStatus.Active) - ) - ); - return Response.ok("deposit succeeded").build(); - } - - /** - * Increase balance amount as recorded in journal during deposit call. - * Update LRA state to ParticipantStatus.Completed. - */ - @PUT - @Path("/complete") - @Produces(MediaType.APPLICATION_JSON) - @Complete - public Response completeWork(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws Exception { - log.info("deposit complete called for LRA : " + lraId); - - // get the journal and account... - Journal journal = AccountTransferDAO.instance().getJournalForLRAid(lraId, DEPOSIT); - Account account = AccountTransferDAO.instance().getAccountForJournal(journal); - - // set this LRA participant's status to completing... - journal.setLraState(AccountTransferDAO.getStatusString(ParticipantStatus.Completing)); - - // update the account balance and journal entry... - account.setAccountBalance(account.getAccountBalance() + journal.getJournalAmount()); - AccountTransferDAO.instance().saveAccount(account); - journal.setLraState(AccountTransferDAO.getStatusString(ParticipantStatus.Completed)); - AccountTransferDAO.instance().saveJournal(journal); - - // set this LRA participant's status to complete... - return Response.ok(ParticipantStatus.Completed.name()).build(); - } - - /** - * Update LRA state to ParticipantStatus.Compensated. - */ - @PUT - @Path("/compensate") - @Produces(MediaType.APPLICATION_JSON) - @Compensate - public Response compensateWork(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws Exception { - log.info("deposit compensate called for LRA : " + lraId); - Journal journal = AccountTransferDAO.instance().getJournalForLRAid(lraId, DEPOSIT); - journal.setLraState(AccountTransferDAO.getStatusString(ParticipantStatus.Compensated)); - AccountTransferDAO.instance().saveJournal(journal); - return Response.ok(ParticipantStatus.Compensated.name()).build(); - } - - /** - * Return status - */ - @GET - @Path("/status") - @Produces(MediaType.TEXT_PLAIN) - @Status - public Response status(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId, - @HeaderParam(LRA_HTTP_PARENT_CONTEXT_HEADER) String parentLRA) throws Exception { - return AccountTransferDAO.instance().status(lraId, DEPOSIT); - } - - /** - * Delete journal entry for LRA - */ - @PUT - @Path("/after") - @AfterLRA - @Consumes(MediaType.TEXT_PLAIN) - public Response afterLRA(@HeaderParam(LRA_HTTP_ENDED_CONTEXT_HEADER) String lraId, String status) throws Exception { - log.info("After LRA Called : " + lraId); - AccountTransferDAO.instance().afterLRA(lraId, status, DEPOSIT); - return Response.ok().build(); - } - -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/WithdrawService.java b/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/WithdrawService.java deleted file mode 100644 index 2eb7b99ad..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/java/com/example/accounts/services/WithdrawService.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts.services; - -import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_CONTEXT_HEADER; -import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_ENDED_CONTEXT_HEADER; -import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_PARENT_CONTEXT_HEADER; - -import java.util.logging.Logger; - -import javax.enterprise.context.RequestScoped; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.eclipse.microprofile.lra.annotation.AfterLRA; -import org.eclipse.microprofile.lra.annotation.Compensate; -import org.eclipse.microprofile.lra.annotation.Complete; -import org.eclipse.microprofile.lra.annotation.ParticipantStatus; -import org.eclipse.microprofile.lra.annotation.Status; -import org.eclipse.microprofile.lra.annotation.ws.rs.LRA; -import org.springframework.stereotype.Component; - -import com.example.accounts.model.Account; -import com.example.accounts.model.Journal; - -@RequestScoped -@Path("/withdraw") -@Component -public class WithdrawService { - private static final Logger log = Logger.getLogger(WithdrawService.class.getName()); - public static final String WITHDRAW = "WITHDRAW"; - - /** - * Reduce account balance by given amount and write journal entry re the same. - * Both actions in same local tx - */ - @POST - @Path("/withdraw") - @Produces(MediaType.APPLICATION_JSON) - @LRA(value = LRA.Type.MANDATORY, end = false) - public Response withdraw(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId, - @QueryParam("accountId") long accountId, - @QueryParam("amount") long withdrawAmount) { - log.info("withdraw " + withdrawAmount + " in account:" + accountId + " (lraId:" + lraId + ")..."); - Account account = AccountTransferDAO.instance().getAccountForAccountId(accountId); - if (account == null) { - log.info("withdraw failed: account does not exist"); - AccountTransferDAO.instance().saveJournal( - new Journal( - WITHDRAW, - accountId, - 0, - lraId, - AccountTransferDAO.getStatusString(ParticipantStatus.Active))); - return Response.ok("withdraw failed: account does not exist").build(); - } - if (account.getAccountBalance() < withdrawAmount) { - log.info("withdraw failed: insufficient funds"); - AccountTransferDAO.instance().saveJournal( - new Journal( - WITHDRAW, - accountId, - 0, - lraId, - AccountTransferDAO.getStatusString(ParticipantStatus.Active))); - return Response.ok("withdraw failed: insufficient funds").build(); - } - log.info("withdraw current balance:" + account.getAccountBalance() + - " new balance:" + (account.getAccountBalance() - withdrawAmount)); - account.setAccountBalance(account.getAccountBalance() - withdrawAmount); - AccountTransferDAO.instance().saveAccount(account); - AccountTransferDAO.instance().saveJournal( - new Journal( - WITHDRAW, - accountId, - withdrawAmount, - lraId, - AccountTransferDAO.getStatusString(ParticipantStatus.Active))); - return Response.ok("withdraw succeeded").build(); - } - - /** - * Update LRA state. Do nothing else. - */ - @PUT - @Path("/complete") - @Produces(MediaType.APPLICATION_JSON) - @Complete - public Response completeWork(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws Exception { - log.info("withdraw complete called for LRA : " + lraId); - Journal journal = AccountTransferDAO.instance().getJournalForLRAid(lraId, WITHDRAW); - journal.setLraState(AccountTransferDAO.getStatusString(ParticipantStatus.Completed)); - AccountTransferDAO.instance().saveJournal(journal); - return Response.ok(ParticipantStatus.Completed.name()).build(); - } - - /** - * Read the journal and increase the balance by the previous withdraw amount - * before the LRA - */ - @PUT - @Path("/compensate") - @Produces(MediaType.APPLICATION_JSON) - @Compensate - public Response compensateWork(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws Exception { - log.info("Account withdraw compensate() called for LRA : " + lraId); - Journal journal = AccountTransferDAO.instance().getJournalForLRAid(lraId, WITHDRAW); - journal.setLraState(AccountTransferDAO.getStatusString(ParticipantStatus.Compensating)); - Account account = AccountTransferDAO.instance().getAccountForAccountId(journal.getAccountId()); - if (account != null) { - account.setAccountBalance(account.getAccountBalance() + journal.getJournalAmount()); - AccountTransferDAO.instance().saveAccount(account); - } - journal.setLraState(AccountTransferDAO.getStatusString(ParticipantStatus.Compensated)); - AccountTransferDAO.instance().saveJournal(journal); - return Response.ok(ParticipantStatus.Compensated.name()).build(); - } - - @GET - @Path("/status") - @Produces(MediaType.TEXT_PLAIN) - @Status - public Response status(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId, - @HeaderParam(LRA_HTTP_PARENT_CONTEXT_HEADER) String parentLRA) throws Exception { - return AccountTransferDAO.instance().status(lraId, WITHDRAW); - } - - /** - * Delete journal entry for LRA - */ - @PUT - @Path("/after") - @AfterLRA - @Consumes(MediaType.TEXT_PLAIN) - public Response afterLRA(@HeaderParam(LRA_HTTP_ENDED_CONTEXT_HEADER) String lraId, String status) throws Exception { - log.info("After LRA Called : " + lraId); - AccountTransferDAO.instance().afterLRA(lraId, status, WITHDRAW); - return Response.ok().build(); - } - -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/resources/application.yaml b/cloudbank-v2/spring-apps/account/src/main/resources/application.yaml deleted file mode 100644 index 02ab5fccd..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/resources/application.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2023, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -spring: - application: - name: account - zipkin: - base-url: ${zipkin.base-url} - jersey: - type: filter - jpa: - hibernate: - ddl-auto: validate - properties: - hibernate: - dialect: org.hibernate.dialect.Oracle12cDialect - format_sql: true - show-sql: true - - liquibase: - change-log: classpath:db/changelog/controller.yaml - url: ${spring.datasource.url} - user: ${spring.datasource.username} - password: ${spring.datasource.password} - enabled: ${LIQUIBASE_ENABLED:true} - - datasource: - url: ${spring.datasource.url} - username: ${spring.datasource.username} - password: ${spring.datasource.password} - driver-class-name: oracle.jdbc.OracleDriver - type: oracle.ucp.jdbc.PoolDataSource - oracleucp: - connection-factory-class-name: oracle.jdbc.pool.OracleDataSource - connection-pool-name: AccountConnectionPool - initial-pool-size: 15 - min-pool-size: 10 - max-pool-size: 30 - -lra: - coordinator: - url: http://otmm-tcs.otmm.svc.cluster.local:9000/api/v1/lra-coordinator - -management: - endpoint: - health: - show-details: always - endpoints: - web: - exposure: - include: "*" - metrics: - tags: - application: ${spring.application.name} diff --git a/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/controller.yaml b/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/controller.yaml deleted file mode 100644 index cec0ecb3b..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/controller.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -databaseChangeLog: - - include: - file: classpath:db/changelog/table.sql - - include: - file: classpath:db/changelog/data.sql diff --git a/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/data.sql b/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/data.sql deleted file mode 100644 index 2e4595bc6..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/data.sql +++ /dev/null @@ -1,20 +0,0 @@ --- liquibase formatted sql - --- changeset gotsysdba:1 runAlways:true -DELETE FROM ACCOUNT.JOURNAL; -TRUNCATE TABLE ACCOUNT.ACCOUNTS; - -INSERT INTO ACCOUNT.ACCOUNTS (ACCOUNT_NAME,ACCOUNT_TYPE,CUSTOMER_ID,ACCOUNT_OTHER_DETAILS,ACCOUNT_BALANCE) -VALUES ('Andy''s checking','CH','qwertysdwr','Account Info',-20); -INSERT INTO ACCOUNT.ACCOUNTS (ACCOUNT_NAME,ACCOUNT_TYPE,CUSTOMER_ID,ACCOUNT_OTHER_DETAILS,ACCOUNT_BALANCE) -VALUES ('Mark''s CCard','CC','bkzLp8cozi','Mastercard account',1000); -INSERT INTO ACCOUNT.ACCOUNTS (ACCOUNT_NAME,ACCOUNT_TYPE,CUSTOMER_ID,ACCOUNT_OTHER_DETAILS,ACCOUNT_BALANCE) -VALUES ('Andy''s Saving','SA','qwertysdwr','Savings account',1035); -INSERT INTO ACCOUNT.ACCOUNTS (ACCOUNT_NAME,ACCOUNT_TYPE,CUSTOMER_ID,ACCOUNT_OTHER_DETAILS,ACCOUNT_BALANCE) -VALUES ('Sanjay''s Savings','SA','bkzLp8cozi','Savings Account',1040); -INSERT INTO ACCOUNT.ACCOUNTS (ACCOUNT_NAME,ACCOUNT_TYPE,CUSTOMER_ID,ACCOUNT_OTHER_DETAILS,ACCOUNT_BALANCE) -VALUES ('Sanjays Loan','LO','bkzLp8cozi','Car Loan',-80); -INSERT INTO ACCOUNT.ACCOUNTS (ACCOUNT_NAME,ACCOUNT_TYPE,CUSTOMER_ID,ACCOUNT_OTHER_DETAILS,ACCOUNT_BALANCE) -VALUES ('Mark''s Checking','CH','bkzLp8cozi','Checking Account',-1100); - ---rollback DELETE FROM ACCOUNT.ACCOUNTS; \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/table.sql b/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/table.sql deleted file mode 100644 index 211bc1c0f..000000000 --- a/cloudbank-v2/spring-apps/account/src/main/resources/db/changelog/table.sql +++ /dev/null @@ -1,40 +0,0 @@ --- liquibase formatted sql - ---changeset gotsysdba:1 ---preconditions onFail:MARK_RAN onerror:MARK_RAN ---precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM ACCOUNT.ACCOUNTS WHERE 1=2 -DROP TABLE ACCOUNT.ACCOUNTS; - ---changeset gotsysdba:2 ---preconditions onFail:MARK_RAN onerror:MARK_RAN ---precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM ACCOUNT.JOURNAL WHERE 1=2 -DROP TABLE ACCOUNT.JOURNAL; - ---changeset gotsysdba:3 -CREATE TABLE ACCOUNT.ACCOUNTS ( - ACCOUNT_ID NUMBER GENERATED ALWAYS AS IDENTITY (START WITH 1 CACHE 20), - ACCOUNT_NAME VARCHAR2(40) NOT NULL, - ACCOUNT_TYPE VARCHAR2(2) CHECK (ACCOUNT_TYPE IN ('CH', 'SA', 'CC', 'LO')), - CUSTOMER_ID VARCHAR2 (20), - ACCOUNT_OPENED_DATE DATE DEFAULT SYSDATE NOT NULL, - ACCOUNT_OTHER_DETAILS VARCHAR2(4000), - ACCOUNT_BALANCE NUMBER -) LOGGING; -ALTER TABLE ACCOUNT.ACCOUNTS ADD CONSTRAINT ACCOUNTS_PK PRIMARY KEY (ACCOUNT_ID) USING INDEX LOGGING; -COMMENT ON TABLE ACCOUNT.ACCOUNTS is 'CLOUDBANK ACCOUNTS TABLE'; - -CREATE TABLE ACCOUNT.JOURNAL ( - JOURNAL_ID NUMBER GENERATED ALWAYS AS IDENTITY (START WITH 1 CACHE 20), - JOURNAL_TYPE VARCHAR2(20) NOT NULL, - LRA_ID VARCHAR2 (1024), - LRA_STATE VARCHAR2 (40), - JOURNAL_AMOUNT NUMBER, - ACCOUNT_ID NUMBER NOT NULL -) LOGGING; -ALTER TABLE ACCOUNT.JOURNAL ADD CONSTRAINT JOURNAL_PK PRIMARY KEY (JOURNAL_ID) USING INDEX LOGGING; -ALTER TABLE ACCOUNT.JOURNAL ADD CONSTRAINT JOURNAL_ACCOUNT_FK FOREIGN KEY ( ACCOUNT_ID ) - REFERENCES ACCOUNT.ACCOUNTS ( ACCOUNT_ID ); -COMMENT ON TABLE ACCOUNT.JOURNAL is 'CLOUDBANK JOURNAL TABLE'; - ---rollback DROP TABLE ACCOUNT.ACCOUNTS; ---rollback DROP TABLE ACCOUNT.JOURNAL; \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/account/src/test/java/com/example/accounts/AccountsApplicationTests.java b/cloudbank-v2/spring-apps/account/src/test/java/com/example/accounts/AccountsApplicationTests.java deleted file mode 100644 index 466d8ddba..000000000 --- a/cloudbank-v2/spring-apps/account/src/test/java/com/example/accounts/AccountsApplicationTests.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.accounts; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class AccountsApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/cloudbank-v2/spring-apps/apisix-routes/create-accounts-route.sh b/cloudbank-v2/spring-apps/apisix-routes/create-accounts-route.sh deleted file mode 100644 index 874252a86..000000000 --- a/cloudbank-v2/spring-apps/apisix-routes/create-accounts-route.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Copyright (c) 2023, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -if [ $# -eq 0 ]; then - echo "You must supply the API key as an argument" - exit 1 -fi - -curl http://localhost:9180/apisix/admin/routes \ - -H "X-API-KEY: $1" \ - -X POST \ - -i \ - --data-binary @- << EOF -{ - "name": "accounts", - "labels": { - "version": "1.0" - }, - "uri": "/api/v1/account*", - "upstream": { - "service_name": "application/account:spring", - "type": "roundrobin", - "discovery_type": "kubernetes" - }, - "plugins": { - "zipkin": { - "disable": false, - "endpoint": "http://jaegertracing-collector.observability.svc.cluster.local:9411/api/v2/spans", - "sample_ratio": 1, - "service_name": "APISIX" - } - } -} -EOF \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/apisix-routes/create-creditscore-route.sh b/cloudbank-v2/spring-apps/apisix-routes/create-creditscore-route.sh deleted file mode 100644 index 6750ae010..000000000 --- a/cloudbank-v2/spring-apps/apisix-routes/create-creditscore-route.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Copyright (c) 2023, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -if [ $# -eq 0 ]; then - echo "You must supply the API key as an argument" - exit 1 -fi - -curl http://localhost:9180/apisix/admin/routes \ - -H "X-API-KEY: $1" \ - -X POST \ - -i \ - --data-binary @- << EOF -{ - "name": "creditscore", - "labels": { - "version": "1.0" - }, - "uri": "/api/v1/creditscore*", - "upstream": { - "service_name": "CREDITSCORE", - "type": "roundrobin", - "discovery_type": "eureka" - }, - "plugins": { - "zipkin": { - "disable": false, - "endpoint": "http://jaegertracing-collector.observability.svc.cluster.local:9411/api/v2/spans", - "sample_ratio": 1, - "service_name": "APISIX" - } - } -} -EOF \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/apisix-routes/create-customer-route.sh b/cloudbank-v2/spring-apps/apisix-routes/create-customer-route.sh deleted file mode 100644 index c49073f08..000000000 --- a/cloudbank-v2/spring-apps/apisix-routes/create-customer-route.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Copyright (c) 2023, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -if [ $# -eq 0 ]; then - echo "You must supply the API key as an argument" - exit 1 -fi - -curl http://localhost:9180/apisix/admin/routes \ - -H "X-API-KEY: $1" \ - -X POST \ - -i \ - --data-binary @- << EOF -{ - "name": "customer", - "labels": { - "version": "1.0" - }, - "uri": "/api/v1/customer*", - "upstream": { - "service_name": "CUSTOMERS", - "type": "roundrobin", - "discovery_type": "eureka" - }, - "plugins": { - "zipkin": { - "disable": false, - "endpoint": "http://jaegertracing-collector.observability.svc.cluster.local:9411/api/v2/spans", - "sample_ratio": 1, - "service_name": "APISIX" - } - } -} -EOF \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/creditscore/pom.xml b/cloudbank-v2/spring-apps/creditscore/pom.xml deleted file mode 100644 index 2c267e49d..000000000 --- a/cloudbank-v2/spring-apps/creditscore/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - 4.0.0 - - - com.example - sample-spring-apps - 0.0.1-SNAPSHOT - - - creditscore - 0.0.1-SNAPSHOT - creditscore - Creditscore Application - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/cloudbank-v2/spring-apps/creditscore/src/main/java/com/example/creditscore/CreditscoreApplication.java b/cloudbank-v2/spring-apps/creditscore/src/main/java/com/example/creditscore/CreditscoreApplication.java deleted file mode 100644 index 3b4f31a24..000000000 --- a/cloudbank-v2/spring-apps/creditscore/src/main/java/com/example/creditscore/CreditscoreApplication.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.creditscore; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; - -@EnableDiscoveryClient -@SpringBootApplication -public class CreditscoreApplication { - - public static void main(String[] args) { - SpringApplication.run(CreditscoreApplication.class, args); - } - -} diff --git a/cloudbank-v2/spring-apps/creditscore/src/main/java/com/example/creditscore/controller/CreditScoreController.java b/cloudbank-v2/spring-apps/creditscore/src/main/java/com/example/creditscore/controller/CreditScoreController.java deleted file mode 100644 index 4252554e8..000000000 --- a/cloudbank-v2/spring-apps/creditscore/src/main/java/com/example/creditscore/controller/CreditScoreController.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.creditscore.controller; - -import org.springframework.web.bind.annotation.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.security.SecureRandom; -import java.util.HashMap; -import java.util.Map; - -@RestController -@RequestMapping("/api/v1") -public class CreditScoreController { - - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - @GetMapping("/creditscore") - public Map getCreditScore() { - log.info("CREDITSCORE: getCreditScore"); - int max = 900; - int min = 500; - SecureRandom secureRandom = new SecureRandom(); - HashMap map = new HashMap<>(); - map.put("Credit Score", String.valueOf(secureRandom.nextInt(max - min) + min)); - map.put("Date", String.valueOf(java.time.LocalDate.now())); - return map; - } -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/creditscore/src/main/resources/application.yaml b/cloudbank-v2/spring-apps/creditscore/src/main/resources/application.yaml deleted file mode 100644 index 2e7e028bc..000000000 --- a/cloudbank-v2/spring-apps/creditscore/src/main/resources/application.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Application.yaml for creditscore service -# Copyright (c) 2023, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -spring: - application: - name: creditscore - zipkin: - base-url: ${zipkin.base-url} - -eureka: - instance: - hostname: ${spring.application.name} - preferIpAddress: true - client: - service-url: - defaultZone: ${eureka.service-url} - fetch-registry: true - register-with-eureka: true - enabled: true - -management: - endpoint: - health: - show-details: always - endpoints: - web: - exposure: - include: "*" - metrics: - tags: - application: ${spring.application.name} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/creditscore/src/test/java/com/example/creditscore/CreditscoreApplicationTests.java b/cloudbank-v2/spring-apps/creditscore/src/test/java/com/example/creditscore/CreditscoreApplicationTests.java deleted file mode 100644 index 875835b55..000000000 --- a/cloudbank-v2/spring-apps/creditscore/src/test/java/com/example/creditscore/CreditscoreApplicationTests.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.creditscore; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class CreditscoreApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/cloudbank-v2/spring-apps/customer/pom.xml b/cloudbank-v2/spring-apps/customer/pom.xml deleted file mode 100644 index 34eb123a6..000000000 --- a/cloudbank-v2/spring-apps/customer/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - 4.0.0 - - - com.example - sample-spring-apps - 0.0.1-SNAPSHOT - - - customer - 0.0.1-SNAPSHOT - customer - Customer Application - - - 2.7.7 - 4.19.0 - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - com.oracle.database.spring - oracle-spring-boot-starter-ucp - ${oracle-springboot-starter.version} - pom - - - com.oracle.database.spring - oracle-spring-boot-starter-wallet - ${oracle-springboot-starter.version} - pom - - - org.liquibase - liquibase-core - ${liquibase.version} - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.projectlombok - lombok - - - - - - org.liquibase - liquibase-maven-plugin - - - - - diff --git a/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/CustomerApplication.java b/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/CustomerApplication.java deleted file mode 100644 index f97dc5924..000000000 --- a/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/CustomerApplication.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ -package com.example.customer; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; - -@SpringBootApplication -@EnableDiscoveryClient -public class CustomerApplication { - - public static void main(String[] args) { - SpringApplication.run(CustomerApplication.class, args); - } - -} diff --git a/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/controller/CustomerController.java b/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/controller/CustomerController.java deleted file mode 100644 index 9c85876e9..000000000 --- a/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/controller/CustomerController.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.customer.controller; - -import com.example.customer.model.Customers; -import com.example.customer.repository.CustomersRepository; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -import java.util.Optional; - -@RestController -@RequestMapping("/api/v1") -public class CustomerController { - final CustomersRepository customersRepository; - private final Logger log = LoggerFactory.getLogger(this.getClass()); - - public CustomerController(CustomersRepository customersRepository) { - this.customersRepository = customersRepository; - } - - @ResponseStatus(HttpStatus.OK) - @GetMapping("/customer") - public List findAll() { - log.info("CUSTOMER: findAll"); - return customersRepository.findAll(); - } - - @ResponseStatus(HttpStatus.OK) - @GetMapping("/customer/name/{customerName}") - public List findByCustomerByName(@PathVariable String customerName) { - log.info("CUSTOMER: findByCustomerByName"); - return customersRepository.findByCustomerNameIsContaining(customerName); - } - - // Get Customer with specific ID - @GetMapping("/customer/{id}") - public ResponseEntity getCustomerById(@PathVariable("id") String id) { - log.info("CUSTOMER: getCustomerById"); - Optional customerData = customersRepository.findById(id); - try { - return customerData.map(customers -> new ResponseEntity<>(customers, HttpStatus.OK)) - .orElseGet(() -> new ResponseEntity<>(HttpStatus.NOT_FOUND)); - } catch (Exception e) { - return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); - } - } - - // get customer by email - @GetMapping("/customer/byemail/{email}") - public List getCustomerByEmail(@PathVariable("email") String email) { - log.info("CUSTOMER: getCustomerByEmail"); - return customersRepository.findByCustomerEmailIsContaining(email); - } - - @PostMapping("/customer") - public ResponseEntity createCustomer(@RequestBody Customers customer) { - log.info("CUSTOMER: createCustomer"); - try { - Customers _customer = customersRepository.save(new Customers( - customer.getCustomerId(), - customer.getCustomerName(), - customer.getCustomerEmail(), - customer.getCustomerOtherDetails())); - return new ResponseEntity<>(_customer, HttpStatus.CREATED); - - } catch (Exception e) { - return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); - } - } - - // Update a specific Customer (ID) - @PutMapping("/customer/{id}") - public ResponseEntity updateCustomer(@PathVariable("id") String id, @RequestBody Customers customer) { - log.info("CUSTOMER: updateCustomer"); - Optional customerData = customersRepository.findById(id); - try { - if (customerData.isPresent()) { - Customers _customer = customerData.get(); - _customer.setCustomerName(customer.getCustomerName()); - _customer.setCustomerEmail(customer.getCustomerEmail()); - _customer.setCustomerOtherDetails(customer.getCustomerOtherDetails()); - return new ResponseEntity<>(customersRepository.save(_customer), HttpStatus.OK); - } else { - return new ResponseEntity<>(HttpStatus.NOT_FOUND); - } - } - catch (Exception e) { - return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); - } - } - - // Delete a specific customer (ID) - @DeleteMapping("/customer/{customerId}") - public ResponseEntity deleteCustomer(@PathVariable("customerId") String customerId) { - log.info("CUSTOMER: deleteCustomer"); - try { - customersRepository.deleteById(customerId); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } catch (Exception e) { - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - } - - @PostMapping("/customer/applyLoan/{amount}") - public ResponseEntity applyForLoan(@PathVariable ("amount") long amount) { - log.info("CUSTOMER: applyForLoan"); - try { - // Check Credit Rating - // Amount vs Rating approval? - // Create Account - // Update Account Balance - // Notify - return new ResponseEntity<>(HttpStatus.I_AM_A_TEAPOT); - } catch (Exception e) { - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - } -} diff --git a/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/model/Customers.java b/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/model/Customers.java deleted file mode 100644 index e09371a11..000000000 --- a/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/model/Customers.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.customer.model; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Column; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.hibernate.annotations.GenerationTime; -import org.hibernate.annotations.Generated; - -import java.util.Date; - -@Entity -@Table(name = "CUSTOMERS") -@Data -@NoArgsConstructor -public class Customers { - - @Id - @Column(name = "CUSTOMER_ID") - private String customerId; - - @Column(name = "CUSTOMER_NAME") - private String customerName; - - @Column(name = "CUSTOMER_EMAIL") - private String customerEmail; - - @Generated(GenerationTime.INSERT) - @Column(name = "DATE_BECAME_CUSTOMER", updatable = false, insertable = false) - private Date dateBecameCustomer; - - @Column(name = "CUSTOMER_OTHER_DETAILS") - private String customerOtherDetails; - - @Column(name = "PASSWORD") - private String customerPassword; - - public Customers(String customerId, String customerName, String customerEmail, String customerOtherDetails) { - this.customerId = customerId; - this.customerName = customerName; - this.customerEmail = customerEmail; - this.customerOtherDetails = customerOtherDetails; - } -} diff --git a/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/repository/CustomersRepository.java b/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/repository/CustomersRepository.java deleted file mode 100644 index 1e9871fb8..000000000 --- a/cloudbank-v2/spring-apps/customer/src/main/java/com/example/customer/repository/CustomersRepository.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.customer.repository; - -import com.example.customer.model.Customers; -import org.springframework.data.jpa.repository.JpaRepository; -import java.util.List; - -public interface CustomersRepository extends JpaRepository { - - List findByCustomerNameIsContaining(String customerName); - List findByCustomerEmailIsContaining(String customerEmail); - - // Optional findByEmail(String email); -} diff --git a/cloudbank-v2/spring-apps/customer/src/main/resources/application.yaml b/cloudbank-v2/spring-apps/customer/src/main/resources/application.yaml deleted file mode 100644 index e6181e553..000000000 --- a/cloudbank-v2/spring-apps/customer/src/main/resources/application.yaml +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2023, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ -spring: - application: - name: customers - zipkin: - base-url: ${zipkin.base-url} - jpa: - hibernate: - ddl-auto: validate - properties: - hibernate: - dialect: org.hibernate.dialect.Oracle12cDialect - format_sql: true - show-sql: true - - liquibase: - change-log: classpath:db/changelog/controller.yaml - url: ${spring.datasource.url} - user: ${spring.datasource.username} - password: ${spring.datasource.password} - enabled: ${LIQUIBASE_ENABLED:true} - - datasource: - url: ${spring.datasource.url} - username: ${spring.datasource.username} - password: ${spring.datasource.password} - driver-class-name: oracle.jdbc.OracleDriver - type: oracle.ucp.jdbc.PoolDataSource - oracleucp: - connection-factory-class-name: oracle.jdbc.pool.OracleDataSource - connection-pool-name: CustomerConnectionPool - initial-pool-size: 15 - min-pool-size: 10 - max-pool-size: 30 - -eureka: - instance: - hostname: ${spring.application.name} - preferIpAddress: true - client: - service-url: - defaultZone: ${eureka.service-url} - fetch-registry: true - register-with-eureka: true - enabled: true - -management: - endpoint: - health: - show-details: always - endpoints: - web: - exposure: - include: "*" - metrics: - tags: - application: ${spring.application.name} - diff --git a/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/controller.yaml b/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/controller.yaml deleted file mode 100644 index cec0ecb3b..000000000 --- a/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/controller.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -databaseChangeLog: - - include: - file: classpath:db/changelog/table.sql - - include: - file: classpath:db/changelog/data.sql diff --git a/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/data.sql b/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/data.sql deleted file mode 100644 index 6084453c1..000000000 --- a/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/data.sql +++ /dev/null @@ -1,14 +0,0 @@ --- liquibase formatted sql - --- changeset gotsysdba:1 runAlways:true -TRUNCATE TABLE CUSTOMER.CUSTOMERS; - -INSERT INTO CUSTOMER.CUSTOMERS (CUSTOMER_ID,CUSTOMER_NAME,CUSTOMER_EMAIL,CUSTOMER_OTHER_DETAILS,PASSWORD,ROLE) -VALUES ('qwertysdwr','Andy','andy@andy.com','Somekind of Info','SuperSecret','USER_ROLE'); -INSERT INTO CUSTOMER.CUSTOMERS (CUSTOMER_ID,CUSTOMER_NAME,CUSTOMER_EMAIL,CUSTOMER_OTHER_DETAILS,PASSWORD,ROLE) -VALUES ('aerg45sffd','Sanjay','sanjay@sanjay.com','Information','Welcome','USER_ROLE'); -INSERT INTO CUSTOMER.CUSTOMERS (CUSTOMER_ID,CUSTOMER_NAME,CUSTOMER_EMAIL,CUSTOMER_OTHER_DETAILS,PASSWORD,ROLE) -VALUES ('bkzLp8cozi','Mark','mark@mark.com','Important Info','Secret','USER_ROLE'); -COMMIT; - ---rollback DELETE FROM CUSTOMER.CUSTOMERS; \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/table.sql b/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/table.sql deleted file mode 100644 index 350ecab0f..000000000 --- a/cloudbank-v2/spring-apps/customer/src/main/resources/db/changelog/table.sql +++ /dev/null @@ -1,22 +0,0 @@ --- liquibase formatted sql - ---changeset gotsysdba:1 ---preconditions onFail:MARK_RAN onerror:MARK_RAN ---precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM CUSTOMER.CUSTOMERS WHERE 1=2 -DROP TABLE CUSTOMER.CUSTOMERS; - ---changeset gotsysdba:2 -CREATE TABLE CUSTOMER.CUSTOMERS ( - CUSTOMER_ID VARCHAR2 (20), - CUSTOMER_NAME VARCHAR2 (40), - CUSTOMER_EMAIL VARCHAR2 (40), - DATE_BECAME_CUSTOMER DATE DEFAULT SYSDATE NOT NULL, - CUSTOMER_OTHER_DETAILS VARCHAR2 (4000), - PASSWORD VARCHAR2(40), - ROLE VARCHAR2(40) -) LOGGING; - -ALTER TABLE CUSTOMER.CUSTOMERS ADD CONSTRAINT CUSTOMERS_PK PRIMARY KEY (CUSTOMER_ID) USING INDEX LOGGING; -COMMENT ON TABLE CUSTOMER.CUSTOMERS IS 'CLOUDBANK CUSTOMERS TABLE'; - ---rollback DROP TABLE CUSTOMER.CUSTOMERS; diff --git a/cloudbank-v2/spring-apps/customer/src/test/java/com/example/customer/CustomerApplicationTests.java b/cloudbank-v2/spring-apps/customer/src/test/java/com/example/customer/CustomerApplicationTests.java deleted file mode 100644 index c12e6b41d..000000000 --- a/cloudbank-v2/spring-apps/customer/src/test/java/com/example/customer/CustomerApplicationTests.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.customer; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class CustomerApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/cloudbank-v2/spring-apps/images/accounts-controller.png b/cloudbank-v2/spring-apps/images/accounts-controller.png deleted file mode 100644 index bb72bb9df..000000000 Binary files a/cloudbank-v2/spring-apps/images/accounts-controller.png and /dev/null differ diff --git a/cloudbank-v2/spring-apps/images/credit-score-controller.png b/cloudbank-v2/spring-apps/images/credit-score-controller.png deleted file mode 100644 index ee86a45cd..000000000 Binary files a/cloudbank-v2/spring-apps/images/credit-score-controller.png and /dev/null differ diff --git a/cloudbank-v2/spring-apps/images/customer-controller.png b/cloudbank-v2/spring-apps/images/customer-controller.png deleted file mode 100644 index 1ac374b75..000000000 Binary files a/cloudbank-v2/spring-apps/images/customer-controller.png and /dev/null differ diff --git a/cloudbank-v2/spring-apps/pom.xml b/cloudbank-v2/spring-apps/pom.xml deleted file mode 100644 index 03a7f193e..000000000 --- a/cloudbank-v2/spring-apps/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - 4.0.0 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.12 - - - - pom - - cloudbank - Sample application for Oracle Backend for Spring Boot - - com.example - sample-spring-apps - 0.0.1-SNAPSHOT - - - account - customer - creditscore - transfer - - - - UTF-8 - 17 - 2.7.12 - 2021.0.7 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-actuator - - - io.micrometer - micrometer-registry-prometheus - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - org.springframework.boot - spring-boot-starter-log4j2 - - - - org.projectlombok - lombok - - - org.springframework.cloud - spring-cloud-sleuth-zipkin - - - org.springframework.cloud - spring-cloud-starter-sleuth - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-dependencies - ${spring.boot.dependencies.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.projectlombok - lombok - - - - - - - - diff --git a/cloudbank-v2/spring-apps/transfer/pom.xml b/cloudbank-v2/spring-apps/transfer/pom.xml deleted file mode 100644 index 7936e25aa..000000000 --- a/cloudbank-v2/spring-apps/transfer/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - 4.0.0 - - - com.example - sample-spring-apps - 0.0.1-SNAPSHOT - - - transfer - 0.0.1-SNAPSHOT - transfer - Transfer Application - - - 1.0 - 5.13.1.Final - 2.0.2 - - - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - javax.ws.rs - jsr311-api - - - - - - org.springframework.boot - spring-boot-starter-jersey - - - org.eclipse.microprofile.lra - microprofile-lra-api - ${microprofile-lra-api.version} - - - org.jboss.narayana.rts - narayana-lra - ${narayana-lra.version} - - - jakarta.enterprise - jakarta.enterprise.cdi-api - ${jakarta.enterprise.cdi-api.version} - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/ApplicationConfig.java b/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/ApplicationConfig.java deleted file mode 100644 index b46b3d262..000000000 --- a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/ApplicationConfig.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.transfer; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; - -import io.narayana.lra.client.NarayanaLRAClient; - -@Configuration -public class ApplicationConfig { - static String accountWithdrawUrl; - static String accountDepositUrl; - static String transferCancelURL; - static String transferCancelProcessURL; - static String transferConfirmURL; - static String transferConfirmProcessURL; - - public ApplicationConfig(@Value("${lra.coordinator.url}") String lraCoordinatorUrl, - @Value("${account.withdraw.url}") String accountWithdrawUrl, - @Value("${account.deposit.url}") String accountDepositUrl, - @Value("${transfer.cancel.url}") String transferCancelURL, - @Value("${transfer.cancel.process.url}") String transferCancelProcessURL, - @Value("${transfer.confirm.url}") String transferConfirmURL, - @Value("${transfer.confirm.process.url}") String transferConfirmProcessURL) { - System.getProperties().setProperty(NarayanaLRAClient.LRA_COORDINATOR_URL_KEY, lraCoordinatorUrl); - this.accountWithdrawUrl = accountWithdrawUrl; - this.accountDepositUrl = accountDepositUrl; - this.transferCancelURL = transferCancelURL; - this.transferCancelProcessURL = transferCancelProcessURL; - this.transferConfirmURL = transferConfirmURL; - this.transferConfirmProcessURL = transferConfirmProcessURL; - } -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/JerseyConfig.java b/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/JerseyConfig.java deleted file mode 100644 index 37ae005c0..000000000 --- a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/JerseyConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.transfer; - -import io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipantRegistry; -import org.glassfish.hk2.utilities.binding.AbstractBinder; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.servlet.ServletProperties; -import org.springframework.stereotype.Component; - -import javax.ws.rs.ApplicationPath; - -@Component -@ApplicationPath("/") -public class JerseyConfig extends ResourceConfig { - - public JerseyConfig() { - register(TransferService.class); - register(io.narayana.lra.filter.ServerLRAFilter.class); - register(new AbstractBinder(){ - @Override - protected void configure() { - bind(LRAParticipantRegistry.class) - .to(LRAParticipantRegistry.class); - } - }); - property(ServletProperties.FILTER_FORWARD_ON_404, true); - } - -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/TransferApplication.java b/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/TransferApplication.java deleted file mode 100644 index 12e3a2610..000000000 --- a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/TransferApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.transfer; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class TransferApplication { - - public static void main(String[] args) { - SpringApplication.run(TransferApplication.class, args); - } -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/TransferService.java b/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/TransferService.java deleted file mode 100644 index 7c7f6b16d..000000000 --- a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/TransferService.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.transfer; - -import static org.eclipse.microprofile.lra.annotation.ws.rs.LRA.LRA_HTTP_CONTEXT_HEADER; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.logging.Logger; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -import org.eclipse.microprofile.lra.annotation.ws.rs.LRA; - -import io.narayana.lra.Current; - -@ApplicationScoped -@Path("/") -public class TransferService { - - private static final Logger log = Logger.getLogger(TransferService.class.getSimpleName()); - public static final String TRANSFER_ID = "TRANSFER_ID"; - private URI withdrawUri; - private URI depositUri; - private URI transferCancelUri; - private URI transferConfirmUri; - private URI transferProcessCancelUri; - private URI transferProcessConfirmUri; - - @PostConstruct - private void initController() { - try { - withdrawUri = new URI(ApplicationConfig.accountWithdrawUrl); - depositUri = new URI(ApplicationConfig.accountDepositUrl); - transferCancelUri = new URI(ApplicationConfig.transferCancelURL); - transferConfirmUri = new URI(ApplicationConfig.transferConfirmURL); - transferProcessCancelUri = new URI(ApplicationConfig.transferCancelProcessURL); - transferProcessConfirmUri = new URI(ApplicationConfig.transferConfirmProcessURL); - } catch (URISyntaxException ex) { - throw new IllegalStateException("Failed to initialize " + TransferService.class.getName(), ex); - } - } - - @GET - @Path("/hello") - @Produces(MediaType.APPLICATION_JSON) - public Response ping () throws NotFoundException { - log.info("Say Hello!"); - return Response.ok().build(); - } - - @POST - @Path("/transfer") - @Produces(MediaType.APPLICATION_JSON) - @LRA(value = LRA.Type.REQUIRES_NEW, end = false) - public Response transfer(@QueryParam("fromAccount") long fromAccount, - @QueryParam("toAccount") long toAccount, - @QueryParam("amount") long amount, - @HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) { - if (lraId == null) { - return Response.serverError().entity("Failed to create LRA").build(); - } - log.info("Started new LRA/transfer Id: " + lraId); - - boolean isCompensate = false; - String returnString = ""; - - // perform the withdrawal - returnString += withdraw(fromAccount, amount); - log.info(returnString); - if (returnString.contains("succeeded")) { - // if it worked, perform the deposit - returnString += " " + deposit(toAccount, amount); - log.info(returnString); - if (returnString.contains("failed")) - isCompensate = true; // deposit failed - } else - isCompensate = true; // withdraw failed - log.info("LRA/transfer action will be " + (isCompensate ? "cancel" : "confirm")); - - // call complete or cancel based on outcome of previous actions - WebTarget webTarget = ClientBuilder.newClient().target(isCompensate ? transferCancelUri : transferConfirmUri); - webTarget.request().header(TRANSFER_ID, lraId) - .post(Entity.text("")).readEntity(String.class); - - // return status - return Response.ok("transfer status:" + returnString).build(); - - } - - private String withdraw(long accountId, long amount) { - log.info("withdraw accountId = " + accountId + ", amount = " + amount); - WebTarget webTarget = ClientBuilder.newClient().target(withdrawUri).path("/") - .queryParam("accountId", accountId) - .queryParam("amount", amount); - URI lraId = Current.peek(); - log.info("withdraw lraId = " + lraId); - String withdrawOutcome = webTarget.request().header(LRA_HTTP_CONTEXT_HEADER, lraId) - .post(Entity.text("")).readEntity(String.class); - return withdrawOutcome; - } - - private String deposit(long accountId, long amount) { - log.info("deposit accountId = " + accountId + ", amount = " + amount); - WebTarget webTarget = ClientBuilder.newClient().target(depositUri).path("/") - .queryParam("accountId", accountId) - .queryParam("amount", amount); - URI lraId = Current.peek(); - log.info("deposit lraId = " + lraId); - String depositOutcome = webTarget.request().header(LRA_HTTP_CONTEXT_HEADER, lraId) - .post(Entity.text("")).readEntity(String.class); - ; - return depositOutcome; - } - - @POST - @Path("/processconfirm") - @Produces(MediaType.APPLICATION_JSON) - @LRA(value = LRA.Type.MANDATORY) - public Response processconfirm(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws NotFoundException { - log.info("Process confirm for transfer : " + lraId); - return Response.ok().build(); - } - - @POST - @Path("/processcancel") - @Produces(MediaType.APPLICATION_JSON) - @LRA(value = LRA.Type.MANDATORY, cancelOn = Response.Status.OK) - public Response processcancel(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) String lraId) throws NotFoundException { - log.info("Process cancel for transfer : " + lraId); - return Response.ok().build(); - } - - @POST - @Path("/confirm") - @Produces(MediaType.APPLICATION_JSON) - @LRA(value = LRA.Type.NOT_SUPPORTED) - public Response confirm(@HeaderParam(TRANSFER_ID) String transferId) throws NotFoundException { - log.info("Received confirm for transfer : " + transferId); - String confirmOutcome = ClientBuilder.newClient().target(transferProcessConfirmUri).request() - .header(LRA_HTTP_CONTEXT_HEADER, transferId) - .post(Entity.text("")).readEntity(String.class); - return Response.ok(confirmOutcome).build(); - } - - @POST - @Path("/cancel") - @Produces(MediaType.APPLICATION_JSON) - @LRA(value = LRA.Type.NOT_SUPPORTED, cancelOn = Response.Status.OK) - public Response cancel(@HeaderParam(TRANSFER_ID) String transferId) throws NotFoundException { - log.info("Received cancel for transfer : " + transferId); - String confirmOutcome = ClientBuilder.newClient().target(transferProcessCancelUri).request() - .header(LRA_HTTP_CONTEXT_HEADER, transferId) - .post(Entity.text("")).readEntity(String.class); - return Response.ok(confirmOutcome).build(); - } - -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/servlet/filter/SpringMvcPrefixEnforcerFilter.java b/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/servlet/filter/SpringMvcPrefixEnforcerFilter.java deleted file mode 100644 index 6c735afb7..000000000 --- a/cloudbank-v2/spring-apps/transfer/src/main/java/com/example/transfer/servlet/filter/SpringMvcPrefixEnforcerFilter.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2023, Oracle and/or its affiliates. -// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -package com.example.transfer.servlet.filter; - -import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -@Component -@SuppressWarnings("ConfigurationProperties") -@ConfigurationProperties("spring.mvc") -public class SpringMvcPrefixEnforcerFilter implements Filter { - private static final String SPRING_MVC_SERVLET = DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME; - private ServletContext servletContext; - private Set enforcedPrefixes; - - @Override - public void init(FilterConfig filterConfig) { - servletContext = filterConfig.getServletContext(); - } - - @Override - public void doFilter(ServletRequest request, - ServletResponse response, - FilterChain chain) throws IOException, - ServletException { - if (request.getDispatcherType() == DispatcherType.FORWARD) { - chain.doFilter(request, response); - return; - } - - if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) { - doHttpFilter((HttpServletRequest) request, - (HttpServletResponse) response, - chain); - return; - } - - chain.doFilter(request, response); - } - - private void doHttpFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { - if (enforcedPrefixes.stream().anyMatch(request.getRequestURI()::startsWith)) { - servletContext.getNamedDispatcher(SPRING_MVC_SERVLET) - .forward(request, response); - return; - } - chain.doFilter(request, response); - } - - public void setEnforcedPrefixes(Set enforcedPrefixes) { - this.enforcedPrefixes = enforcedPrefixes; - } -} \ No newline at end of file diff --git a/cloudbank-v2/spring-apps/transfer/src/main/resources/application.yaml b/cloudbank-v2/spring-apps/transfer/src/main/resources/application.yaml deleted file mode 100644 index 1d45c1677..000000000 --- a/cloudbank-v2/spring-apps/transfer/src/main/resources/application.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2023, Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ - -spring: - application: - name: transfer - zipkin: - base-url: ${zipkin.base-url} - mvc: - enforced-prefixes: - - /actuator - - /rest - url-mappings: - - "/rest/*" - - "/actuator/*" - - "/error/*" - -account: - deposit: - url: http://account.application:8080/deposit/deposit - withdraw: - url: http://account.application:8080/withdraw/withdraw -transfer: - cancel: - url: http://transfer.application:8080/cancel - process: - url: http://transfer.application:8080/processcancel - confirm: - url: http://transfer.application:8080/confirm - process: - url: http://transfer.application:8080/processconfirm -lra: - coordinator: - url: http://otmm-tcs.otmm.svc.cluster.local:9000/api/v1/lra-coordinator - -management: - endpoint: - prometheus: - enabled: true - health: - show-details: always - endpoints: - migrate-legacy-ids: true - web: - base-path: /actuator - path-mapping: - health: status - exposure: - include: "*" - server: - add-application-context-header: true - metrics: - tags: - application: ${spring.application.name} \ No newline at end of file diff --git a/common/docs/DeployFunctions.md b/common/docs/DeployFunctions.md deleted file mode 100644 index b3531d790..000000000 --- a/common/docs/DeployFunctions.md +++ /dev/null @@ -1,47 +0,0 @@ -_Copyright (c) 2019, 2020, 2021 Oracle and/or its affiliates The Universal Permissive License (UPL), Version 1.0_ - -# Deployment Functions - -The deployment helper functions are defined in common/utils/deploy-functions.env and sourced by common/source.env. They are used to streamline the deployment of microservices. - -## k8s_deploy - -Deploy a set of yaml files. The function accepts a single parameter that represents a space separate list of yaml files to be deployed, for example: - -``` -k8s-deploy 'inventory-helidon-deployment.yaml inventory-service.yaml' -``` - -### Internals - -kubectl apply is used to deploy the files and so the k8s_deploy function is idempotent. - -The yaml files are expected to be in the same folder as the script that invokes this function. - -The yaml files are processed to substitute environment variables before they are deployed. The processed yaml files are place in the .deployed folder in the home directory of the microservice. - -The syntax available to define substitution variable is as follows: - -- **${VAR}** Fails if VAR is undefined, else is substitutes the value of VAR -- **${VAR-default}** If VAR is not defined substitute 'default', else substitutes the value of VAR -- **${VAR-}** If VAR is not defined substitute '', else it substitutes the value of VAR -- **${VAR?MSG}** Fails if VAR is undefined with the error 'MSG', else it substitutes value of VAR -- **${VAR:-default}** If VAR is not defined or empty, substitute 'default', else it substitutes the value of VAR -- **${VAR:?MSG}** Fails if VAR is undefined or empty with the error 'MSG', else it substitutes the value of VAR - -Here is an example: - -``` -- name: OCI_REGION - value: "${OCI_REGION-}" -``` - -## k8s_undeploy - -Undeploy the yaml files what were deployed by k82_deploy. The files are undeployed in the reverse order. - -### Internals - -The yaml files of the deployed resources are found in the .deployed folder. The files are deleted once thay have been undeployed. - -kubectl delete is used to undeploy the resources. diff --git a/common/source.env b/common/source.env deleted file mode 100644 index dee1449fb..000000000 --- a/common/source.env +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Make sure this is run via source or . -if ! (return 0 2>/dev/null); then - echo "ERROR: Usage 'source source.env'" - return 1 -fi - -export MSDD_CODE="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )" -export MSDD_INFRA_CODE="$MSDD_CODE/infra" -export MSDD_APPS_CODE="$MSDD_CODE" -export MSDD_WORKSHOP_CODE="$MSDD_CODE/workshops" - -source $MSDD_CODE/common/utils/provisioning-functions.env -source $MSDD_CODE/common/utils/deploy-functions.env -source $MSDD_CODE/common/utils/setup-functions.env diff --git a/common/utils/deploy-functions.env b/common/utils/deploy-functions.env deleted file mode 100644 index 059dae45b..000000000 --- a/common/utils/deploy-functions.env +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - - -if ! (return 0 2>/dev/null); then - echo "ERROR: Usage 'source deploy_functions.env'" - return 1 -fi - - -# k8s-deploy -# Deploy a microservice -# $1: Space separated list of files to be deployed (in order of deployment) -# -function k8s-deploy() { - # Fail on error or inadvertently referencing undefined variables - set -eu - - # Locate the script directory. All the files are there. - local SCRIPT_DIR=$(dirname "$0") - if ! test -d $SCRIPT_DIR; then - echo "ERROR: Script directory does not exist" - return 1 - fi - - # First parameter is required - local DEPLOYMENT_FILES="$1" - - local DEPLOYED_DIR=$SCRIPT_DIR/.deployed - - local df - for df in $DEPLOYMENT_FILES; do - echo "Applying $df" - mkdir -p $DEPLOYED_DIR - - # Expand the deployment file into the deployed directory - eval "cat >$DEPLOYED_DIR/$df </dev/null); then - echo "ERROR: Usage 'source provisioning_functions.env'" - return 1 -fi - - -# provisioning-get-status() -# State folder supplied by $1 or if $1 is not supplied then by the current directory -# Get the status of provisioning: -# byo: Pre-provisioned -# new: Either new or destroyed -# applying: Apply is running -# applying-failed: Apply was running and failed -# applied: Apply has completed -# destroying: Destroy is running -# destroying-failed: Destroy was running and failed -# destroyed: Destroy completed -# -function provisioning-get-status() { - local MY_STATE - if ! test -z "${1-}"; then - if test -d "$1"; then - MY_STATE="$1" - else - # Invalid parameter - return 1 - fi - else - MY_STATE=$PWD - fi - local OUTPUT_FILE=$MY_STATE/output.env - local STATE_FILE=$MY_STATE/state.env - local PID_FILE=$MY_STATE/PID - local OP_FILE=$MY_STATE/OP - - if test -f $MY_STATE/byo; then - echo 'byo' - return 0 - fi - - if test -f $OUTPUT_FILE; then - echo 'applied' - return 0 - fi - - if ! test -f $OP_FILE; then - echo 'new' - return 0 - fi - - if ! test -f $STATE_FILE; then - echo 'destroyed' - return 0 - fi - - local OP=$(<$OP_FILE) - - if test -f $PID_FILE && ps -fp $(<$PID_FILE) >/dev/null 2>&1; then - # Process is running - echo "$OP" - else - echo "$OP-failed" - rm -f $PID_FILE - fi -} - - -# provisioning-set-op() -# Set whether apply or destroy operation: -# applying: Apply -# destroying: Destroy -# -function provisioning-set-op() { - local OP_FILE=$MY_STATE/OP - echo "$1">$OP_FILE -} - - -# provisioning-apply() -# Provision something. Current directory is to be used to store the state. -# $1: The code home of the thing to be provisioned (required) -# -# Checks and creates the MY_CODE file -# Validates the required input parameters, constructs the state file, and removes the input file, and executes apply.sh (except for BYO) -# Validates the output file (including BYO) -# -function provisioning-apply() { - local MY_STATE=$PWD - local OUTPUT_FILE=$MY_STATE/output.env - local STATE_FILE=$MY_STATE/state.env - local INPUT_FILE=$MY_STATE/input.env - local PID_FILE=$MY_STATE/PID - local MY_CODE="${1-}" - local MY_CODE_FILE=$MY_STATE/MY_CODE - local REQ_UTILS REQ_INPUT_PARAMS REQ_OUTPUT_PARAMS - local REQ_FILE=$MY_CODE/requirements.env - - if ! local STATUS=$(provisioning-get-status); then - echo "ERROR: Invalid status" - return 1 - fi - - case "$STATUS" in - - applying | applied | byo) - # Nothing to do - return 0 - ;; - - destroying | destroying-failed | destroyed) - # Cannot apply during destroy phase - echo "ERROR: Trying to apply during destroy phase. Not supported." - return 1 - ;; - - new) - # Starting apply so located and validate code, utils and inputs - # Locate and check the code home - if ! test -d $MY_CODE; then - echo "ERROR: Code folder $MY_CODE does not exist" - return 1 - fi - echo "$MY_CODE" > $MY_CODE_FILE - - echo "Beginning $MY_CODE/apply.sh on $MY_STATE" - - # Check the apply script - if ! test -f $MY_CODE/apply.sh; then - echo "ERROR: No apply.sh script in code folder $MY_CODE" - return 1 - fi - - # Check the requirements file - if ! test -f $REQ_FILE; then - echo "ERROR: Invalid code folder $MY_CODE. $REQ_FILE is missing." - return 1 - fi - source $REQ_FILE - - # Validate required utils TODO - - # Populate the state file with input. - provisioning-set-op applying - - if test -z "$REQ_INPUT_PARAMS"; then - # No required parameters, no input required, empty init state file - echo "" > $STATE_FILE - elif ! test -f $INPUT_FILE; then - # Input file is missing - echo "$INPUT_FILE is missing" - return 1 - else - # Populate init state - local TEMP_STATE_FILE=$MY_STATE/temp_state.env - rm -f $TEMP_STATE_FILE - # Process input file in a subshell with empty env - if env -i /bin/bash --norc --noprofile; then - # If successful then make it permanent - mv $TEMP_STATE_FILE $STATE_FILE - else - return 1 - fi <>$TEMP_STATE_FILE -done -! - # Done with the input file so remove it - rm -f $INPUT_FILE - fi - - ;; - - applying-failed) - # Restarting apply - echo "Restarting $MY_CODE/apply.sh on $MY_STATE" - MY_CODE=$(<$MY_CODE_FILE) - source $REQ_FILE - ;; - - esac - - # Execute the apply.sh. Skip if the output file exists (already done) or BYO. - cd $MY_STATE - $MY_CODE/apply.sh - cd $MY_STATE - - # Check for success - if ! test -f $OUTPUT_FILE; then - # We are done but no output file, so looks like we failed - echo "ERROR: provisioning-apply failed for code $MY_CODE in state folder $MY_STATE. No output file. " - return 1 - fi - - # Validate the output - if ! env -i /bin/bash --norc --noprofile; then - # Missing output parameter - return 1 - fi < "$PID_FILE" - - source $STATE_FILE -} - - -# provisioning-helper-pre-destroy() -# -# First thing to run in every executed destroy function -# Sets the MY_STATE variable -# Finds and sets the MY_CODE variable -# Sets PID file so only one instance can be running -# Sources the state file -# -function provisioning-helper-pre-destroy() { - set -e - - MY_STATE=$PWD - STATE_FILE=$MY_STATE/state.env - PID_FILE=$MY_STATE/PID - MY_CODE_FILE=$MY_STATE/MY_CODE - - # Locate my code - MY_CODE=$(<$MY_CODE_FILE) - - # Prevent parallel execution - trap "rm -f -- '$PID_FILE'" EXIT - echo $$ > "$PID_FILE" - - source $STATE_FILE -} - - -export -f provisioning-get-status -export -f provisioning-set-op -export -f provisioning-apply -export -f provisioning-destroy -export -f provisioning-helper-pre-apply -export -f provisioning-helper-pre-destroy \ No newline at end of file diff --git a/common/utils/setup-functions.env b/common/utils/setup-functions.env deleted file mode 100644 index 8c4ef53bd..000000000 --- a/common/utils/setup-functions.env +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - - -if ! (return 0 2>/dev/null); then - echo "ERROR: Usage 'source setup_functions.env'" - return 1 -fi - -# Request compartment details and create or validate -# Parameters: -# $1: Run Type: LL or OT (required) -# $2: The tenancy OCID (required) -# $3: Home region (required) -# $4: The description text of the compartment if it is created (required) -# -# Input Environment variables: -# TEST_COMPARTMENT: Compartment name or OCID to use (otional) -# TEST_PARENT_COMPARTMENT_OCID: Parent compartment OCID (optional) -# -# Output Environment variables: -# COMPARTMENT_OCID: Returned compartment OCID -# -function compartment-dialog() { - set -u - COMPARTMENT_OCID='' # Updated in calling shell, not local - local COMP - local PARENT_COMP - local RUN_TYPE="$1" - local TENANCY_OCID="$2" - local HOME_REGION="$3" - local COMP_DESC="$4" - - while test -z "$COMPARTMENT_OCID"; do - if test "$RUN_TYPE" == 'LL'; then - # The compartment is already created. Ask for the OCID - read -p "Please enter your OCI compartment's OCID: " COMP - if ! oci iam compartment get --compartment-id "$COMP" 2>&1 >~/comp_ocid_err; then - echo "ERROR: The compartment $COMP does not exist. Please retry." - cat ~/comp_ocid_err - rm ~/comp_ocid_err - continue - else - rm ~/comp_ocid_err - COMPARTMENT_OCID="$COMP" - break - fi - fi - - if ! test -z "${TEST_COMPARTMENT-}"; then - COMP="$TEST_COMPARTMENT" - else - echo 'Please enter the OCI compartment where you would like the workshop resources to be created.' - echo 'For an existing compartment, enter the OCID. For a new compartment, enter the name.' - read -p "Please specify the compartment: " COMP - fi - - if test -z "$COMP"; then - echo "ERROR: No compartment specified" - continue - fi - - if [[ "$COMP" =~ ocid1.* ]]; then - # An existing compartment - if ! oci iam compartment get --compartment-id "$COMP" 2>&1 >~/comp_ocid_err; then - echo "ERROR: The compartment $COMP does not exist. Please retry." - cat ~/comp_ocid_err - rm ~/comp_ocid_err - if ! test -z "${TEST_COMPARTMENT-}"; then - return 1 - fi - continue - else - rm ~/comp_ocid_err - COMPARTMENT_OCID="$COMP" - break - fi - fi - - # New compartment - if ! test -z "${TEST_PARENT_COMPARTMENT_OCID-}"; then - PARENT_COMP="$TEST_PARENT_COMPARTMENT_OCID" - else - echo 'Please enter the OCID of the compartment in which you would like the new compartment to be created.' - read -p "Please specify the parent compartment OCID (hit return for the root compartment): " PARENT_COMP - if [[ ! "$PARENT_COMP" =~ ocid1.* ]]; then - PARENT_COMP="$TENANCY_OCID" - fi - fi - - COMPARTMENT_OCID=`oci iam compartment create --region "$HOME_REGION" --compartment-id "$PARENT_COMP" --name "$COMP" --description "$COMP_DESC" --query 'data.id' --raw-output` - done - - # Wait for the compartment to become active - while ! test `oci iam compartment get --compartment-id "$COMPARTMENT_OCID" --query 'data."lifecycle-state"' --raw-output 2>/dev/null`"" == 'ACTIVE'; do - echo "Waiting for the compartment to become ACTIVE" - sleep 5 - done - return 0 -} -export -f compartment-dialog - - -# Setup the state store -# Parameters: -# $1: Full hierarchical name of the state store folder (required) -# $2: Log file (required) -# -# Output: -# Exported state functions -# -function state-store-setup () { - set -u - local STATE_STORE_FOLDER="$1" - local STATE_STORE_LOG="$2" - local STATE_STORE_STATUS - - if ! STATE_STORE_STATUS=$(provisioning-get-status $STATE_STORE_FOLDER); then - echo "ERROR: Unable to get workshop state store status" - return 1 - fi - - case "$STATE_STORE_STATUS" in - - applied | byo) - # Nothing to do - ;; - - applying) - # Setup already running so exit - echo "ERROR: Setup is already running and so cannot run setup" - return 1 - ;; - - destroying-failed | destroying | destroyed) - # Cannot setup during destroy phase - echo "ERROR: Destroy is running and so cannot run setup" - return 1 - ;; - - applying-failed | new) - # Start or restart the state_store setup - cd $STATE_STORE_FOLDER - echo "STATE_LOG='$STATE_STORE_LOG'" > $STATE_STORE_FOLDER/input.env - if ! provisioning-apply $MSDD_INFRA_CODE/state_store; then - echo "ERROR: Failed to create state_store in $STATE_STORE_FOLDER" - return 1 - fi - ;; - - esac - source $STATE_STORE_FOLDER/output.env - return 0 -} -export -f state-store-setup - - -# Setup folder based vault -# Parameters: -# $1: Full hierarchical name of the vault state folder (required) -# Output: -# Exported vault functions -# -function folder-vault-setup () { - set -u - local VAULT_STATE_FOLDER="$1" - local VAULT_STATUS - - if ! VAULT_STATUS=$(provisioning-get-status "$VAULT_STATE_FOLDER"); then - echo "ERROR: Unable to get workshop vault status" - return 1 - fi - - case "$VAULT_STATUS" in - - applied | byo) - # No setup to do - ;; - - applying) - # Setup already running so exit - echo "ERROR: Setup is already running and so cannot run setup" - return 1 - ;; - - destroying-failed | destroying | destroyed) - # Cannot setup during destroy phase - echo "ERROR: Destroy is running and so cannot run setup" - return 1 - ;; - - applying-failed | new) - # Start or restart the vault setup - cd $VAULT_STATE_FOLDER - if ! provisioning-apply $MSDD_INFRA_CODE/vault/folder; then - echo "ERROR: Failed to create vault in $VAULT_STATE_FOLDER" - return 1 - fi - ;; - - esac - source $VAULT_STATE_FOLDER/output.env -} -export -f folder-vault-setup \ No newline at end of file diff --git a/infra/README.md b/infra/README.md deleted file mode 100644 index d7377e29a..000000000 --- a/infra/README.md +++ /dev/null @@ -1,650 +0,0 @@ - -# Building Microservices with Converged Oracle Database On-Premises Workshop - -This workshop will help you understand the technical capabilities inside and outside the Oracle converged database to support a scalable data and event-driven microservices architecture. - -You will create an application with Helidon microservices and a Javascript front-end, deployed to a minikube kubernetes cluster, using REST and messaging for communication and accessing pluggable Oracle databases. Oracle Database is hosted on a docker container. - -![img_92.png](images/img_92.png) - -# microservices-datadriven-infra - -Describe the application here,... - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - -[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/vishalmmehra/microservices-datadriven/raw/main/infra/multi-node-deployment2.zip) - -
-Lab 1:Setup - -1. Click on [![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/vishalmmehra/microservices-datadriven/raw/main/infra/multi-node-deployment2.zip) - -2. Login to your Cloud Account - -3. Accept the Oracle Terms of Use - -![img_65.png](images/img_65.png) - - -4. Select the compartment in which you want to deploy this application - -![img_66.png](images/img_66.png) - - -5. Click on Next (Left Bottom Screen) - -![img_67.png](images/img_67.png) - - -6. Pick the Compute (FrontEnd) and Oracle Database Instance Shape - - - Shape VM.Standard.E2.2 or higher is strongly recommended - -![img_69.png](images/img_69.png) - - -7. (optional) Upload SSH Keys if you have already crated SSH Keys - - -8. (optional) Provide Database and/or Application Passwords - auto-generated Passwords are strongly recommended - - -9. Ensure "Infrastructure and Application Setup URL" is correct (will change post GA) - - -10. Click on Next (Left Bottom Screen) - -![img_68.png](images/img_68.png) - -11. Verify your configuration (ensure Run Apply checkbox is selected) - -![img_70.png](images/img_70.png) - -12. Click on Create Button (Left Bottom Screen) - -![img_71.png](images/img_71.png) - -13. Check if your Job has been accepted (Job takes around 5 minutes to create the infrastructure) - -![img_72.png](images/img_72.png) - -![img_73.png](images/img_73.png) - -14. Wait for this job to complete (Job takes around 5 minutes to create the infrastructure) - -![img_74.png](images/img_74.png) - -![img_75.png](images/img_75.png) - -15. Confirm the output (Click on Logs and Outputs under Resources Section) - -![img_76.png](images/img_76.png) - -![img_77.png](images/img_77.png) - -![img_78.png](images/img_78.png) - -**Key Points** - -
  • Make a note of variable dbaas_public_ip - this is your Database instance public IP address
  • - -![img_83.png](images/img_83.png) - -
  • Make a note of variable compute_instance_public_ip - this is your Application (FrontEnd) instance public IP address
  • - -![img_84.png](images/img_84.png) - -
  • Make a note of variable Grabdish_Application_Password - this is your Application (FrontEnd) password
  • - -![img_85.png](images/img_85.png) - -
  • Make a note of variable Login_Instructions - using these you can login to the Grabdish FrontEnd Application
  • - - -
  • Access generated SSH Keys - Click on unblock to display generated_instance_ssh_private_key
  • - -![img_79.png](images/img_79.png) - -
  • Copy the generated key and safe it to a filename (like grabdish-on-premises.key) of your choice - -![img_81.png](images/img_81.png) - -16. Tail Database Logs (optional) - -`ssh -i grabdish-on-premises.key opc@150.136.61.46` - -`cd; tail -f microservices-infra-install.log` - -check if the Database Provisioning including generation of PDBs has been completed - -![img_86.png](images/img_86.png) - -17. Tail Application Server Logs (optional) - -`ssh -i grabdish-on-premises.key opc@158.101.98.17` - -![img_87.png](images/img_87.png) - -`cd; tail -f infra-install.log` - -![img_88.png](images/img_88.png) - - - -
  • - -
    -Lab 2: Data-centric microservices walkthrough with Helidon MP - -
    -Task 1: Access the FrontEnd UI - -You are ready to access the frontend page. Open a new browser tab and enter the external IP URL: - -https:// - -Note that for convenience a self-signed certificate is used to secure this https address and so it is likely you will be prompted by the browser to allow access. - -You will then be prompted to authenticate to access the Front End microservices. The user is grabdish and the password is the one you entered in Lab 1. -![img.png](images/img40.png) - - -You should then see the Front End home page. You've now accessed your first microservice of the lab! - -![img_41.png](images/img_41.png) - -We created a self-signed certificate to protect the frontend-helidon service. This certificate will not be recognized by your browser and so a warning will be displayed. It will be necessary to instruct the browser to trust this site in order to display the frontend. In a production implementation a certificate that is officially signed by a certificate authority should be used. -
    -
    -Task 2: Verify the Order and Inventory Functionality of GrabDish store - -Click Transactional under Labs. - -![img_42.png](images/img_42.png) - -Check the inventory of a given item such as sushi, by typing sushi in the food field and clicking Get Inventory. You should see the inventory count result 0. - -![img_43.png](images/img_43.png) - -(Optional) If for any reason you see a different count, click Remove Inventory to bring back the count to 0. - -Let’s try to place an order for sushi by clicking Place Order. - -![img_44.png](images/img_44.png) - - -To check the status of the order, click Show Order. You should see a failed order status. - -![img_45.png](images/img_45.png) - -This is expected, because the inventory count for sushi was 0. - -Click Add Inventory to add the sushi in the inventory. You should see the outcome being an incremental increase by 1. - -![img_46.png](images/img_46.png) - - -Go ahead and place another order by increasing the order ID by 1 (67) and then clicking Place Order. Next click Show Order to check the order status. - -![img_47.png](images/img_47.png) - -![img_48.png](images/img_48.png) - -The order should have been successfully placed, which is demonstrated with the order status showing success. - -Although this might look like a basic transactional mechanic, the difference in the microservices environment is that it’s not using a two-phase XA commit, and therefore not using distributed locks. In a microservices environment with potential latency in the network, service failures during the communication phase or delays in long running activities, an application shouldn’t have locking across the services. Instead, the pattern that is used is called the saga pattern, which instead of defining commits and rollbacks, allows each service to perform its own local transaction and publish an event. The other services listen to that event and perform the next local transaction. - -In this architecture, there is a frontend service which mimics some mobile app requests for placing orders. The frontend service is communicating with the order service to place an order. The order service is then inserting the order into the order database, while also sending a message describing that order. This approach is called the event sourcing pattern, which due to its decoupled non-locking nature is prominently used in microservices. The event sourcing pattern entails sending an event message for every work or any data manipulation that was conducted. In this example, while the order was inserted in the order database, an event message was also created in the Advanced Queue of the Oracle database. - -Implementing the messaging queue inside the Oracle database provides a unique capability of performing the event sourcing actions (manipulating data and sending an event message) atomically within the same transaction. The benefit of this approach is that it provides a guaranteed once delivery, and it doesn’t require writing additional application logic to handle possible duplicate message deliveries, as it would be the case with solutions using separate datastores and event messaging platforms. - -In this example, once the order was inserted into the Oracle database, an event message was also sent to the interested parties, which in this case is the inventory service. The inventory service receives the message and checks the inventory database, modifies the inventory if necessary, and sends back a message if the inventory exists or not. The inventory message is picked up by the order service which based on the outcome message, sends back to the frontend a successful or failed order status. - -This approach fits the microservices model, because the inventory service doesn’t have any REST endpoints, and instead it purely uses messaging. The services do not talk directly to each other, as each service is isolated and accesses its datastore, while the only communication path is through the messaging queue. - -This architecture is tied with the Command Query Responsibility Segregation (CQRS) pattern, meaning that the command and query operations use different methods. In our example the command was to insert an order into the database, while the query on the order is receiving events from different interested parties and putting them together (from suggestive sales, inventory, etc). Instead of actually going to suggestive sales service or inventory service to get the necessary information, the service is receiving events. - -Let’s look at the Java source code to understand how Advanced Queuing and Oracle database work together. - - - -What is unique to Oracle and Advanced Queuing is that a JDBC connection can be invoked from an AQ JMS session. Therefore we are using this JMS session to send and receive messages, while the JDBC connection is used to manipulate the datastore. This mechanism allows for both the JMS session and JDBC connection to exist within same atomic local transaction. - -
    - -
    -Task 3: Verify Spatial Functionality - -Click Spatial on the Transactional tab - -![img_49.png](images/img_49.png) - -Check Show me the Fusion menu to make your choices for the Fusion Cuisine - -![img_50.png](images/img_50.png) - -Click the plus sign to add Makizushi, Miso Soup, Yakitori and Tempura to your order and click Ready to Order. - -![img_51.png](images/img_51.png) - - -Click Deliver here to deliver your order to the address provided on the screen - -![img_52.png](images/img_52.png) - -Your order is being fulfilled and will be delivered via the fastest route. - -![img_53.png](images/img_53.png) - -Go to the other tab on your browser to view the Transactional screen. - -![img_54.png](images/img_54.png) - -This demo demonstrates how geocoding (the set of latitude and longitude coordinates of a physical address) can be used to derive coordinates from addresses and how routing information can be plotted between those coordinates. Oracle JET web component provides access to mapping from an Oracle Maps Cloud Service and it is being used in this demo for initializing a map canvas object (an instance of the Mapbox GL JS API's Map class). The map canvas automatically displays a map background (aka "basemap") served from the Oracle Maps Cloud Service. This web component allows mapping to be integrated simply into Oracle JET and Oracle Visual Builder applications, backed by the full power of Oracle Maps Cloud Service including geocoding, route-finding and multiple layer capabilities for data overlay. The Oracle Maps Cloud Service (maps.oracle.com or eLocation) is a full Location Based Portal. It provides mapping, geocoding and routing capabilities similar to those provided by many popular commercial online mapping services. - -
    - -
    Task 4: Show Metrics - -Notice @Timed and @Counted annotations on placeOrder method of $GRABDISH_HOME/order-helidon/src/main/java/io/helidon/data/examples/OrderResource.java - -![img_55.png](images/img_55.png) - -Click Tracing, Metrics, and Health - -![img_56.png](images/img_56.png) - -Click Show Metrics and notice the long string of metrics (including those from placeOrder timed and counted) in prometheus format. - -![img_57.png](images/img_57.png) - -
    - -
    -Task 5: Verify Health - -Oracle Cloud Infrastructure Container Engine for Kubernetes (OKE) provides health probes which check a given container for its liveness (checking if the pod is up or down) and readiness (checking if the pod is ready to take requests or not). In this STEP you will see how the probes pick up the health that the Helidon microservice advertises. Click Tracing, Metrics, and Health and click Show Health: Liveness - -![img_58.png](images/img_58.png) - -Notice health check class at $GRABDISH_HOME/order-helidon/src/main/java/io/helidon/data/examples/OrderServiceLivenessHealthCheck.java and how the liveness method is being calculated. - -![img_59.png](images/img_59.png) - - -Notice liveness probe specified in $GRABDISH_HOME/order-helidon/order-helidon-deployment.yaml The livenessProbe can be set up with different criteria, such as reading from a file or an HTTP GET request. In this example the OKE health probe will use HTTP GET to check the /health/live and /health/ready addresses every 3 seconds, to see the liveness and readiness of the service. - -![img_60.png](images/img_60.png) - -In order to observe how OKE will manage the pods, the microservice has been created with the possibility to set up the liveliness to “false”. Click Get Last Container Start Time and note the time the container started. - - - -Click Set Liveness to False . This will cause the Helidon Health Check to report false for liveness which will result in OKE restarting the pod/microservice - -![img_61.png](images/img_61.png) - -Click Get Last Container Start Time. It will take a minute or two for the probe to notice the failed state and conduct the restart and as it does you may see a connection refused exception. - -![img_62.png](images/img_62.png) - -Eventually you will see the container restart and note the new/later container startup time reflecting that the pod was restarted. -![img_63.png](images/img_63.png) -
    -
    - -
    - - - Lab 3: Polyglot Microservices - - -The illustration below shows four microservices – Order, Inventory, Delivery, Supplier, and the infrastructure required to run them. - -![img.png](images/img.png) - -For more information on microservices visit http://developer.oracle.com/microservices - -This lab will show you how to switch the Inventory microservice to a Python, Node.js, .NET, Go, Spring Boot or Java Helidon SE implementation while retaining the same application functionality. - -Estimates Lab Time - 10 minutes - -**Objectives** - -Undeploy the existing Java Helidon MP Inventory microservice -Deploy an alternate implementation of the Inventory microservice and test the application functionality - -**Prerequisites** - -This lab assumes you have already completed the previous labs. - -
    -Task 1: Undeploy the Java Helidon MP Inventory Microservice - -To undeploy the Inventory Helidon MP service, open the Cloud Shell and go to the inventory-helidon folder, using the following command. - -`$GRABDISH_HOME/inventory-helidon ; ./undeploy.sh` -
    - -
    -Task 2: Deploy an alternate implementation of the Inventory Microservice - -In this step you can choose between six different implementations of the Inventory Microservice: PL/SQL, Python, NodeJS, .NET, Go, or Java Helidon SE. - -Select one of the alternate implementations and deploy the service for the selected implementation. - -If you selected PL/SQL, deploy this service: - -`cd $GRABDISH_HOME/inventory-plsql; ./deploy.sh` - -If you selected Python, deploy this service: - -`cd $GRABDISH_HOME/inventory-python; ./deploy.sh` - -If you selected Node.js, deploy this service: - -`cd $GRABDISH_HOME/inventory-nodejs; ./deploy.sh` - -If you selected .NET, deploy this service: - -`cd $GRABDISH_HOME/inventory-dotnet; ./deploy.sh` - -If you selected Go, deploy this service: - -`cd $GRABDISH_HOME/inventory-go; ./deploy.sh` -If you selected Spring Boot, deploy this service: - -`cd $GRABDISH_HOME/inventory-springboot; ./deploy.sh` -If you selected Java Helidon SE, deploy this service: - -`cd $GRABDISH_HOME/inventory-helidon-se; ./deploy.sh` -
    - -
    -Task 3: Verify application functionality - -Repeat Lab 2: Step 3 to verify that the functionality of the GrabDish store remains the same while using the new implementation. You will need to use different order ID's, for example 166 and 167. -Task 4: Re-deploy the Java Helidon MP Inventory Microservice -To undeploy any other inventory services and then deploy the Inventory Helidon MP service, issue the following commands. - -`for i in inventory-plsql inventory-helidon-se inventory-python inventory-nodejs inventory-dotnet inventory-go inventory-springboot; do cd $GRABDISH_HOME/$i; ./undeploy.sh; done -cd $GRABDISH_HOME/inventory-helidon ; ./deploy.sh -cd $GRABDISH_HOME` - -
    - -
    - -
    - - Lab 4: Observability (Metrics, Tracing, and Logs) - - -
    - Task 1: Install and configure observability software as well as metrics and log exporters - - -Run the install script to install Jaeger, Prometheus, Loki, Promtail, Grafana and an SSL secured LoadBalancer for Grafana - -`cd $GRABDISH_HOME/observability;./install.sh` - -Run the /createMonitorsAndDBAndLogExporters.sh script. This will do the following… - -Create Prometheus ServiceMonitors to scrape the Frontend, Order, and Inventory microservices. - -Create Prometheus ServiceMonitors to scrape the Order PDB, and Inventory PDB metric exporter services. - -Create configmpas, deployments, and services for PDB metrics exporters. - -Create configmaps, deployments, and services for PDB log exporters. - -`cd $GRABDISH_HOME/observability;./createMonitorsAndDBAndLogExporters.sh` - -
    - -
    - -Task 2: Configure Grafana -Identify the EXTERNAL-IP address of the Grafana LoadBalancer by executing the following command: - -`services` - - -Note that it will generally take a few minutes for the LoadBalancer to provision during which time it will be in a pending state - -Open a new browser tab and enter the external IP URL : - -https:// - -Note that for convenience a self-signed certificate is used to secure this https address and so it is likely you will be prompted by the browser to allow access. - -Login using the default username admin and password prom-operator - -![img_1.png](images/img_1.png) - -View pre-configured Prometheus data source… - -![img_2.png](images/img_2.png) - -Select the Configuration gear icon on the left-hand side and select Data Sources. - -![img_3.png](images/img_3.png) - - -Click select button of Prometheus option. - -![img_4.png](images/img_4.png) - -The URL for Prometheus should be pre-populated - -![img_5.png](images/img_5.png) - - -Click Test button and verify success. - -![img_6.png](images/img_6.png) - -Click the Back button. - -Select the Data sources tab and select Jaeger - -Click Add data source. - -![img_7.png](images/img_7.png) - -Click select button of Jaeger option. - -![img_8.png](images/img_8.png) - -Enter http://jaeger-query.msdataworkshop:8086/jaeger in the URL field. - -![img_9.png](images/img_9.png) - -Click the Save and test button and verify successful connection message. - -![img_10.png](images/img_10.png) - -Click the Back button. - -![img_11.png](images/img_11.png) - -Add and configure Loki data source… - -Click Add data source. - -![img_12.png](images/img_12.png) - -Click select button of Loki option. - -![img_13.png](images/img_13.png) - -Enter http://loki-stack.loki-stack:3100 in the URL field - -![img_14.png](images/img_14.png) - -Create the two Derived Fields shown in the picture below. The values are as follows: - -Name: traceIDFromSpanReported -Regex: Span reported: (\w+) -Query: ${__value.raw} -Internal link enabled and `Jaeger` selected from the drop-down list. -(Optional) Debug log message: Span reported: dfeda5242866aceb:b5de9f0883e2910e:ac6a4b699921e090:1 - -Name: traceIDFromECID -Regex: ECID=(\w+) -Query: ${__value.raw} -Internal link enabled and `Jaeger` selected from the drop-down list -(Optional) Debug log message: ECID=dfeda5242866aceb - -![img_15.png](images/img_15.png) - -![img_16.png](images/img_16.png) - - -Click the Save & Test button and verify successful connection message. - -![img_17.png](images/img_17.png) - -Click the Back button. - -Install the GrabDish Dashboard - -Select the + icon on the left-hand side and select Import - -![img_18.png](images/img_18.png) - -Copy the contents of the GrabDish Dashboard JSON found here - -![img_19.png](images/img_19.png) - -Paste the contents in the Import via panel json text field and click the Load button - -![img_20.png](images/img_20.png) - -Confirm upload and click Import button. - -![img_21.png](images/img_21.png) - -
    - -
    - - Task 3: Open and study the main GrabDish Grafana Dashboard screen and metrics - -Select the four squares icon on the left-hand side and select 'Dashboards' - -![img_22.png](images/img_22.png) - -In the Dashboards panel select GrabDish Dashboard - -![img_23.png](images/img_23.png) - -Notice the collapsible panels for each microservices and their content which includes - -![img_24.png](images/img_24.png) - -Metrics about the kubernetes microservice runtime (CPU load, etc.) - -Metrics about the kubernetes microservice specific to that microservice (PlaceOrder Count, etc.) - -Metrics about the PDB used by the microservice (open sessions, etc.) - -Metrics about the PDB specific to that microservice (inventory count) - -![img_25.png](images/img_25.png) - -![img_26.png](images/img_26.png) - -![img_27.png](images/img_27.png) - - - -By default the status will show a value of 1 for UP status. - -![img_28.png](images/img_28.png) - -This can be corrected by selecting the Edit item in the/a Status panel dropdown - -![img_29.png](images/img_29.png) - -Add a value mapping where value of 1 results in text of UP) under the Field tab as shown here: - -![img_30.png](images/img_30.png) - -Click the Apply button in the upper right to apply changes. - -If not already done, place an order using the application or run the scaling test in previous labs in order to see the metric activity in the dashboard. - -Select the 'Explore' option from the drop-down menu of any panel to show that metric and time-span on the Explore screen - -![img_31.png](images/img_31.png) - -
    - -
    -Task 4: Use Grafana to drill down on metrics, tracing, and logs correlation and logs to trace feature - -Click the Split button on the Explore screen. - -![img_32.png](images/img_32.png) - -Click the Loki option from the drop-down list on the right-hand panel. - -![img_33.png](images/img_33.png) - -Click the chain icon on either panel. This will result in the Prometheus metrics on the left and Loki logs on the right are of the same time-span. - -![img_34.png](images/img_34.png) - -Click the Log browser drop-down list on the right-hand panel and select the app label under "1. Select labels to search in" - -![img_35.png](images/img_35.png) - -Select the order (microservice) and db-log-exporter-orderpdb values under "2. Find values for selected label" and click Show logs button. - -![img_36.png](images/img_36.png) - -![img_37.png](images/img_37.png) - - -Select one of the green info log entries to expand it. Notice the Jaeger button next to the trace id. - -![img_38.png](images/img_38.png) - -Click the Jaeger to view the corresponding trace information and drill down into detail. - -![img_39.png](images/img_39.png) - - - -
    - -
    - -
    - - Lab 5: Teardown - - -**Introduction** -In this lab, we will tear down the resources created in your tenancy and the directory in the Oracle cloud shell. - -Click on Stack Details (Under Resource Manager) - -![img_89.png](images/img_89.png) - -Click the Destroy (Red Color) Button - -![img_90.png](images/img_90.png) - -Chick Destroy Again - -![img_91.png](images/img_91.png) - - -
    diff --git a/infra/db/atp/apply.sh b/infra/db/atp/apply.sh deleted file mode 100755 index 5cf5c6b77..000000000 --- a/infra/db/atp/apply.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -e - - -if ! provisioning-helper-pre-apply; then - exit 1 -fi - - -if ! test -f $MY_STATE/state_provisioning_done; then - if [[ "$BYO_DB_OCID" =~ ^ocid1\.autonomousdatabase ]]; then - # ATP DB has been provisioned already - DB_OCID=$BYO_DB_OCID - else - # Execute terraform - cp -rf $MY_CODE/terraform $MY_STATE - cd $MY_STATE/terraform - export TF_VAR_ociCompartmentOcid="$COMPARTMENT_OCID" - export TF_VAR_ociRegionIdentifier="$OCI_REGION" - export TF_VAR_dbName="$DB_NAME" - export TF_VAR_displayName="$DISPLAY_NAME" - case "$VERSION" in - 21c) - export TF_VAR_dbVersion='21c' - export TF_VAR_dbIsFreeTier='true' - ;; - 19c) - export TF_VAR_dbVersion='19c' - export TF_VAR_dbIsFreeTier='false' - ;; - *) - echo "Error: Invalid DB version $VERSION" - exit 1 - ;; - esac - - - if ! terraform init; then - echo 'ERROR: terraform init failed!' - exit 1 - fi - - if ! terraform apply -auto-approve; then - echo 'ERROR: terraform apply failed!' - exit 1 - fi - - # Get the DB_OCID - DB_OCID=`terraform output -raw db_ocid` - fi - echo "DB_OCID='$DB_OCID'" >>$STATE_FILE - touch $MY_STATE/state_provisioning_done -fi - -# Set DB Password -if ! test -f $MY_STATE/state_password_set; then - DB_PASSWORD=$(get_secret $DB_PASSWORD_SECRET) - umask 177 - echo '{"adminPassword": '`echo -n "$DB_PASSWORD" | jq -aRs .`'}' > temp_params - umask 22 - oci db autonomous-database update --autonomous-database-id "$DB_OCID" --from-json "file://temp_params" >/dev/null - rm temp_params - echo "PASSWORD_SET='DONE'" >>$STATE_FILE - touch $MY_STATE/state_password_set -fi - - -# Download the wallet -if ! test -f $MY_STATE/state_wallet_downloaded; then - TNS_ADMIN=$MY_STATE/tns_admin - mkdir -p $TNS_ADMIN - rm -rf $TNS_ADMIN/* - cd $TNS_ADMIN - echo "DB OCID is $DB_OCID" - oci db autonomous-database generate-wallet --autonomous-database-id "$DB_OCID" --file 'wallet.zip' --password 'Welcome1' - unzip wallet.zip - - cat - >sqlnet.ora <>$STATE_FILE - echo "TNS_ADMIN='$TNS_ADMIN'" >>$STATE_FILE - touch $MY_STATE/state_wallet_downloaded -fi - - -cat >$OUTPUT_FILE <>$STATE_FILE - touch $MY_STATE/state_rsa_key -fi - - -if ! test -f $MY_STATE/state_provisioning_done; then - if [[ ]]"$BYO_DB_OCID" =~ ^ocid1\.autonomousdatabase ]]; then - # ATP DB has been provisioned already - DB_OCID=$BYO_DB_OCID - else - # Execute terraform - cp -rf $MY_CODE/terraform $MY_STATE - cd $MY_STATE/terraform - export TF_VAR_ociTenancyOcid="$TENANCY_OCID" - export TF_VAR_ociCompartmentOcid="$COMPARTMENT_OCID" - export TF_VAR_ociRegionIdentifier="$REGION" - export TF_VAR_dbName="$DB_NAME" - export TF_VAR_displayName="$DISPLAY_NAME" - export TF_VAR_publicRsaKey="$(<$DB_PUBLIC_RSA_KEY_FILE)" - export TF_VAR_vcnOcid="$VCN_OCID" - - if ! terraform init; then - echo 'ERROR: terraform init failed!' - exit 1 - fi - - if ! terraform apply -auto-approve; then - echo 'ERROR: terraform apply failed!' - exit 1 - fi - - # Get the DB_OCID - DB_OCID=`terraform output -raw db_ocid` - fi - echo "DB_OCID='$DB_OCID'" >>$STATE_FILE - touch $MY_STATE/state_provisioning_done -fi - -# Set DB Password -if ! test -f $MY_STATE/state_password_set; then - DB_PASSWORD=$(get_secret $DB_PASSWORD_SECRET) - umask 177 - echo '{"adminPassword": "'"$DB_PASSWORD"'"}' > temp_params - umask 22 - oci db autonomous-database update --autonomous-database-id "$DB_OCID" --from-json "file://temp_params" >/dev/null - rm temp_params - echo "PASSWORD_SET='DONE'" >>$STATE_FILE - touch $MY_STATE/state_password_set -fi - - -# Download the wallet -if ! test -f $MY_STATE/state_wallet_downloaded; then - TNS_ADMIN=$MY_STATE/tns_admin - mkdir -p $TNS_ADMIN - rm -rf $TNS_ADMIN/* - cd $TNS_ADMIN - echo "DB OCID is $DB_OCID" - oci db autonomous-database generate-wallet --autonomous-database-id "$DB_OCID" --file 'wallet.zip' --password 'Welcome1' --generate-type 'ALL' - unzip wallet.zip - - cat - >sqlnet.ora <>$STATE_FILE - echo "TNS_ADMIN='$TNS_ADMIN'" >>$STATE_FILE - touch $MY_STATE/state_wallet_downloaded -fi - - -cat >$OUTPUT_FILE <>$STATE_FILE - - -touch $OUTPUT_FILE \ No newline at end of file diff --git a/infra/image-repo/ocr/destroy.sh b/infra/image-repo/ocr/destroy.sh deleted file mode 100755 index d74fee71c..000000000 --- a/infra/image-repo/ocr/destroy.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -e - -if ! provisioning-helper-pre-destroy; then - exit 1 -fi - - -# Delete Repos -echo "Deleting Repositories" -for r in $REPO_OCIDS; do - oci artifacts container repository delete --repository-id "$r" --force || true -done - - -rm -f $STATE_FILE \ No newline at end of file diff --git a/infra/image-repo/ocr/requirements.env b/infra/image-repo/ocr/requirements.env deleted file mode 100644 index 407d8ea72..000000000 --- a/infra/image-repo/ocr/requirements.env +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -REQ_UTILS="touch oci" -REQ_INPUT_PARAMS="COMPARTMENT_OCID BUILDS RUN_NAME" -REQ_OUTPUT_PARAMS="" \ No newline at end of file diff --git a/infra/images/img.png b/infra/images/img.png deleted file mode 100644 index 0b58cb177..000000000 Binary files a/infra/images/img.png and /dev/null differ diff --git a/infra/images/img_1.png b/infra/images/img_1.png deleted file mode 100644 index ec5130cc8..000000000 Binary files a/infra/images/img_1.png and /dev/null differ diff --git a/infra/images/img_10.png b/infra/images/img_10.png deleted file mode 100644 index fbfa31e85..000000000 Binary files a/infra/images/img_10.png and /dev/null differ diff --git a/infra/images/img_11.png b/infra/images/img_11.png deleted file mode 100644 index fbfa31e85..000000000 Binary files a/infra/images/img_11.png and /dev/null differ diff --git a/infra/images/img_12.png b/infra/images/img_12.png deleted file mode 100644 index 1a11c1de9..000000000 Binary files a/infra/images/img_12.png and /dev/null differ diff --git a/infra/images/img_13.png b/infra/images/img_13.png deleted file mode 100644 index f091be7b5..000000000 Binary files a/infra/images/img_13.png and /dev/null differ diff --git a/infra/images/img_14.png b/infra/images/img_14.png deleted file mode 100644 index 63a14b437..000000000 Binary files a/infra/images/img_14.png and /dev/null differ diff --git a/infra/images/img_15.png b/infra/images/img_15.png deleted file mode 100644 index 37864c3f7..000000000 Binary files a/infra/images/img_15.png and /dev/null differ diff --git a/infra/images/img_16.png b/infra/images/img_16.png deleted file mode 100644 index 625bd22bb..000000000 Binary files a/infra/images/img_16.png and /dev/null differ diff --git a/infra/images/img_17.png b/infra/images/img_17.png deleted file mode 100644 index aa96e57f3..000000000 Binary files a/infra/images/img_17.png and /dev/null differ diff --git a/infra/images/img_18.png b/infra/images/img_18.png deleted file mode 100644 index 8495c6f30..000000000 Binary files a/infra/images/img_18.png and /dev/null differ diff --git a/infra/images/img_19.png b/infra/images/img_19.png deleted file mode 100644 index af86e9afc..000000000 Binary files a/infra/images/img_19.png and /dev/null differ diff --git a/infra/images/img_2.png b/infra/images/img_2.png deleted file mode 100644 index ce166bbd2..000000000 Binary files a/infra/images/img_2.png and /dev/null differ diff --git a/infra/images/img_20.png b/infra/images/img_20.png deleted file mode 100644 index af86e9afc..000000000 Binary files a/infra/images/img_20.png and /dev/null differ diff --git a/infra/images/img_21.png b/infra/images/img_21.png deleted file mode 100644 index d6343244a..000000000 Binary files a/infra/images/img_21.png and /dev/null differ diff --git a/infra/images/img_22.png b/infra/images/img_22.png deleted file mode 100644 index 5d82b5868..000000000 Binary files a/infra/images/img_22.png and /dev/null differ diff --git a/infra/images/img_23.png b/infra/images/img_23.png deleted file mode 100644 index 85e6df625..000000000 Binary files a/infra/images/img_23.png and /dev/null differ diff --git a/infra/images/img_24.png b/infra/images/img_24.png deleted file mode 100644 index 895e40106..000000000 Binary files a/infra/images/img_24.png and /dev/null differ diff --git a/infra/images/img_25.png b/infra/images/img_25.png deleted file mode 100644 index 895e40106..000000000 Binary files a/infra/images/img_25.png and /dev/null differ diff --git a/infra/images/img_26.png b/infra/images/img_26.png deleted file mode 100644 index 735925de0..000000000 Binary files a/infra/images/img_26.png and /dev/null differ diff --git a/infra/images/img_27.png b/infra/images/img_27.png deleted file mode 100644 index ced6438ba..000000000 Binary files a/infra/images/img_27.png and /dev/null differ diff --git a/infra/images/img_28.png b/infra/images/img_28.png deleted file mode 100644 index 17b885858..000000000 Binary files a/infra/images/img_28.png and /dev/null differ diff --git a/infra/images/img_29.png b/infra/images/img_29.png deleted file mode 100644 index 17b885858..000000000 Binary files a/infra/images/img_29.png and /dev/null differ diff --git a/infra/images/img_3.png b/infra/images/img_3.png deleted file mode 100644 index ce166bbd2..000000000 Binary files a/infra/images/img_3.png and /dev/null differ diff --git a/infra/images/img_30.png b/infra/images/img_30.png deleted file mode 100644 index 0c7477d5f..000000000 Binary files a/infra/images/img_30.png and /dev/null differ diff --git a/infra/images/img_31.png b/infra/images/img_31.png deleted file mode 100644 index e5d09597f..000000000 Binary files a/infra/images/img_31.png and /dev/null differ diff --git a/infra/images/img_32.png b/infra/images/img_32.png deleted file mode 100644 index 8b535e653..000000000 Binary files a/infra/images/img_32.png and /dev/null differ diff --git a/infra/images/img_33.png b/infra/images/img_33.png deleted file mode 100644 index e3fd911df..000000000 Binary files a/infra/images/img_33.png and /dev/null differ diff --git a/infra/images/img_34.png b/infra/images/img_34.png deleted file mode 100644 index 00c0808e3..000000000 Binary files a/infra/images/img_34.png and /dev/null differ diff --git a/infra/images/img_35.png b/infra/images/img_35.png deleted file mode 100644 index d7506d9f6..000000000 Binary files a/infra/images/img_35.png and /dev/null differ diff --git a/infra/images/img_36.png b/infra/images/img_36.png deleted file mode 100644 index df48dd15b..000000000 Binary files a/infra/images/img_36.png and /dev/null differ diff --git a/infra/images/img_37.png b/infra/images/img_37.png deleted file mode 100644 index 15e3b4299..000000000 Binary files a/infra/images/img_37.png and /dev/null differ diff --git a/infra/images/img_38.png b/infra/images/img_38.png deleted file mode 100644 index d0cd7f36e..000000000 Binary files a/infra/images/img_38.png and /dev/null differ diff --git a/infra/images/img_39.png b/infra/images/img_39.png deleted file mode 100644 index ea54cff25..000000000 Binary files a/infra/images/img_39.png and /dev/null differ diff --git a/infra/images/img_4.png b/infra/images/img_4.png deleted file mode 100644 index 13892ff5b..000000000 Binary files a/infra/images/img_4.png and /dev/null differ diff --git a/infra/images/img_41.png b/infra/images/img_41.png deleted file mode 100644 index e88ac83e6..000000000 Binary files a/infra/images/img_41.png and /dev/null differ diff --git a/infra/images/img_42.png b/infra/images/img_42.png deleted file mode 100644 index 15182e9e3..000000000 Binary files a/infra/images/img_42.png and /dev/null differ diff --git a/infra/images/img_43.png b/infra/images/img_43.png deleted file mode 100644 index 86a94e4d3..000000000 Binary files a/infra/images/img_43.png and /dev/null differ diff --git a/infra/images/img_44.png b/infra/images/img_44.png deleted file mode 100644 index 862ba154c..000000000 Binary files a/infra/images/img_44.png and /dev/null differ diff --git a/infra/images/img_45.png b/infra/images/img_45.png deleted file mode 100644 index 2a30ff91c..000000000 Binary files a/infra/images/img_45.png and /dev/null differ diff --git a/infra/images/img_46.png b/infra/images/img_46.png deleted file mode 100644 index 4ce25e0ca..000000000 Binary files a/infra/images/img_46.png and /dev/null differ diff --git a/infra/images/img_47.png b/infra/images/img_47.png deleted file mode 100644 index aa4d7d836..000000000 Binary files a/infra/images/img_47.png and /dev/null differ diff --git a/infra/images/img_48.png b/infra/images/img_48.png deleted file mode 100644 index 8dad3f129..000000000 Binary files a/infra/images/img_48.png and /dev/null differ diff --git a/infra/images/img_49.png b/infra/images/img_49.png deleted file mode 100644 index 151d75f13..000000000 Binary files a/infra/images/img_49.png and /dev/null differ diff --git a/infra/images/img_5.png b/infra/images/img_5.png deleted file mode 100644 index 79bcbbc10..000000000 Binary files a/infra/images/img_5.png and /dev/null differ diff --git a/infra/images/img_50.png b/infra/images/img_50.png deleted file mode 100644 index 7159647e2..000000000 Binary files a/infra/images/img_50.png and /dev/null differ diff --git a/infra/images/img_51.png b/infra/images/img_51.png deleted file mode 100644 index 95c8d45dd..000000000 Binary files a/infra/images/img_51.png and /dev/null differ diff --git a/infra/images/img_52.png b/infra/images/img_52.png deleted file mode 100644 index c2cf4a486..000000000 Binary files a/infra/images/img_52.png and /dev/null differ diff --git a/infra/images/img_53.png b/infra/images/img_53.png deleted file mode 100644 index 2d3b235fb..000000000 Binary files a/infra/images/img_53.png and /dev/null differ diff --git a/infra/images/img_54.png b/infra/images/img_54.png deleted file mode 100644 index 8dad3f129..000000000 Binary files a/infra/images/img_54.png and /dev/null differ diff --git a/infra/images/img_55.png b/infra/images/img_55.png deleted file mode 100644 index 3363c88f9..000000000 Binary files a/infra/images/img_55.png and /dev/null differ diff --git a/infra/images/img_56.png b/infra/images/img_56.png deleted file mode 100644 index 0c10341e3..000000000 Binary files a/infra/images/img_56.png and /dev/null differ diff --git a/infra/images/img_57.png b/infra/images/img_57.png deleted file mode 100644 index 9e4c52111..000000000 Binary files a/infra/images/img_57.png and /dev/null differ diff --git a/infra/images/img_58.png b/infra/images/img_58.png deleted file mode 100644 index 524f67db4..000000000 Binary files a/infra/images/img_58.png and /dev/null differ diff --git a/infra/images/img_59.png b/infra/images/img_59.png deleted file mode 100644 index 4694ffb26..000000000 Binary files a/infra/images/img_59.png and /dev/null differ diff --git a/infra/images/img_6.png b/infra/images/img_6.png deleted file mode 100644 index ca9552bc0..000000000 Binary files a/infra/images/img_6.png and /dev/null differ diff --git a/infra/images/img_60.png b/infra/images/img_60.png deleted file mode 100644 index 090d31ba2..000000000 Binary files a/infra/images/img_60.png and /dev/null differ diff --git a/infra/images/img_61.png b/infra/images/img_61.png deleted file mode 100644 index cfcaf4138..000000000 Binary files a/infra/images/img_61.png and /dev/null differ diff --git a/infra/images/img_62.png b/infra/images/img_62.png deleted file mode 100644 index 49f30b09b..000000000 Binary files a/infra/images/img_62.png and /dev/null differ diff --git a/infra/images/img_63.png b/infra/images/img_63.png deleted file mode 100644 index 38d980f1f..000000000 Binary files a/infra/images/img_63.png and /dev/null differ diff --git a/infra/images/img_64.png b/infra/images/img_64.png deleted file mode 100644 index 0b58cb177..000000000 Binary files a/infra/images/img_64.png and /dev/null differ diff --git a/infra/images/img_65.png b/infra/images/img_65.png deleted file mode 100644 index 6c4c3165d..000000000 Binary files a/infra/images/img_65.png and /dev/null differ diff --git a/infra/images/img_66.png b/infra/images/img_66.png deleted file mode 100644 index 280f35293..000000000 Binary files a/infra/images/img_66.png and /dev/null differ diff --git a/infra/images/img_67.png b/infra/images/img_67.png deleted file mode 100644 index b212ce63f..000000000 Binary files a/infra/images/img_67.png and /dev/null differ diff --git a/infra/images/img_68.png b/infra/images/img_68.png deleted file mode 100644 index 80a4e92a4..000000000 Binary files a/infra/images/img_68.png and /dev/null differ diff --git a/infra/images/img_69.png b/infra/images/img_69.png deleted file mode 100644 index 09266eb39..000000000 Binary files a/infra/images/img_69.png and /dev/null differ diff --git a/infra/images/img_7.png b/infra/images/img_7.png deleted file mode 100644 index 1a11c1de9..000000000 Binary files a/infra/images/img_7.png and /dev/null differ diff --git a/infra/images/img_70.png b/infra/images/img_70.png deleted file mode 100644 index 91c59b9eb..000000000 Binary files a/infra/images/img_70.png and /dev/null differ diff --git a/infra/images/img_71.png b/infra/images/img_71.png deleted file mode 100644 index 6760eb81e..000000000 Binary files a/infra/images/img_71.png and /dev/null differ diff --git a/infra/images/img_72.png b/infra/images/img_72.png deleted file mode 100644 index 65ec5a9c3..000000000 Binary files a/infra/images/img_72.png and /dev/null differ diff --git a/infra/images/img_73.png b/infra/images/img_73.png deleted file mode 100644 index 33f188731..000000000 Binary files a/infra/images/img_73.png and /dev/null differ diff --git a/infra/images/img_74.png b/infra/images/img_74.png deleted file mode 100644 index dc7c9ac97..000000000 Binary files a/infra/images/img_74.png and /dev/null differ diff --git a/infra/images/img_75.png b/infra/images/img_75.png deleted file mode 100644 index 228ef5f55..000000000 Binary files a/infra/images/img_75.png and /dev/null differ diff --git a/infra/images/img_76.png b/infra/images/img_76.png deleted file mode 100644 index 56bfaf999..000000000 Binary files a/infra/images/img_76.png and /dev/null differ diff --git a/infra/images/img_77.png b/infra/images/img_77.png deleted file mode 100644 index 4a153b87e..000000000 Binary files a/infra/images/img_77.png and /dev/null differ diff --git a/infra/images/img_78.png b/infra/images/img_78.png deleted file mode 100644 index bebdd7899..000000000 Binary files a/infra/images/img_78.png and /dev/null differ diff --git a/infra/images/img_79.png b/infra/images/img_79.png deleted file mode 100644 index 7e786b03b..000000000 Binary files a/infra/images/img_79.png and /dev/null differ diff --git a/infra/images/img_8.png b/infra/images/img_8.png deleted file mode 100644 index 117bc1d75..000000000 Binary files a/infra/images/img_8.png and /dev/null differ diff --git a/infra/images/img_80.png b/infra/images/img_80.png deleted file mode 100644 index 7e786b03b..000000000 Binary files a/infra/images/img_80.png and /dev/null differ diff --git a/infra/images/img_81.png b/infra/images/img_81.png deleted file mode 100644 index e2287fc49..000000000 Binary files a/infra/images/img_81.png and /dev/null differ diff --git a/infra/images/img_82.png b/infra/images/img_82.png deleted file mode 100644 index 56206d644..000000000 Binary files a/infra/images/img_82.png and /dev/null differ diff --git a/infra/images/img_83.png b/infra/images/img_83.png deleted file mode 100644 index b6c829afa..000000000 Binary files a/infra/images/img_83.png and /dev/null differ diff --git a/infra/images/img_84.png b/infra/images/img_84.png deleted file mode 100644 index 3a8b56a15..000000000 Binary files a/infra/images/img_84.png and /dev/null differ diff --git a/infra/images/img_85.png b/infra/images/img_85.png deleted file mode 100644 index 7bf72927c..000000000 Binary files a/infra/images/img_85.png and /dev/null differ diff --git a/infra/images/img_86.png b/infra/images/img_86.png deleted file mode 100644 index a2ae20328..000000000 Binary files a/infra/images/img_86.png and /dev/null differ diff --git a/infra/images/img_87.png b/infra/images/img_87.png deleted file mode 100644 index 689a74827..000000000 Binary files a/infra/images/img_87.png and /dev/null differ diff --git a/infra/images/img_88.png b/infra/images/img_88.png deleted file mode 100644 index 2e91e0cab..000000000 Binary files a/infra/images/img_88.png and /dev/null differ diff --git a/infra/images/img_89.png b/infra/images/img_89.png deleted file mode 100644 index 3fced7cb0..000000000 Binary files a/infra/images/img_89.png and /dev/null differ diff --git a/infra/images/img_9.png b/infra/images/img_9.png deleted file mode 100644 index 1045ec8ba..000000000 Binary files a/infra/images/img_9.png and /dev/null differ diff --git a/infra/images/img_90.png b/infra/images/img_90.png deleted file mode 100644 index 502572c98..000000000 Binary files a/infra/images/img_90.png and /dev/null differ diff --git a/infra/images/img_91.png b/infra/images/img_91.png deleted file mode 100644 index d7ef58ae4..000000000 Binary files a/infra/images/img_91.png and /dev/null differ diff --git a/infra/images/img_92.png b/infra/images/img_92.png deleted file mode 100644 index 1945ed174..000000000 Binary files a/infra/images/img_92.png and /dev/null differ diff --git a/infra/java/GraalVM/apply.sh b/infra/java/GraalVM/apply.sh deleted file mode 100755 index 6c0c39c7a..000000000 --- a/infra/java/GraalVM/apply.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -e - - -if ! provisioning-helper-pre-apply; then - exit 1 -fi - - -# Install Graal -if ! test -d ~/graalvm-ce-java11-20.2.0; then - cd $MY_STATE - OS_NAME=`uname` - curl -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.1.0/graalvm-ce-java11-${OS_NAME}-amd64-20.1.0.tar.gz | tar xz - mv graalvm-ce-java11-20.2.0 ~/ -fi - -# Java Home -if test -d ~/graalvm-ce-java11-20.2.0/Contents/Home/bin; then - # We are on Mac doing local dev - ~/graalvm-ce-java11-20.2.0/Contents/Home/bin/gu install native-image - JAVA_HOME=~/graalvm-ce-java11-20.2.0/Contents/Home; -else - # Assume linux - ~/graalvm-ce-java11-20.2.0/bin/gu install native-image - JAVA_HOME=~/graalvm-ce-java11-20.2.0 -fi - - -cat >$OUTPUT_FILE <$OUTPUT_FILE \ No newline at end of file diff --git a/infra/k8s/oke/destroy.sh b/infra/k8s/oke/destroy.sh deleted file mode 100755 index ba45bed86..000000000 --- a/infra/k8s/oke/destroy.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -e - - -if ! provisioning-helper-pre-destroy; then - exit 1 -fi - - -cd $MY_STATE/terraform -export TF_VAR_ociCompartmentOcid="$COMPARTMENT_OCID" -export TF_VAR_ociRegionIdentifier="$OCI_REGION" -export TF_VAR_ociTenancyOcid="$TENANCY_OCID" -export TF_VAR_vcnOcid="$VCN_OCID" - -if ! terraform init; then - echo 'ERROR: terraform init failed!' - exit 1 -fi - -if ! terraform destroy -auto-approve; then - echo 'ERROR: terraform destroy failed!' - exit 1 -fi - - -rm -f $STATE_FILE \ No newline at end of file diff --git a/infra/k8s/oke/requirements.env b/infra/k8s/oke/requirements.env deleted file mode 100644 index 0b498de85..000000000 --- a/infra/k8s/oke/requirements.env +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -REQ_UTILS="cd cp cat sleep terraform oci kubectl" -REQ_INPUT_PARAMS="COMPARTMENT_OCID TENANCY_OCID OCI_REGION VCN_OCID" -REQ_OUTPUT_PARAMS="" \ No newline at end of file diff --git a/infra/k8s/oke/terraform/availability_domain.tf b/infra/k8s/oke/terraform/availability_domain.tf deleted file mode 100644 index a34b28d48..000000000 --- a/infra/k8s/oke/terraform/availability_domain.tf +++ /dev/null @@ -1,7 +0,0 @@ -//Copyright (c) 2021 Oracle and/or its affiliates. -//Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -data "oci_identity_availability_domain" "ad1" { - compartment_id = var.ociTenancyOcid - ad_number = 1 -} \ No newline at end of file diff --git a/infra/k8s/oke/terraform/containerengine.tf b/infra/k8s/oke/terraform/containerengine.tf deleted file mode 100644 index 62d5ddef2..000000000 --- a/infra/k8s/oke/terraform/containerengine.tf +++ /dev/null @@ -1,67 +0,0 @@ -//Copyright (c) 2021 Oracle and/or its affiliates. -//Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -resource "oci_containerengine_cluster" "oke" { - #Required - compartment_id = var.ociCompartmentOcid - endpoint_config { - is_public_ip_enabled = "true" - nsg_ids = [ - ] - subnet_id = oci_core_subnet.endpoint.id - } - kubernetes_version = var.kubernetes_version - name = "grabdish" - vcn_id = data.oci_core_vcn.vcn.id - #Optional - options { - service_lb_subnet_ids = [oci_core_subnet.svclb.id] - #Optional - add_ons { - #Optional - is_kubernetes_dashboard_enabled = "false" - is_tiller_enabled = "false" - } - admission_controller_options { - #Optional - is_pod_security_policy_enabled = "false" - } - kubernetes_network_config { - #Optional - pods_cidr = "10.244.0.0/16" - services_cidr = "10.96.0.0/16" - } - } -} - -resource "oci_containerengine_node_pool" "okell_node_pool" { - cluster_id = oci_containerengine_cluster.oke.id - compartment_id = var.ociCompartmentOcid - kubernetes_version = var.kubernetes_version - name = "Pool" - node_shape = "VM.Standard.E2.1" - node_config_details { - placement_configs { - availability_domain = data.oci_identity_availability_domain.ad1.name - subnet_id = oci_core_subnet.nodepool.id - } - size = "3" - } - node_source_details { - image_id = local.oracle_linux_images.0 # Latest - source_type = "IMAGE" - } -} - -data "oci_containerengine_node_pool_option" "okell_node_pool_option" { - node_pool_option_id = "all" -} - -locals { - all_sources = data.oci_containerengine_node_pool_option.okell_node_pool_option.sources - oracle_linux_images = [for source in local.all_sources : source.image_id if length(regexall("Oracle-Linux-[0-9]*.[0-9]*-20[0-9]*", source.source_name)) > 0] -} - -output "oke_ocid" { - value = oci_containerengine_cluster.oke.id -} diff --git a/infra/k8s/oke/terraform/core.tf b/infra/k8s/oke/terraform/core.tf deleted file mode 100644 index 469d21341..000000000 --- a/infra/k8s/oke/terraform/core.tf +++ /dev/null @@ -1,284 +0,0 @@ -//Copyright (c) 2021 Oracle and/or its affiliates. -//Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -locals { - endpoint_cidr_block = "10.0.0.0/28" - nodepool_cidr_block = "10.0.10.0/24" - svclb_cidr_block = "10.0.20.0/24" -} - -data "oci_core_vcn" "vcn" { - #Required - vcn_id = var.vcnOcid -} - -data "oci_core_nat_gateways" "ngws" { - compartment_id = var.ociCompartmentOcid - vcn_id = data.oci_core_vcn.vcn.id -} - -data "oci_core_service_gateways" "sgs" { - compartment_id = var.ociCompartmentOcid - vcn_id = data.oci_core_vcn.vcn.id -} - -resource "oci_core_route_table" "private" { - compartment_id = var.ociCompartmentOcid - display_name = "private" - freeform_tags = { - } - route_rules { - description = "traffic to the internet" - destination = "0.0.0.0/0" - destination_type = "CIDR_BLOCK" - network_entity_id = data.oci_core_nat_gateways.ngws.nat_gateways.0.id - } - route_rules { - description = "traffic to OCI services" - destination = data.oci_core_services.services.services.0.cidr_block - destination_type = "SERVICE_CIDR_BLOCK" - network_entity_id = data.oci_core_service_gateways.sgs.service_gateways.0.id - } - vcn_id = data.oci_core_vcn.vcn.id -} - -resource "oci_core_subnet" "endpoint" { - cidr_block = local.endpoint_cidr_block - compartment_id = var.ociCompartmentOcid - vcn_id = data.oci_core_vcn.vcn.id - security_list_ids = [oci_core_security_list.endpoint.id] - display_name = "Endpoint" - prohibit_public_ip_on_vnic = "false" - route_table_id = data.oci_core_vcn.vcn.default_route_table_id - dns_label = "endpoint" -} - -resource "oci_core_subnet" "nodepool" { - cidr_block = local.nodepool_cidr_block - compartment_id = var.ociCompartmentOcid - vcn_id = data.oci_core_vcn.vcn.id - security_list_ids = [oci_core_security_list.nodepool.id] - display_name = "Node Pool" - prohibit_public_ip_on_vnic = "true" - route_table_id = oci_core_route_table.private.id - dns_label = "nodepool" -} - -resource "oci_core_subnet" "svclb" { - cidr_block = local.svclb_cidr_block - compartment_id = var.ociCompartmentOcid - vcn_id = data.oci_core_vcn.vcn.id - security_list_ids = [data.oci_core_vcn.vcn.default_security_list_id] - display_name = "Service Load Balancer" - route_table_id = data.oci_core_vcn.vcn.default_route_table_id - dhcp_options_id = data.oci_core_vcn.vcn.default_dhcp_options_id - prohibit_public_ip_on_vnic = "false" - dns_label = "svclb" -} - -resource "oci_core_security_list" "nodepool" { - compartment_id = var.ociCompartmentOcid - display_name = "Node Pool" - egress_security_rules { - description = "Allow pods on one worker node to communicate with pods on other worker nodes" - destination = local.nodepool_cidr_block - destination_type = "CIDR_BLOCK" - protocol = "all" - stateless = "false" - } - egress_security_rules { - description = "Access to Kubernetes API Endpoint" - destination = local.endpoint_cidr_block - destination_type = "CIDR_BLOCK" - protocol = "6" - stateless = "false" - tcp_options { - max = "6443" - min = "6443" - } - } - egress_security_rules { - description = "Kubernetes worker to control plane communication" - destination = local.endpoint_cidr_block - destination_type = "CIDR_BLOCK" - protocol = "6" - stateless = "false" - tcp_options { - max = "12250" - min = "12250" - } - } - egress_security_rules { - description = "Path discovery" - destination = local.endpoint_cidr_block - destination_type = "CIDR_BLOCK" - icmp_options { - code = "4" - type = "3" - } - protocol = "1" - stateless = "false" - } - egress_security_rules { - description = "Allow nodes to communicate with OKE to ensure correct start-up and continued functioning (0)" - destination = data.oci_core_services.services.services.0.cidr_block - destination_type = "SERVICE_CIDR_BLOCK" - protocol = "6" - stateless = "false" - tcp_options { - max = "443" - min = "443" - } - } - egress_security_rules { - description = "ICMP Access from Kubernetes Control Plane" - destination = "0.0.0.0/0" - destination_type = "CIDR_BLOCK" - icmp_options { - code = "4" - type = "3" - } - protocol = "1" - stateless = "false" - } - egress_security_rules { - description = "Worker Nodes access to Internet" - destination = "0.0.0.0/0" - destination_type = "CIDR_BLOCK" - protocol = "all" - stateless = "false" - } - freeform_tags = { - } - ingress_security_rules { - description = "Allow pods on one worker node to communicate with pods on other worker nodes" - protocol = "all" - source = local.nodepool_cidr_block - source_type = "CIDR_BLOCK" - stateless = "false" - } - ingress_security_rules { - description = "Path discovery" - icmp_options { - code = "4" - type = "3" - } - protocol = "1" - source = local.endpoint_cidr_block - source_type = "CIDR_BLOCK" - stateless = "false" - } - ingress_security_rules { - description = "TCP access from Kubernetes Control Plane" - protocol = "6" - source = local.endpoint_cidr_block - source_type = "CIDR_BLOCK" - stateless = "false" - } - ingress_security_rules { - description = "Inbound SSH traffic to worker nodes" - protocol = "6" - source = "0.0.0.0/0" - source_type = "CIDR_BLOCK" - stateless = "false" - tcp_options { - max = "22" - min = "22" - } - } - vcn_id = data.oci_core_vcn.vcn.id -} - -resource "oci_core_security_list" "endpoint" { - compartment_id = var.ociCompartmentOcid - display_name = "Endpoint" - egress_security_rules { - description = "Allow Kubernetes Control Plane to communicate with OKE" - destination = data.oci_core_services.services.services.0.cidr_block - destination_type = "SERVICE_CIDR_BLOCK" - protocol = "6" - stateless = "false" - tcp_options { - max = "443" - min = "443" - } - } - egress_security_rules { - description = "All traffic to worker nodes" - destination = local.nodepool_cidr_block - destination_type = "CIDR_BLOCK" - protocol = "6" - stateless = "false" - } - egress_security_rules { - description = "Path discovery" - destination = local.nodepool_cidr_block - destination_type = "CIDR_BLOCK" - icmp_options { - code = "4" - type = "3" - } - protocol = "1" - stateless = "false" - } - freeform_tags = { - } - ingress_security_rules { - description = "External access to Kubernetes API endpoint" - protocol = "6" - source = "0.0.0.0/0" - source_type = "CIDR_BLOCK" - stateless = "false" - tcp_options { - max = "6443" - min = "6443" - } - } - ingress_security_rules { - description = "Kubernetes worker to Kubernetes API endpoint communication" - protocol = "6" - source = local.nodepool_cidr_block - source_type = "CIDR_BLOCK" - stateless = "false" - tcp_options { - max = "6443" - min = "6443" - } - } - ingress_security_rules { - description = "Kubernetes worker to control plane communication" - protocol = "6" - source = local.nodepool_cidr_block - source_type = "CIDR_BLOCK" - stateless = "false" - tcp_options { - max = "12250" - min = "12250" - } - } - ingress_security_rules { - description = "Path discovery" - icmp_options { - code = "4" - type = "3" - } - protocol = "1" - source = local.nodepool_cidr_block - source_type = "CIDR_BLOCK" - stateless = "false" - } - vcn_id = data.oci_core_vcn.vcn.id -} - -resource "oci_core_default_security_list" "svcLB" { - display_name = "Service Load Balancer" - manage_default_resource_id = data.oci_core_vcn.vcn.default_security_list_id -} - -data "oci_core_services" "services" { - filter { - name = "name" - values = ["All .* Services In Oracle Services Network"] - regex = true - } -} \ No newline at end of file diff --git a/infra/k8s/oke/terraform/main_var.tf b/infra/k8s/oke/terraform/main_var.tf deleted file mode 100644 index 2278add0e..000000000 --- a/infra/k8s/oke/terraform/main_var.tf +++ /dev/null @@ -1,13 +0,0 @@ -//Copyright (c) 2024 Oracle and/or its affiliates. -//Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -variable "ociTenancyOcid" {} -variable "ociCompartmentOcid" {} -variable "ociRegionIdentifier" {} -variable "vcnOcid" {} - -variable "kubernetes_version" { - description = "OKE Version" - type = string - default = "v1.29.1" -} diff --git a/infra/k8s/oke/terraform/provider.tf b/infra/k8s/oke/terraform/provider.tf deleted file mode 100644 index 9e9040073..000000000 --- a/infra/k8s/oke/terraform/provider.tf +++ /dev/null @@ -1,6 +0,0 @@ -//Copyright (c) 2021 Oracle and/or its affiliates. -//Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -provider "oci" { - region = var.ociRegionIdentifier -} \ No newline at end of file diff --git a/infra/multi-node-deployment.zip b/infra/multi-node-deployment.zip deleted file mode 100644 index 032fccd0e..000000000 Binary files a/infra/multi-node-deployment.zip and /dev/null differ diff --git a/infra/multi-node-deployment2.zip b/infra/multi-node-deployment2.zip deleted file mode 100644 index 490efcc0f..000000000 Binary files a/infra/multi-node-deployment2.zip and /dev/null differ diff --git a/infra/network/oci/apply.sh b/infra/network/oci/apply.sh deleted file mode 100755 index 4da271ceb..000000000 --- a/infra/network/oci/apply.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -e - - -if ! provisioning-helper-pre-apply; then - exit 1 -fi - - -# Workaround for cloud shell bug where it caches only on terraform version -mkdir -p $HOME/.terraform.d/plugin-cache -cat >~/.terraformrc <>$STATE_FILE - -cat >$OUTPUT_FILE < 'ORDERQUEUETABLE', - queue_payload_type = > 'SYS.AQ$_JMS_TEXT_MESSAGE', compatible = > '8.1'); - -EXECUTE DBMS_AQADM.CREATE_QUEUE(queue_name = > 'ORDERQUEUE', queue_table = > 'ORDERQUEUETABLE'); - -EXECUTE DBMS_AQADM.START_QUEUE(queue_name = > 'ORDERQUEUE'); - - -EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table = > 'ORDERQUEUETABLE', - queue_payload_type = > 'SYS.AQ$_JMS_TEXT_MESSAGE', compatible = > '8.1'); - - - -BEGIN - DBMS_AQADM.CREATE_QUEUE_TABLE -( - queue_table => 'ORDERUSER."ORDERQUEUETABLE"', - queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', - multiple_consumers => true, - compatible => '8.1'); - - DBMS_AQADM.CREATE_QUEUE -( - queue_name => '"ORDERQUEUE"', - queue_table => '"ORDERQUEUETABLE"'); - - DBMS_AQADM.START_QUEUE -( - queue_name => '"ORDERQUEUE"'); -END; -/ - -BEGIN - DBMS_AQADM.CREATE_QUEUE_TABLE -( - queue_table => 'ORDERUSER."INVENTORYQUEUETABLE"', - queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', - compatible => '8.1'); - - DBMS_AQADM.CREATE_QUEUE -( - queue_name => 'INVENTORYQUEUE', - queue_table => 'INVENTORYQUEUETABLE'); - - DBMS_AQADM.START_QUEUE -( - queue_name => 'INVENTORYQUEUE'); -END; -/ - -quit diff --git a/infra/oci-iaas/grabdish-adapter/database/create_orders_pdb.sql b/infra/oci-iaas/grabdish-adapter/database/create_orders_pdb.sql deleted file mode 100644 index e85ce6f11..000000000 --- a/infra/oci-iaas/grabdish-adapter/database/create_orders_pdb.sql +++ /dev/null @@ -1,31 +0,0 @@ -Set ECHO ON - -alter pluggable database orders close immediate instances=all; -drop pluggable database orders including datafiles; - -CREATE PLUGGABLE DATABASE orders -ADMIN USER admin IDENTIFIED BY "Welcome123" -STORAGE (MAXSIZE 2G) -DEFAULT TABLESPACE oracle -DATAFILE '/u01/app/oracle/oradata/ORCL/orders/orders01.dbf' SIZE 250M AUTOEXTEND ON -PATH_PREFIX = '/u01/app/oracle/oradata/ORCL/dbs/orders/' -FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/ORCL/pdbseed/', '/u01/app/oracle/oradata/ORCL/orders/'); - -alter pluggable database orders open; -quit; -/ - -alter pluggable database orders close immediate instances=all; -drop pluggable database orders including datafiles; - -CREATE PLUGGABLE DATABASE orders -ADMIN USER admin IDENTIFIED BY "Welcome123" -STORAGE (MAXSIZE 2G) -DEFAULT TABLESPACE oracle -DATAFILE '$ORA_BASE/oradata/ORCL/orders/orders01.dbf' SIZE 250M AUTOEXTEND ON -PATH_PREFIX = '$ORA_BASE/oradata/ORCL/dbs/orders/' -FILE_NAME_CONVERT = ('$ORA_BASE/oradata/ORCL/pdbseed/', '$ORA_BASE/oradata/ORCL/orders/'); - -alter pluggable database orders open; -quit; -/ \ No newline at end of file diff --git a/infra/oci-iaas/grabdish-adapter/database/database_utils/setEnv.sh b/infra/oci-iaas/grabdish-adapter/database/database_utils/setEnv.sh deleted file mode 100644 index f162aaa6b..000000000 --- a/infra/oci-iaas/grabdish-adapter/database/database_utils/setEnv.sh +++ /dev/null @@ -1,19 +0,0 @@ -# Oracle Settings -export TMP=/tmp -export TMPDIR=$TMP - -export ORACLE_HOSTNAME=ol8-19.localdomain -export ORACLE_UNQNAME=orcl -export ORACLE_BASE=/u01/app/oracle -export ORACLE_HOME=$ORACLE_BASE/product/19.3.0.0/dbhome_1 -export ORA_INVENTORY=/u01/app/oraInventory -export ORACLE_SID=orcl -export PDB_NAME=pdb1 -export DATA_DIR=/u01/app/oracle/oradata - -export PATH=/usr/sbin:/usr/local/bin:$PATH -export PATH=$ORACLE_HOME/bin:$PATH - -export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib -export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib - diff --git a/infra/oci-iaas/grabdish-adapter/database/database_utils/start_all.sh b/infra/oci-iaas/grabdish-adapter/database/database_utils/start_all.sh deleted file mode 100644 index 1380d8af2..000000000 --- a/infra/oci-iaas/grabdish-adapter/database/database_utils/start_all.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -. /home/oracle/scripts/setEnv.sh - -export ORAENV_ASK=NO -. oraenv -export ORAENV_ASK=YES - -dbstart $ORACLE_HOME diff --git a/infra/oci-iaas/grabdish-adapter/database/database_utils/start_dbca.sh b/infra/oci-iaas/grabdish-adapter/database/database_utils/start_dbca.sh deleted file mode 100644 index e55abd815..000000000 --- a/infra/oci-iaas/grabdish-adapter/database/database_utils/start_dbca.sh +++ /dev/null @@ -1,20 +0,0 @@ -lsnrctl start - -dbca -silent -createDatabase \ - -templateName General_Purpose.dbc \ - -gdbname ${ORACLE_SID} -sid ${ORACLE_SID} -responseFile NO_VALUE \ - -characterSet AL32UTF8 \ - -sysPassword Ora_DB4U \ - -systemPassword Ora_DB4U \ - -createAsContainerDatabase true \ - -numberOfPDBs 1 \ - -pdbName ${PDB_NAME} \ - -pdbAdminPassword Ora_DB4U \ - -databaseType MULTIPURPOSE \ - -memoryMgmtType auto_sga \ - -totalMemory 4000 \ - -storageType FS \ - -datafileDestination "${DATA_DIR}" \ - -redoLogFileSize 50 \ - -emConfiguration NONE \ - -ignorePreReqs diff --git a/infra/oci-iaas/grabdish-adapter/database/database_utils/stop_all.sh b/infra/oci-iaas/grabdish-adapter/database/database_utils/stop_all.sh deleted file mode 100644 index d3fa85618..000000000 --- a/infra/oci-iaas/grabdish-adapter/database/database_utils/stop_all.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -. /home/oracle/scripts/setEnv.sh - -export ORAENV_ASK=NO -. oraenv -export ORAENV_ASK=YES - -dbshut $ORACLE_HOME diff --git a/infra/oci-iaas/grabdish-adapter/database/db_docker_setup.sh b/infra/oci-iaas/grabdish-adapter/database/db_docker_setup.sh deleted file mode 100644 index c7b7883a0..000000000 --- a/infra/oci-iaas/grabdish-adapter/database/db_docker_setup.sh +++ /dev/null @@ -1,337 +0,0 @@ -#/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -e - -#added for on-premise - -# DB Connection Setup -ORDER_DB_SVC=orders -INVENTORY_DB_SVC=inventory -ORDER_USER=ORDERUSER -INVENTORY_USER=INVENTORYUSER -ORDER_LINK=ORDERTOINVENTORYLINK -INVENTORY_LINK=INVENTORYTOORDERLINK -ORDER_QUEUE=ORDERQUEUE -INVENTORY_QUEUE=INVENTORYQUEUE - - -# Get DB Password -DB_PASSWORD="$(curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password')" - -#DB_SEED_PASSWORD=Welcome123 -DB_SEED_PASSWORD=$DB_PASSWORD - - -# Create Orders PDB -U=$ORDER_USER -SVC=${ORDER_DB_SVC} -echo "########## Creating Orders PDB ###########" -sqlplus sys/$DB_SEED_PASSWORD@$(hostname):1521/orcl as SYSDBA < 'ORDERQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -multiple_consumers => true, -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$ORDER_QUEUE', -queue_table => 'ORDERQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$ORDER_QUEUE'); -END; -/ - -BEGIN -DBMS_AQADM.CREATE_QUEUE_TABLE ( -queue_table => 'INVENTORYQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$INVENTORY_QUEUE', -queue_table => 'INVENTORYQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$INVENTORY_QUEUE'); -END; -/ -! - - -echo "########## Granting Access to Inventory User, Creating Inventory PDB Queues ###########" -echo $U/"$DB_PASSWORD"@${SVC}_tp -echo "#############DEBUGGING" - - -# Inventory DB User, Objects - - U=$INVENTORY_USER - SVC=$INVENTORY_DB_SVC -echo "########## Granting Access to Inventory User, Creating Inventory PDB Queues ###########" -echo $U/"$DB_PASSWORD"@${SVC}_tp -echo "#############DEBUGGING" - #connect admin/"$DB_PASSWORD"@$SVC -# sqlplus /nolog < 'ORDERQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$ORDER_QUEUE', -queue_table => 'ORDERQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$ORDER_QUEUE'); -END; -/ - -BEGIN -DBMS_AQADM.CREATE_QUEUE_TABLE ( -queue_table => 'INVENTORYQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -multiple_consumers => true, -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$INVENTORY_QUEUE', -queue_table => 'INVENTORYQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$INVENTORY_QUEUE'); -END; -/ - -create table inventory ( - inventoryid varchar(16) PRIMARY KEY NOT NULL, - inventorylocation varchar(32), - inventorycount integer CONSTRAINT positive_inventory CHECK (inventorycount >= 0) ); - -insert into inventory values ('sushi', '1468 WEBSTER ST,San Francisco,CA', 0); -insert into inventory values ('pizza', '1469 WEBSTER ST,San Francisco,CA', 0); -insert into inventory values ('burger', '1470 WEBSTER ST,San Francisco,CA', 0); -commit; -! - -echo "########## Created Inventory TABLESPACE ###########" - -echo "########## Creating DB Links for Orders ###########" - - -# Order DB Link - - U=$ORDER_USER - SVC=$ORDER_DB_SVC - TU=$INVENTORY_USER - TSVC=$INVENTORY_DB_SVC - LINK=$ORDER_LINK - Q=$ORDER_QUEUE - sqlplus /nolog <'$Q', - subscriber=>sys.aq\$_agent(null,'$TU.$Q@$LINK',0), - queue_to_queue => true); -END; -/ - -BEGIN -dbms_aqadm.schedule_propagation - (queue_name => '$U.$Q' - ,destination_queue => '$TU.$Q' - ,destination => '$LINK' - ,start_time => sysdate --immediately - ,duration => null --until stopped - ,latency => 0); --No gap before propagating -END; -/ -! - -echo "########## Creating Inventory Queues and Propagation ###########" - -# Inventory Queues and Propagation - - U=$INVENTORY_USER - SVC=$INVENTORY_DB_SVC - TU=$ORDER_USER - TSVC=$ORDER_DB_SVC - LINK=$INVENTORY_LINK - Q=$INVENTORY_QUEUE - sqlplus /nolog <'$Q', - subscriber=>sys.aq\$_agent(null,'$TU.$Q@$LINK',0), - queue_to_queue => true); -END; -/ - -BEGIN -dbms_aqadm.schedule_propagation - (queue_name => '$U.$Q' - ,destination_queue => '$TU.$Q' - ,destination => '$LINK' - ,start_time => sysdate --immediately - ,duration => null --until stopped - ,latency => 0); --No gap before propagating -END; -/ -! - -echo "########## .net Inventory DB Proc ###########" - -# .net Inventory DB Proc - -U=$INVENTORY_USER -SVC=$INVENTORY_DB_SVC -sqlplus /nolog < 'ORDERQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -multiple_consumers => true, -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$ORDER_QUEUE', -queue_table => 'ORDERQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$ORDER_QUEUE'); -END; -/ - -BEGIN -DBMS_AQADM.CREATE_QUEUE_TABLE ( -queue_table => 'INVENTORYQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$INVENTORY_QUEUE', -queue_table => 'INVENTORYQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$INVENTORY_QUEUE'); -END; -/ -! - state_set_done ORDER_USER -done - -echo "########## Granting Access to Inventory User, Creating Inventory PDB Queues ###########" -echo $U/"$DB_PASSWORD"@${SVC}_tp -echo "#############DEBUGGING" - - -# Inventory DB User, Objects -while ! state_done INVENTORY_USER; do - U=$INVENTORY_USER - SVC=$INVENTORY_DB_SVC -echo "########## Granting Access to Inventory User, Creating Inventory PDB Queues ###########" -echo $U/"$DB_PASSWORD"@${SVC}_tp -echo "#############DEBUGGING" - #connect admin/"$DB_PASSWORD"@$SVC - sqlplus /nolog < 'ORDERQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$ORDER_QUEUE', -queue_table => 'ORDERQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$ORDER_QUEUE'); -END; -/ - -BEGIN -DBMS_AQADM.CREATE_QUEUE_TABLE ( -queue_table => 'INVENTORYQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -multiple_consumers => true, -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$INVENTORY_QUEUE', -queue_table => 'INVENTORYQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$INVENTORY_QUEUE'); -END; -/ - -create table inventory ( - inventoryid varchar(16) PRIMARY KEY NOT NULL, - inventorylocation varchar(32), - inventorycount integer CONSTRAINT positive_inventory CHECK (inventorycount >= 0) ); - -insert into inventory values ('sushi', '1468 WEBSTER ST,San Francisco,CA', 0); -insert into inventory values ('pizza', '1469 WEBSTER ST,San Francisco,CA', 0); -insert into inventory values ('burger', '1470 WEBSTER ST,San Francisco,CA', 0); -commit; -! - state_set_done INVENTORY_USER -done - - -# Order DB Link - -while ! state_done ORDER_PROPAGATION; do - U=$ORDER_USER - SVC=$ORDER_DB_SVC - TU=$INVENTORY_USER - TSVC=$INVENTORY_DB_SVC - LINK=$ORDER_LINK - Q=$ORDER_QUEUE - sqlplus /nolog <'$Q', - subscriber=>sys.aq\$_agent(null,'$TU.$Q@$LINK',0), - queue_to_queue => true); -END; -/ - -BEGIN -dbms_aqadm.schedule_propagation - (queue_name => '$U.$Q' - ,destination_queue => '$TU.$Q' - ,destination => '$LINK' - ,start_time => sysdate --immediately - ,duration => null --until stopped - ,latency => 0); --No gap before propagating -END; -/ -! - state_set_done ORDER_PROPAGATION -done - - -# Inventory Queues and Propagation -while ! state_done INVENTORY_PROPAGATION; do - U=$INVENTORY_USER - SVC=$INVENTORY_DB_SVC - TU=$ORDER_USER - TSVC=$ORDER_DB_SVC - LINK=$INVENTORY_LINK - Q=$INVENTORY_QUEUE - sqlplus /nolog <'$Q', - subscriber=>sys.aq\$_agent(null,'$TU.$Q@$LINK',0), - queue_to_queue => true); -END; -/ - -BEGIN -dbms_aqadm.schedule_propagation - (queue_name => '$U.$Q' - ,destination_queue => '$TU.$Q' - ,destination => '$LINK' - ,start_time => sysdate --immediately - ,duration => null --until stopped - ,latency => 0); --No gap before propagating -END; -/ -! - state_set_done INVENTORY_PROPAGATION -done - - -# .net Inventory DB Proc -while ! state_done DOT_NET_INVENTORY_DB_PROC; do - U=$INVENTORY_USER - SVC=$INVENTORY_DB_SVC - sqlplus /nolog < 'ORDERQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -multiple_consumers => true, -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$ORDER_QUEUE', -queue_table => 'ORDERQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$ORDER_QUEUE'); -END; -/ - -BEGIN -DBMS_AQADM.CREATE_QUEUE_TABLE ( -queue_table => 'INVENTORYQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$INVENTORY_QUEUE', -queue_table => 'INVENTORYQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$INVENTORY_QUEUE'); -END; -/ -! - state_set_done ORDER_USER -done - -echo "########## Granting Access to Inventory User, Creating Inventory PDB Queues ###########" -echo $U/"$DB_PASSWORD"@${SVC}_tp -echo "#############DEBUGGING" - - -# Inventory DB User, Objects -while ! state_done INVENTORY_USER; do - U=$INVENTORY_USER - SVC=$INVENTORY_DB_SVC -echo "########## Granting Access to Inventory User, Creating Inventory PDB Queues ###########" -echo $U/"$DB_PASSWORD"@${SVC}_tp -echo "#############DEBUGGING" - #connect admin/"$DB_PASSWORD"@$SVC - sqlplus /nolog < 'ORDERQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$ORDER_QUEUE', -queue_table => 'ORDERQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$ORDER_QUEUE'); -END; -/ - -BEGIN -DBMS_AQADM.CREATE_QUEUE_TABLE ( -queue_table => 'INVENTORYQUEUETABLE', -queue_payload_type => 'SYS.AQ\$_JMS_TEXT_MESSAGE', -multiple_consumers => true, -compatible => '8.1'); - -DBMS_AQADM.CREATE_QUEUE ( -queue_name => '$INVENTORY_QUEUE', -queue_table => 'INVENTORYQUEUETABLE'); - -DBMS_AQADM.START_QUEUE ( -queue_name => '$INVENTORY_QUEUE'); -END; -/ - -create table inventory ( - inventoryid varchar(16) PRIMARY KEY NOT NULL, - inventorylocation varchar(32), - inventorycount integer CONSTRAINT positive_inventory CHECK (inventorycount >= 0) ); - -insert into inventory values ('sushi', '1468 WEBSTER ST,San Francisco,CA', 0); -insert into inventory values ('pizza', '1469 WEBSTER ST,San Francisco,CA', 0); -insert into inventory values ('burger', '1470 WEBSTER ST,San Francisco,CA', 0); -commit; -! - state_set_done INVENTORY_USER -done - - -# Order DB Link - -while ! state_done ORDER_PROPAGATION; do - U=$ORDER_USER - SVC=$ORDER_DB_SVC - TU=$INVENTORY_USER - TSVC=$INVENTORY_DB_SVC - LINK=$ORDER_LINK - Q=$ORDER_QUEUE - sqlplus /nolog <'$Q', - subscriber=>sys.aq\$_agent(null,'$TU.$Q@$LINK',0), - queue_to_queue => true); -END; -/ - -BEGIN -dbms_aqadm.schedule_propagation - (queue_name => '$U.$Q' - ,destination_queue => '$TU.$Q' - ,destination => '$LINK' - ,start_time => sysdate --immediately - ,duration => null --until stopped - ,latency => 0); --No gap before propagating -END; -/ -! - state_set_done ORDER_PROPAGATION -done - - -# Inventory Queues and Propagation -while ! state_done INVENTORY_PROPAGATION; do - U=$INVENTORY_USER - SVC=$INVENTORY_DB_SVC - TU=$ORDER_USER - TSVC=$ORDER_DB_SVC - LINK=$INVENTORY_LINK - Q=$INVENTORY_QUEUE - sqlplus /nolog <'$Q', - subscriber=>sys.aq\$_agent(null,'$TU.$Q@$LINK',0), - queue_to_queue => true); -END; -/ - -BEGIN -dbms_aqadm.schedule_propagation - (queue_name => '$U.$Q' - ,destination_queue => '$TU.$Q' - ,destination => '$LINK' - ,start_time => sysdate --immediately - ,duration => null --until stopped - ,latency => 0); --No gap before propagating -END; -/ -! - state_set_done INVENTORY_PROPAGATION -done - - -# .net Inventory DB Proc -while ! state_done DOT_NET_INVENTORY_DB_PROC; do - U=$INVENTORY_USER - SVC=$INVENTORY_DB_SVC - sqlplus /nolog <$GRABDISH_LOG/jaeger_err; then - state_set_done JAEGER - else - echo "Jaeger installation failed. Retrying..." - cat "$GRABDISH_LOG"/jaeger_err - sleep 10 - fi -#done diff --git a/infra/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml b/infra/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml deleted file mode 100644 index f884710de..000000000 --- a/infra/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: frontend-ingress - annotations: - #nginx.ingress.kubernetes.io/rewrite-target: / - kubernetes.io/ingress.class: nginx - nginx.ingress.kubernetes.io/add-base-url: "true" - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/from-to-www-redirect: "true" - #nginx.ingress.kubernetes.io/enable-cors: "true" - #nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, OPTIONS" - #nginx.ingress.kubernetes.io/cors-allow-credentials: "true" - #nginx.kubernetes.io/ingress.allow-http: "false" - #nginx.org/redirect-to-https: "true" - #kubernetes.io/ingress.allow-http: "false" - #nginx.ingress.kubernetes.io/force-ssl-redirect: "true" -spec: - tls: - - hosts: - secretName: ssl-certificate-secret - rules: - - host: - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: frontend - port: - number: 4444 - - path: /jaeger - pathType: Prefix - backend: - service: - name: jaeger-query - port: - number: 443 - - path: /search - pathType: Prefix - backend: - service: - name: jaeger-query - port: - number: 443 - - path: /static - pathType: Prefix - backend: - service: - name: jaeger-query - port: - number: 443 - - path: /api - pathType: Prefix - backend: - service: - name: jaeger-query - port: - number: 443 diff --git a/infra/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml b/infra/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml deleted file mode 100644 index 89d80586f..000000000 --- a/infra/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml +++ /dev/null @@ -1,19 +0,0 @@ -## -## Copyright (c) 2021 Oracle and/or its affiliates. -## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ -apiVersion: v1 -kind: Service -metadata: - name: frontend - labels: - app: frontend - annotations: -spec: - type: NodePort - ports: - - port: 4444 - nodePort: 30443 - name: http - targetPort: 8080 - selector: - app: frontend diff --git a/infra/oci-iaas/grabdish-adapter/k8s/get_secret_dbpasswd.sh b/infra/oci-iaas/grabdish-adapter/k8s/get_secret_dbpasswd.sh deleted file mode 100644 index fc192d0e7..000000000 --- a/infra/oci-iaas/grabdish-adapter/k8s/get_secret_dbpasswd.sh +++ /dev/null @@ -1,12 +0,0 @@ -#/bin/bash - -while true; do - if DB_PASSWORD=`kubectl get secret dbuser -n msdataworkshop --template={{.data.dbpassword}} | base64 --decode`; then - if ! test -z "$DB_PASSWORD"; then - echo $DB_PASSWORD; - break - fi - fi - echo "Error: Failed to get DB password. Retrying..." - sleep 5 -done diff --git a/infra/oci-iaas/grabdish-adapter/k8s/get_secret_dbwallet.sh b/infra/oci-iaas/grabdish-adapter/k8s/get_secret_dbwallet.sh deleted file mode 100644 index 2135da028..000000000 --- a/infra/oci-iaas/grabdish-adapter/k8s/get_secret_dbwallet.sh +++ /dev/null @@ -1,30 +0,0 @@ -# Create Inventory ATP Bindings - - - -`kubectl get secret db-wallet-secret -n msdataworkshop --template={{.data.tnsnames.ora}} | base64 --decode` - - -#while ! state_done DB_WALLET_SECRET; do - if kubectl apply -f - -n msdataworkshop; then - state_set_done DB_WALLET_SECRET - else - echo "Error: Failure to create db-wallet-secret. Retrying..." - sleep 5 - fi <[]%~" -} - -module "network" { - source = "./modules/network" - target_compartment_id = var.compartment_ocid - common_tags = local.common_tags - #display_name_prefix = var.new_network_prefix - # dns_label = var.new_network_prefix -} - -module "compute" { - source = "./modules/compute" - region = var.region - tenancy_ocid = var.tenancy_ocid - target_compartment_id = var.compartment_ocid - vcn_id = module.network.vcn.id - subnet_id = module.network.subnet.id - instance_shape = var.instance_shape - generate_ssh_key_pair = var.generate_ssh_key_pair - ssh_public_key = var.ssh_public_key - generate_app_db_passwords = var.generate_app_db_passwords - use_tenancy_level_policy = var.use_tenancy_level_policy - common_tags = local.common_tags - grabdish_database_password = var.generate_app_db_passwords ? random_string.grabdish_database_password.result : var.grabdish_database_password - grabdish_application_password = var.generate_app_db_passwords ? random_string.grabdish_application_password.result : var.grabdish_application_password - #iaas_public_repo = var.iaas_public_repo - #app_public_repo = var.app_public_repo - iaas_app_public_repo = var.iaas_app_public_repo - dbaas_FQDN = join(".", [module.compute.dbaas_display_name,module.network.subnet_domain_name]) -} \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/main.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/main.tf deleted file mode 100644 index 99084fe82..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/main.tf +++ /dev/null @@ -1,281 +0,0 @@ -locals { - compartment_id = var.target_compartment_id - vcn_id = var.vcn_id - all_cidr = "0.0.0.0/0" - current_time = formatdate("YYYYMMDDhhmmss", timestamp()) - app_name = "grabdish-microsvc" - app_compute_instance1_name = "grabdish-compute1" - app_db_instance1_name = "grabdish-database1" - display_name = join("-", [local.app_name, local.current_time]) - compartment_name = data.oci_identity_compartment.this.name - grabdish_app_password = var.grabdish_application_password - grabdish_db_password = var.grabdish_database_password - dynamic_group_tenancy_level = "Allow dynamic-group ${oci_identity_dynamic_group.for_instance.name} to manage all-resources in tenancy" - dynamic_group_compartment_level = "Allow dynamic-group ${oci_identity_dynamic_group.for_instance.name} to manage all-resources in compartment ${local.compartment_name}" - num_of_ads = length(data.oci_identity_availability_domains.ads.availability_domains) - ads = local.num_of_ads > 1 ? flatten([ - for ad_shapes in data.oci_core_shapes.this : [ - for shape in ad_shapes.shapes : ad_shapes.availability_domain if shape.name == var.instance_shape - ] - ]) : [for ad in data.oci_identity_availability_domains.ads.availability_domains : ad.name] -} - - -resource "oci_core_network_security_group" "nsg" { - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-security-group" # Optional - freeform_tags = var.common_tags -} - -resource "oci_core_network_security_group_security_rule" "ingress_ssh" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "22" # Required - min = "22" # Required - } - } - description = "ssh only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_https" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "443" # Required - min = "443" # Required - } - } - description = "https only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_http" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "80" # Required - min = "80" # Required - } - } - description = "http only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_sqlnet" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "1521" # Required - min = "1521" # Required - } - } - description = "sqlnet 1521 only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_icmp_3_4" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "1" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - icmp_options { # Optional - type = "3" # Required - code = "4" # Required - } - description = "icmp option 1" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_icmp_3" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "1" # Required - source = "10.0.0.0/16" # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - icmp_options { # Optional - type = "3" # Required - } - description = "icmp option 2" # Optional -} - -resource "oci_core_network_security_group_security_rule" "egress" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "EGRESS" # Required - protocol = "6" # Required - destination = local.all_cidr # Required - destination_type = "CIDR_BLOCK" # Required - stateless = false # Optional - description = "connect to any network" -} - -# Get a list of Availability Domains -data "oci_identity_availability_domains" "ads" { - compartment_id = var.tenancy_ocid -} - -data "oci_core_images" "this" { - compartment_id = local.compartment_id # Required - operating_system = var.image_os # Optional - operating_system_version = var.image_os_version # Optional - shape = var.instance_shape # Optional - sort_by = "TIMECREATED" # Optional - sort_order = "DESC" # Optional -} - -data "oci_core_shapes" "this" { - count = local.num_of_ads > 1 ? local.num_of_ads : 0 - #Required - compartment_id = local.compartment_id - - #Optional - availability_domain = data.oci_identity_availability_domains.ads.availability_domains[count.index].name - image_id = data.oci_core_images.this.images[0].id -} - -data "oci_identity_compartment" "this" { - id = local.compartment_id -} - -# Generate the private and public key pair -resource "tls_private_key" "ssh_keypair" { - algorithm = "RSA" # Required - rsa_bits = 2048 # Optional -} - -resource "oci_identity_dynamic_group" "for_instance" { - compartment_id = var.tenancy_ocid - description = "To Access OCI CLI" - name = "${local.display_name}-dynamic-group" - matching_rule = "ANY {instance.id = '${oci_core_instance.compute_instance1.id}'}" - freeform_tags = var.common_tags -} - -resource "oci_identity_policy" "dg_manage_all" { - compartment_id = var.use_tenancy_level_policy ? var.tenancy_ocid : local.compartment_id - description = "To Access OCI CLI" - name = "${local.display_name}-instance-policy" - statements = var.use_tenancy_level_policy ? [local.dynamic_group_tenancy_level] : [local.dynamic_group_compartment_level] - freeform_tags = var.common_tags -} - -resource "oci_core_instance" "dbaas_instance1" { - availability_domain = local.ads[0] - compartment_id = local.compartment_id - shape = var.instance_shape - preserve_boot_volume = false - freeform_tags = var.common_tags - display_name = local.app_db_instance1_name - - create_vnic_details { - subnet_id = var.subnet_id - assign_public_ip = true - nsg_ids = [ - oci_core_network_security_group.nsg.id] - } - - source_details { - source_type = "image" - #source_id = data.oci_core_images.this.images[0].id - #source_id = "ocid1.image.oc1.iad.aaaaaaaaudkqtvbfo4mm3qyhqdrpqcatijjmml2z7ddal7hojhb2gcv34kaq" # Custom Compute - #source_id = "ocid1.image.oc1..aaaaaaaa7cr4xiwx6mbdrgfbppdypdtzyxothft2sjqftygtpxnulqmk6tla" # Platform Image - #source_id = "ocid1.appcataloglisting.oc1..aaaaaaaan5rb524w7axx36ukn42l7fwzyzm3kodad7x5hxyeyz4nyy3yefgq" # Marketplace Image - #source_id ="ocid1.image.oc1..aaaaaaaamotrq5ou4qjsnzw5sv7w2nbwvhhp4kjmazlxf23ozcsd66t3pw5q" #LiveLabs Converged DB - #source_id ="ocid1.image.oc1.iad.aaaaaaaajv4k3wrfdrxwapmewcw37oxsroms3f7hmrk2mc7hepweiy3cbtja" #docker-db-21c-prega - source_id ="ocid1.image.oc1.iad.aaaaaaaabofqpxuzhkrqprbzvd6chq52chmwpqtjqgacl554nmj3acqpt6la" #single-node-deployment - - # DB-Base Image - } - - metadata = { - ssh_authorized_keys = var.generate_ssh_key_pair ? tls_private_key.ssh_keypair.public_key_openssh : var.ssh_public_key - user_data = base64encode(file("./modules/compute/scripts/bootstrap_database_docker.sh")) - tenancy_id = var.tenancy_ocid - grabdish_application_password = var.grabdish_application_password - grabdish_database_password = var.grabdish_database_password - #app_public_repo = var.app_public_repo - #iaas_public_repo = var.iaas_public_repo - iaas_app_public_repo = var.iaas_app_public_repo - #dbaas_FQDN = var.dbaas_FQDN - target_compartment_id =var.target_compartment_id - vcn_id = var.vcn_id - subnet_id = var.subnet_id - image_os = var.image_os - image_os_version = var.image_os_version - instance_shape = var.instance_shape - - } -} - -resource "oci_core_instance" "compute_instance1" { - availability_domain = local.ads[0] - compartment_id = local.compartment_id - shape = var.instance_shape - preserve_boot_volume = false - freeform_tags = var.common_tags - display_name = local.app_compute_instance1_name - - - create_vnic_details { - subnet_id = var.subnet_id - assign_public_ip = true - nsg_ids = [oci_core_network_security_group.nsg.id] - } - - source_details { - source_type = "image" - #source_id = data.oci_core_images.this.images[0].id - #source_id = "ocid1.image.oc1.iad.aaaaaaaaudkqtvbfo4mm3qyhqdrpqcatijjmml2z7ddal7hojhb2gcv34kaq" # Custom Compute - #source_id = "ocid1.image.oc1..aaaaaaaa7cr4xiwx6mbdrgfbppdypdtzyxothft2sjqftygtpxnulqmk6tla" # DB-Base Image - #source_id ="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" # microservices-2-cm - #source_id="ocid1.image.oc1.phx.aaaaaaaaw6pi7tnx2pvqgzi2lgpsicjj5cl46a3llrk6nghgbthve7f72v6a" #microservices-phx-1 - - #source_id="ocid1.image.oc1.iad.aaaaaaaa643d766gxmmzk7gul6557hnp53ul3wieu4al3qjpaiklk3mom2ba" #microservices-ash-1-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" #microservices-2-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaafwnzt3vu4ebfvrhsilrqv7i2ykv2osdmf42rjtq72nxi5qldt6ua" #microservices-ash-2-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" #microservices-2-cm - source_id = "ocid1.image.oc1.iad.aaaaaaaaobsqoqegphdipcwrmt4ji6r4ukjirxvzlc7dzvto66beijmo4exa" - - - } - metadata = { - ssh_authorized_keys = var.generate_ssh_key_pair ? tls_private_key.ssh_keypair.public_key_openssh : var.ssh_public_key - user_data = base64encode(file("./modules/compute/scripts/bootstrap_compute.sh")) - tenancy_id = var.tenancy_ocid - grabdish_application_password = var.grabdish_application_password - grabdish_database_password = var.grabdish_database_password - #app_public_repo = var.app_public_repo - #iaas_public_repo = var.iaas_public_repo - iaas_app_public_repo = var.iaas_app_public_repo - dbaas_FQDN = var.dbaas_FQDN - target_compartment_id =var.target_compartment_id - vcn_id = var.vcn_id - subnet_id = var.subnet_id - image_os = var.image_os - image_os_version = var.image_os_version - instance_shape = var.instance_shape - } -} - - - diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/outputs.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/outputs.tf deleted file mode 100644 index bff5ef7e7..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/outputs.tf +++ /dev/null @@ -1,24 +0,0 @@ -output "instance" { - value = oci_core_instance.compute_instance1 -} - -output "instance_keys" { - value = tls_private_key.ssh_keypair -} - -output "dbaas_public_ip" { - value = oci_core_instance.dbaas_instance1.public_ip -} - -output "dbaas_private_ip" { - value = oci_core_instance.dbaas_instance1.private_ip -} - -output "dbaas_compute_id" { - value = oci_core_instance.dbaas_instance1.id -} - -output "dbaas_display_name" { - value = oci_core_instance.dbaas_instance1.display_name -} - diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstap06.17.21.sh b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstap06.17.21.sh deleted file mode 100644 index c609bb302..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstap06.17.21.sh +++ /dev/null @@ -1,429 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -APP_NAME=oci-grabdish -DEV_TOOLS_HOME=${USER_HOME}/${APP_NAME} -APP_CONFIG_FILE_NAME=config-${APP_NAME}.json -INSTALL_LOG_FILE_NAME=install-${APP_NAME}.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # OCI Development Kit Installation is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - OCI DEV KIT Usage - =================== - This instance has OCI Dev Kit such as CLI, Terraform, Ansible, SDKs (Java, Python3.6, Go, Dotnet, Ruby, Typescript) - - To update OCI Dev Kit to the latest version, run the following command: ${UPDATE_SCRIPT_FILE} - - You could use Instance Principal authentication to use the dev tools. - - For running CLI, type the following to get more help: oci --help - ================================================================================================= -" - -start=`date +%s` - -# create a configuration file - -# Config file -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >.${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Installing OCI Dev Kit" -echo "------------------------" - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Installing yum packages ######### - -echo "Packages to install ${PACKAGES_TO_INSTALL[@]}" - -sudo yum-config-manager --enable ol7_developer ol7_developer_EPEL && echo "#################### Successfully installed ol7_developer yum packages #####################" - -echo "Manually Disabling MYSQL" -sudo yum --disablerepo=ol7_MySQL80 update - -sudo yum -y install ${PACKAGES_TO_INSTALL[@]} && echo "#################### Successfully installed all yum packages #####################" - -sudo yum -y install --enablerepo=ol7_developer_nodejs10 --enablerepo=ol7_developer oci-typescript-sdk && echo "#################### Successfully installed typescript #####################" - -####### Installing yum packages -End ######### - -####### Adding OCI Modules to Powershell ######### - -sudo -u ${USER_NAME} pwsh -c Register-PSRepository -Name LocalRepository -SourceLocation /usr/lib/dotnet/NuPkgs -InstallationPolicy Trusted -sudo -u ${USER_NAME} pwsh -c "Set-Variable -Name ProgressPreference -Value SilentlyContinue; Install-Module OCI.PSModules -Repository LocalRepository" -sudo -u ${USER_NAME} pwsh -c Uninstall-Module OCI.PSModules -sudo -u ${USER_NAME} pwsh -c Unregister-PSRepository -Name LocalRepository - -####### Adding OCI Modules to Powershell -End ######### - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so ansible can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_ANSIBLE_AUTH_TYPE=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so powershell can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_PS_AUTH="InstancePrincipal"' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo 'export GOPATH=/usr/share/gocode' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci jars are in the classpath" -JAVASDK_VERSION=$(yum list java-oci-sdk | grep -o "[0-9].[0-9]\+.[0-9]\+" | head -1) -sudo -u ${USER_NAME} echo "export CLASSPATH=/usr/lib64/java-oci-sdk/lib/oci-java-sdk-full-${JAVASDK_VERSION}.jar:/usr/lib64/java-oci-sdk/third-party/lib/*" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so ruby collections are properly set" -sudo -u ${USER_NAME} echo "source scl_source enable rh-ruby27" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export GEM_PATH=/usr/share/gems:'gem env gempath'" >> ${USER_HOME}/.bashrc -echo "Adding environment variable so dotnet collections are properly set" -sudo -u ${USER_NAME} echo "source scl_source enable rh-dotnet31" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -echo "Adding environment variable for SDK analytics" -sudo -u ${USER_NAME} echo 'export OCI_SDK_APPEND_USER_AGENT=Oracle-ORMDevTools' >> ${USER_HOME}/.bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating OCI Dev Kit" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Updating OCI Dev Kit is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} < ${SSHD_BANNER_FILE} - -exec -l $SHELL - - -curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password_password')", - "grabdish_database_password": "$($CURL_METADATA_COMMAND | jq --raw-output '.grabdish_database_passwor - - - -# 344 minikube delete -# 345 minikube start --driver=none -# 346 docker container stop registry -# 347 docker container rm registry -# 348 docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -#docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2 -#docker container stop registry -#docker container rm registry - - - -# 344 minikube delete -# 345 minikube start --driver=none -# 346 docker container stop registry -# 347 docker container rm registry -# 348 docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -#docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2 -#docker container stop registry -#docker container rm registry - - - -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_ns_msdataworkshop.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_frontendpasswd.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbpasswd.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbwallet.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_ssl-certificate-secret.sh - - -docker run --name microservice-database3 -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:RDBMS_21.3.0.0.0_LINUX.X64_210709 - - - -System parameter file is /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora -Log messages written to /opt/oracle/diag/tnslsnr/ffa6a4004a14/listener/alert/log.xml -Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) -Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) - -Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) -STATUS of the LISTENER ------------------------- -Alias LISTENER -Version TNSLSNR for Linux: Version 21.0.0.0.0 - Production -Start Date 06-AUG-2021 19:20:14 -Uptime 0 days 0 hr. 0 min. 0 sec -Trace Level off -Security ON: Local OS Authentication -SNMP OFF -Listener Parameter File /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora -Listener Log File /opt/oracle/diag/tnslsnr/ffa6a4004a14/listener/alert/log.xml -Listening Endpoints Summary... - (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) - (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) -The listener supports no services -The command completed successfully - - - -docker run --name [container name] --p [host port]:1521 -p :5500 --e ORACLE_SID=[your SID] --e ORACLE_PDB=[your PDB name] --e ORACLE_PWD=[your database passwords] --e INIT_SGA_SIZE=[your database SGA memory in MB] --e INIT_PGA_SIZE=[your database PGA memory in MB] --e ORACLE_EDITION=[your database edition] --e ORACLE_CHARACTERSET=[your character set] --v [host mount point:]/opt/oracle/oradata -dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:17754 - -Parameters: - --name: The name of the container (default: auto generated) - -p: The port mapping of the host port to the container port. - Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express) - -e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB) - -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1) - -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated) - -e INIT_SGA_SIZE: - The total memory in MB that should be used for all SGA components (optional). - -e INIT_PGA_SIZE: - The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional). - -e ORACLE_EDITION: - The Oracle Database Edition (enterprise/standard). - -e ORACLE_CHARACTERSET: - The character set to use when creating the database (default: AL32UTF8) - -v /opt/oracle/oradata - The data volume to use for the database. - Has to be writable by the Unix "oracle" (uid: 54321) user inside the container! - If omitted the database will not be persisted over container recreation. - -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup - Optional: A volume with custom scripts to be run after database startup. - -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup - Optional: A volume with custom scripts to be run after database setup. - - -docker run --name db-19300-docker -p 1 - - -docker run --name microservice-database -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:17754 - -docker run --name microservice-database -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata container-registry.oracle.com/database/enterprise:latest - - - -[oracle@grabdish_docker-db1 /]$ cp ~/tnsnames.ora /opt/oracle/oradata/dbconfig/ORCL/tnsnames.ora -[oracle@grabdish_docker-db1 /]$ cp ~/tnsnames.ora /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_compute.sh b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_compute.sh deleted file mode 100644 index 21d45d2f1..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_compute.sh +++ /dev/null @@ -1,359 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -BUILD_LOG_FILE=${USER_HOME}/${APP_NAME}-build - -#INSTALL_ROOT_DIR=/microservices -INSTALL_ROOT_DIR=${USER_HOME} -APP_INSTALL_DIR=${INSTALL_ROOT_DIR}/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT_DIR}/microservices-datadriven/${APP_NAME} -INFRA_HOME=${INSTALL_ROOT_DIR}/microservices-datadriven/${APP_NAME} -TNS_ADMIN_LOC=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN -DOCKER_CERTS_DIR=${INFRA_INSTALL_DIR}/oci-iaas/grabdish-adapter/infrastructure - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -ORACLE_HOME="/usr/lib/oracle/19.11/client64" # For Oracle 19c client - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" -DOCKER_REG_CMD="docker run -d \ - --restart=always \ - --name registry \ - -v "$DOCKER_CERTS_DIR"/certs:/certs \ - -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - -p 443:443 \ - registry:2" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - printf "\360\237\220\261 ${print_header_count}.: $1\n" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - printf "\360\237\246\204 ${print_header_count}.${print_subheader_count}.: [INFO] $1\n" - return - } - - -start=$(date +%s) - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} ${BUILD_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} ${BUILD_LOG_FILE} - - -# Sending all stdout and stderr to log file -exec >${INSTALL_LOG_FILE} -exec 2>&1 - - -print_header "Starting Microservices Data-driven Infrastructure installation process at $(date)" - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -print_header "Creating Microservices Data-driven Infrastructure Configuration File." - -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <${SSHD_BANNER_FILE}" -sudo bash -c "echo "${USAGE_INFO}" >>${SSHD_BANNER_FILE}" -sudo bash -c "echo "Banner ${SSHD_BANNER_FILE}" >>${SSHD_CONFIG_FILE}" -print_subheader "SSHD Banner created" -sudo systemctl restart sshd.service | -print_subheader "Restarted SSHD Service" - -####### Adding environment variables ######### -print_header "Creating Environment Variables" -print_subheader "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -print_subheader "Adding Oracle Home and Path variables to bashrc" -sudo -u ${USER_NAME} echo "export ORACLE_HOME=${ORACLE_HOME}" >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TNS_ADMIN=${TNS_ADMIN_LOC}" >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="${ORACLE_HOME}"' >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >>${USER_HOME}/.bashrc -print_subheader "Completed" - -print_subheader "Adding APP_INSTALL_DIR and INFRA_INSTALL_DIR variables to bashrc" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "source <(kubectl completion bash)" >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >>${USER_HOME}/.bashrc -print_subheader "Completed" - -####### Adding environment variables - End ######### - - - -# Clone Application and Infrastructure Resource Files -print_header "Downloading Microservices Infrastructure and Application from public repositories" -#sudo mkdir -p $APP_INSTALL_DIR -#sudo mkdir -p $INFRA_INSTALL_DIR -#sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR -#print_subheader "Created destination directories $APP_INSTALL_DIR and $INFRA_INSTALL_DIR" - -#sudo mkdir -p $INFRA_INSTALL_DIR -#sudo chown -R opc:opc $INFRA_INSTALL_DIR -#print_subheader "Created destination directory $INFRA_INSTALL_DIR" - - -#app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -#iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') -iaas_app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_app_public_repo') - - -#print_subheader "Downloading Application code from $app_public_repo " -#sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR - -#print_subheader "Downloading Infrastructure code from $iaas_public_repo" -#sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR - -print_subheader "Downloading Infrastructure and Application code from ${iaas_app_public_repo}" -#sudo -u ${USER_NAME} ${iaas_app_public_repo} ${INSTALL_ROOT_DIR} -#sudo ${iaas_app_public_repo} - -#sudo -u ${USER_NAME} ${iaas_app_public_repo} -sudo -u ${USER_NAME} bash -c "cd ${USER_HOME};${iaas_app_public_repo}" -#sudo chown -R opc:opc ${INSTALL_ROOT_DIR} -print_subheader "Downloaded Infrastructure and Application code" - -sudo -u ${USER_NAME} mkdir -p $DOCKER_CERTS_DIR/certs -print_subheader "Granting read, write and execute permissions to users" -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -print_subheader "Completed" - - -######################################### TO DO ########### - -# Infrastructure to Grabdish Application Bridge - -print_header "Initialing Infrastructure to Grabdish Application Bridge" -#update tnsnames.ora -print_subheader "Updating TNS ORA " -#sudo mkdir -p $TEMP_DIR -#sudo chown -R opc:opc $TEMP_DIR -#sudo chmod +rw $TEMP_DIR - -print_subheader "Updating TNSNAMES and Listener ORA Files" -#sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" -#sudo -u ${USER_NAME} bash -c "cd ${INFRA_HOME}/oci-iaas/grabdish-adapter/database/; ./update_tnsnames-ora.sh" -sudo -u ${USER_NAME} bash -c "${INFRA_HOME}/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh ${TNS_ADMIN_DIR}" - - -#No Need for TEMP DIR -- refactor code later -sudo -u ${USER_NAME} cp $TEMP_DIR/*.ora ${TNS_ADMIN_LOC}/. - -print_subheader "Opening Firewall Port for HTTP/S, SQLNET Traffic" -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --permanent --add-port=443/tcp -sudo firewall-cmd --permanent --add-port=80/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all -print_subheader "Firewall Port opened" - -print_header "Installing required infrastructure components" - -sudo chmod 666 /var/run/docker.sock - -print_subheader "Deleting previous installation of Minikube" -sudo su - ${USER_NAME} bash -c "minikube delete" - -print_subheader "Restarting Docker" -sudo systemctl restart docker - -print_subheader "Restarting Minikube cluster" -#sudo su - ${USER_NAME} bash -c "minikube start --driver=docker" # encountering issue with https docker reg -sudo su - ${USER_NAME} bash -c "minikube start --driver=none" - -print_subheader "Enabling Ingress on K8 Cluster" -sudo su - ${USER_NAME} bash -c "minikube addons enable ingress" - -print_subheader "Starting Docker Registry" -sudo su - ${USER_NAME} bash -c "docker container stop registry && docker container rm -v registry" -#sudo su - ${USER_NAME} bash -c "docker run -d -p 5000:5000 --restart=always --name registry registry:2" - -print_subheader "Granting writing privilges to user ${USER_NAME}" -sudo chown -R opc:opc $DOCKER_CERTS_DIR - -print_subheader "Creating SSL certificates for Docker Registry" -sudo su - ${USER_NAME} bash -c "openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${DOCKER_CERTS_DIR}/certs/domain.key -out ${DOCKER_CERTS_DIR}/certs/domain.crt -subj \"/CN=grabdish/O=grabdish\"" -#print_subheader "Created Docker Certificate" - -#sudo su - ${USER_NAME} bash -c "cd$ DOCKER_CERTS_DIR; $DOCKER_REG_CMD" # Docker Pull is failing -sudo su - ${USER_NAME} bash -c "docker run -d -p 5000:5000 --restart=always --name registry registry:2" - -print_header "Creating Secrets" -print_subheader "Creating namespace" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_ns_msdataworkshop.sh" -print_subheader "Creating Secret frontendpasswd" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_frontendpasswd.sh" -print_subheader "Creating Secret dbuser" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbpasswd.sh" -print_subheader "Creating Secret dbwallet" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbwallet.sh" -print_subheader "Creating Secret ssl-certificate-secret" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_ssl-certificate-secret.sh" -print_subheader "Completed" - -# These states are required for the Grabdish application build process to work -print_header "Creating States required for Grabdish Application" -print_subheader "These states are required for the Grabdish application build process to work" -sudo su - ${USER_NAME} bash -c "state_set_done OBJECT_STORE_BUCKET" -sudo su - ${USER_NAME} bash -c "state_set_done ORDER_DB_OCID" -sudo su - ${USER_NAME} bash -c "state_set_done INVENTORY_DB_OCID" -sudo su - ${USER_NAME} bash -c "state_set_done WALLET_GET" -sudo su - ${USER_NAME} bash -c "state_set_done CWALLET_SSO_OBJECT" -sudo su - ${USER_NAME} bash -c "state_set_done DB_PASSWORD" -sudo su - ${USER_NAME} bash -c "state_set ORDER_DB_NAME orders" -sudo su - ${USER_NAME} bash -c "state_set INVENTORY_DB_NAME inventory" -#sudo su - ${USER_NAME} bash -c "state_set DOCKER_REGISTRY localhost:443" -sudo su - ${USER_NAME} bash -c "state_set DOCKER_REGISTRY localhost:5000" -print_subheader "Completed" - - -lab1_start=$(date +%s) - -print_header "Building Lab 1" - -print_subheader "Creating Jaeger Microservice" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_service_jaeger.sh" -print_subheader "Started Jaeger Service" - - -print_subheader "Building frontend-helidon Microservice" -sudo su - ${USER_NAME} bash -c "cd ${APP_INSTALL_DIR}/grabdish/frontend-helidon;time ./build.sh > ${BUILD_LOG_FILE}-frontend-helidon.log;./deploy.sh " - -print_subheader "Completed" - -print_subheader "Creating Frontend Microservice" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml" -print_subheader "Completed" - -print_subheader "Creating Frontend Ingress" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml" -print_subheader "Completed" - -MICROSERVICES="order-helidon supplier-helidon-se inventory-helidon" - -print_subheader "Building ${MICROSERVICES}" - -for service_name in $MICROSERVICES; do - print_subheader "Creating Microservice ${service_name}" - sudo su - ${USER_NAME} bash -c "cd ${APP_INSTALL_DIR}/grabdish/${service_name}; time ./build.sh>> ${BUILD_LOG_FILE}-${service_name}.log;./deploy.sh " - print_subheader "${service_name} Completed" - done - -lab1_end=$(date +%s) - -print_subheader "Lab 1 Build took $((lab1_end - lab1_start)) seconds" - -end=$(date +%s) - -executionTime=$((end - start)) - - -print_header "Provisioning Completed at $(date)" -print_header "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. Took ${executionTime} seconds" - - -#sudo echo "${USAGE_INFO}" >${SSHD_BANNER_FILE} - - - diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database.sh b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database.sh deleted file mode 100644 index e3de1a867..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database.sh +++ /dev/null @@ -1,286 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -#APP_INSTALL_DIR=${USER_HOME}/microservices-datadriven -#INFRA_INSTALL_DIR=${USER_HOME}/microservices-datadriven-infra -#INFRA_HOME=${USER_HOME}/microservices-datadriven-infra - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_DIR=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -#ORACLE_HOME=/opt/oracle/product/21c/dbhome_1 # for Docker -ORACLE_HOME="/usr/lib/oracle/19.11/client64" # for Docker Host -- i.e. Compute - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# Starting Microservices Data-driven Infrastructure installation process at ${start} " | tee -a ${INSTALL_LOG_FILE} -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -echo "" | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# 1. Create Microservices Datadriven Infrastructure Configuration File." | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 -" - -print_header "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo bash -c "echo "${INSTALLATION_IN_PROGRESS}" >${SSHD_BANNER_FILE}" -sudo bash -c "echo "${USAGE_INFO}" >>${SSHD_BANNER_FILE}" -sudo bash -c "echo "Banner ${SSHD_BANNER_FILE}" >>${SSHD_CONFIG_FILE}" -print_subheader "SSHD Banner created" -sudo systemctl restart sshd.service | -print_subheader "Restarted SSHD Service" - - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating Microservices Datadriven Infrastructure" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Update Installation of Database is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -#Post Provisioning - -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all - - -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -sudo -u ${USER_NAME} echo $app_public_repo -sudo -u ${USER_NAME} echo $iaas_public_repo - - -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -sudo -u ${USER_NAME} echo "#################################### 1 ####################################" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 3 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export PATH=$ORACLE_HOME/bin:$PATH >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" - -sudo -u ${USER_NAME} echo "#################################### 4 ####################################" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 5 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 6 ####################################" -#update tnsnames.ora -sudo -u ${USER_NAME} bash -c "source ${USER_HOME}/.bashrc" -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -sudo -u ${USER_NAME} echo "#################################### 7 ####################################" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora - -sudo -u ${DBUSER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${DBUSER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" - -#use su - instead of sudo - u -sudo -u ${USER_NAME} echo "#################################### 8 ####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo "################################### 9 #####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc;source ${APP_INSTALL_DIR}/grabdish/env.sh;${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_setup.sh" - -sudo -u ${USER_NAME} echo "################################### 10 #####################################" - -end=`date +%s` - -executionTime=$((end-start)) - -echo "--------------------------------------------------------------" -echo "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} - -exec -l $SHELL \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database062121.sh b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database062121.sh deleted file mode 100644 index abefecc6a..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database062121.sh +++ /dev/null @@ -1,268 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -#APP_INSTALL_DIR=${USER_HOME}/microservices-datadriven -#INFRA_INSTALL_DIR=${USER_HOME}/microservices-datadriven-infra -#INFRA_HOME=${USER_HOME}/microservices-datadriven-infra - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - Microservices Datadriven Infrastructure is now available for usage - - For additional details regarding Microservices Datadriven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# Starting Microservices Data-driven Infrastructure installation process at ${start} " | tee -a ${INSTALL_LOG_FILE} -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -echo "" | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# 1. Create Microservices Datadriven Infrastructure Configuration File." | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating Microservices Datadriven Infrastructure" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Update Installation of Database is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -#Post Provisioning - -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all - - -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -sudo -u ${USER_NAME} echo $app_public_repo -sudo -u ${USER_NAME} echo $iaas_public_repo - - -whoami - -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -sudo -u ${USER_NAME} echo "#################################### 1 ####################################" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 3 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export PATH=$ORACLE_HOME/bin:$PATH >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" - -sudo -u ${USER_NAME} echo "#################################### 4 ####################################" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 5 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 6 ####################################" -#update tnsnames.ora -sudo -u ${USER_NAME} bash -c "source ${USER_HOME}/.bashrc" -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -sudo -u ${USER_NAME} echo "#################################### 7 ####################################" -sudo -u ${USER_NAME} $INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora - -sudo -u ${DBUSER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${DBUSER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" - -sudo -u ${USER_NAME} echo "#################################### 8 ####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - - -sudo -u ${USER_NAME} echo "################################### 9 #####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc;source ${APP_INSTALL_DIR}/grabdish/env.sh;${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_setup.sh" - -sudo -u ${USER_NAME} echo "################################### 10 #####################################" -end=`date +%s` - -executionTime=$((end-start)) - -echo "--------------------------------------------------------------" -echo "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} - -exec -l $SHELL \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database_docker.sh b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database_docker.sh deleted file mode 100644 index f47777fbb..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/bootstrap_database_docker.sh +++ /dev/null @@ -1,272 +0,0 @@ -#!/bin/bash - -# shellcheck disable=SC2218 - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -INSTALL_ROOT=${USER_HOME} -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven/infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven/infra -TNS_ADMIN_DIR=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -ORACLE_HOME=/opt/oracle/product/21c/dbhome_1 # for Docker -DB_PASSWORD="$(curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password')" - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage. - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - echo "# ${print_header_count}.: $1" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - echo "#${print_header_count}.${print_subheader_count}.: [INFO] $1" - return - } - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - - -# Sending all stdout and stderr to log file -exec > ${INSTALL_LOG_FILE} -exec 2>&1 - -print_header "Starting Microservices Data-driven Infrastructure installation process at $(date)" - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### - -print_header "Creating Microservices Datadriven Infrastructure Configuration File." -cat >${APP_CONFIG_FILE} <${SSHD_BANNER_FILE}" -sudo bash -c "echo "${USAGE_INFO}" >>${SSHD_BANNER_FILE}" -sudo bash -c "echo "Banner ${SSHD_BANNER_FILE}" >>${SSHD_CONFIG_FILE}" -print_subheader "SSHD Banner created" -sudo systemctl restart sshd.service | -print_subheader "Restarted SSHD Service" - - -####### Adding environment variables ######### - -print_header "Creating Environment Variables" -print_subheader "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo bash -c "echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc" - -#sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export TNS_ADMIN="${TNS_ADMIN_DIR}/" >> ${USER_HOME}/.bashrc - -print_subheader "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc -print_subheader "Completed." - -####### Adding environment variables - End ######### - -#Post Provisioning -print_header "Adding port 1521 to the firewall" -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload[] -sudo firewall-cmd --list-all -print_subheader "Completed." - -print_header "Downloading Microservices Infrastructure and Application from public repositories" -#sudo mkdir -p $APP_INSTALL_DIR -#sudo mkdir -p $INFRA_INSTALL_DIR -#sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') -iaas_app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_app_public_repo') - - -#print_subheader $app_public_repo -#print_subheader $iaas_public_repo -print_subheader "${iaas_app_public_repo}" - -#print_subheader "Downloading Infrastructure from $iaas_public_repo to $APP_INSTALL_DIR" -#sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -#print_subheader "Download Completed" - -#print_subheader "Downloading Application from $app_public_repo to $APP_INSTALL_DIR" -#sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -#print_subheader "Download Completed" - -#sudo chmod -R 755 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -print_subheader "Downloading Infrastructure and Application code from ${iaas_app_public_repo}" -sudo -u ${USER_NAME} bash -c "cd ${USER_HOME};${iaas_app_public_repo}" -#sudo chown -R opc:opc ${INSTALL_ROOT_DIR} -print_subheader "Downloaded Infrastructure and Application code" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -print_header "Updating Database tnsnames.ora, sqlnet.ora and listeners.ora files to match target database" - -#sudo mkdir -p $TEMP_DIR -#sudo chown -R opc:opc $TEMP_DIR -#sudo chmod +rw $TEMP_DIR - -print_subheader "Creating new tnsnames.ora, sqlnet.ora and listeners.ora file" -sudo -u ${USER_NAME} bash -c "${INFRA_HOME}/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh ${TNS_ADMIN_DIR}" -#sudo bash -c "${INFRA_HOME}/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - - -print_subheader "Copying tnsnames.ora" -sudo -u ${USER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${USER_NAME} cp ${TNS_ADMIN_DIR}/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora -#sudo -u ${USER_NAME} cp ${TEMP_DIR}/tnsnames.ora ${TNS_ADMIN_DIR}/. - -print_subheader "Copying listeners.ora" -sudo -u ${USER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${USER_NAME} cp $TNS_ADMIN_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora -#sudo -u ${USER_NAME} cp ${TEMP_DIR}/listeners.ora ${TNS_ADMIN_DIR}/. - -print_subheader "Copying sqlnet.ora" -sudo -u ${DBUSEUSER_NAMER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${USER_NAME} bash -c "cp ${TNS_ADMIN_DIR}/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" -#sudo -u ${USER_NAME} cp ${TEMP_DIR}/sqlnet.ora ${TNS_ADMIN_DIR}/. -print_subheader "Completed" - -#use su - instead of sudo - u -#print_subheader "#################################### 8 ####################################" -#sudo -u ${USER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - - - -#print_subheader "################################### 9 #####################################" -#sudo su - ${USER_NAME} bash -c "${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_docker_setup.sh" -# database is already pre-provisioned for the docker image - -print_header "Changing Database System and Grabdish Application Passwords." - -sudo su - $USER_NAME bash -c "docker exec microservice-database bash -c \"${DBUSER_HOME}/setPassword.sh ${DB_PASSWORD}\"" -print_subheader "Changed SYSTEM Password" - -#Adding this code to recreate Inventory and Orders PDBs -print_subheader "Creating Inventory and Orders PDBs" -sudo su - ${USER_NAME} bash -c "${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_docker_setup.sh" -print_subheader "Created Inventory and Orders PDBs" - -#changing Inventory and Orders PDBs password is not required; leaving code for now -sudo su - $USER_NAME bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/change_passwd_orders.sh" -print_subheader "Changed ORDER PDB Password" - -sudo su - $USER_NAME bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/change_passwd_inventory.sh" -print_subheader "Changed INVENTORY PDB Password" - -end=`date +%s` - -executionTime=$((end-start)) - -print_header "Installation of Oracle Microservices Infrastructure and Data-driven Application completed at $(date)" -print_subheader "It took ${executionTime} seconds" - -sudo bash -c "echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE}" diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/create_custom_image.sh b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/create_custom_image.sh deleted file mode 100644 index 0d00144dc..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/create_custom_image.sh +++ /dev/null @@ -1,35 +0,0 @@ -python36 -oci-ansible-collection -oci oci-cli -go-toolset -jdk-16.0.1.0.1.x86_64 -git -gnupg2 curl tar -ruby -nodejs:14 -node-oracledb-node14 -oci-dotnet-sdk -maven -libnsl -instantclient19.11-basic -instantclient19.11-sqlplus -instantclient19.11-tools -graalvm -Docker -Docker Registry -Minikube -Ingress Controller - - - -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-basic-19.11.0.0.0-1.x86_64.rpm -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-sqlplus-19.11.0.0.0-1.x86_64.rpm -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-tools-19.11.0.0.0-1.x86_64.rpm - -curl -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-aarch64-20.2.0.tar.gz | tar xz -~/graalvm-ce-java11-20.2.0/bin/gu install native-image - -curl -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-22.0.1/graalvm-community-jdk-22.0.1_linux-x64_bin.tar.gz | tar xz -~/graalvm-community-jdk-22.0.1/bin/gu install native-image - -#kubcetl, minikube, docker, docker registry diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/temp.sh b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/temp.sh deleted file mode 100644 index 3fe1254c8..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/scripts/temp.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -BUILD_LOG_FILE=${USER_HOME}/${APP_NAME}-build - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_LOC=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN -DOCKER_CERTS_DIR=${INFRA_INSTALL_DIR}/oci-iaas/grabdish-adapter/infrastructure - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 - - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" -DOCKER_REG_CMD="docker run -d \ - --restart=always \ - --name registry \ - -v "$DOCKER_CERTS_DIR"/certs:/certs \ - -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - -p 443:443 \ - registry:2" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - echo "# ${print_header_count}.: $1" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - echo "#${print_header_count}.${print_subheader_count}.: [INFO] $1" - return - } - - -# Sending all stdout and stderr to log file -exec >>${INSTALL_LOG_FILE} -exec 2>&1 - -start=$(date +%s) - -# Log file - -print_header "Building Lab 1" - -print_subheader "Creating Jaeger Microservice" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_service_jaeger.sh" -print_subheader "Started Jaeger Service" - - -print_subheader "Building frontend-helidon Microservice" -sudo su - ${USER_NAME} bash -c "cd ${GRABDISH_HOME}/frontend-helidon;time ./build.sh > ${BUILD_LOG_FILE}-frontend-helidon.log;./deploy.sh " - -print_subheader "Completed" - -print_subheader "Creating Frontend Microservice" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml" -print_subheader "Completed" - -print_subheader "Creating Frontend Ingress" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml" -print_subheader "Completed" - -MICROSERVICES="order-helidon supplier-helidon-se inventory-helidon" - -print_subheader "Building ${MICROSERVICES}" - -for service_name in $MICROSERVICES; do - print_subheader "Creating Microservice ${service_name}" - sudo su - ${USER_NAME} bash -c "cd ${GRABDISH_HOME}/${service_name}; time ./build.sh>> ${BUILD_LOG_FILE}-${service_name}.log;./deploy.sh " - print_subheader "${service_name} Completed" - done - - -end=$(date +%s) - -executionTime=$((end - start)) - - -print_header "Provisioning Completed" -print_subheader "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" -print_subheader "" - - - - diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/variables.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/variables.tf deleted file mode 100644 index d2cf58f60..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/compute/variables.tf +++ /dev/null @@ -1,92 +0,0 @@ -variable "tenancy_ocid" {} -variable "region" {} - -variable "target_compartment_id" { - description = "OCID of the compartment where the compute is being created" - type = string -} - -variable "vcn_id" { - description = "VCN OCID where the instance is going to be created" - type = string -} - -variable "subnet_id" { - description = "Subnet OCID where the instance is going to be created" - type = string -} - -variable "image_os" { - default = "Oracle Linux" -} - -variable "image_os_version" { - default = "8" -} - -variable "instance_shape" { - description = "Shape of the instance" - type = string -} - -variable "generate_ssh_key_pair" { - description = "Auto-generate SSH key pair" - type = string -} - -variable "ssh_public_key" { - description = "ssh public key used to connect to the compute instance" - type = string -} - -variable "use_tenancy_level_policy" { - description = "Compute instance to access all resources at tenancy level" - type = bool -} - -variable "common_tags" { - description = "Tags" - type = map(string) -} - -variable "generate_app_db_passwords" { - description = "Auto-generate Grabdish Application and Database Passwords" - type = string -} - -variable "grabdish_database_password" { - description = "grabdish_database_password" - type = string -} - -variable "grabdish_application_password" { - description = "grabdish_application_password" - type = string -} - -/* -variable "iaas_public_repo" { - description = "Repository URI to execute post provisioning infrastructure setup scripts" - type = string - #default = "" -} - -variable "app_public_repo" { - description = "Repository URI to execute post provisioning Application setup scripts" - type = string - #default = "" -} -*/ -variable "dbaas_FQDN" { - description = "dbaas_FQDN" - type = string -} - - -variable "iaas_app_public_repo" { - description = "Repository URI to execute infrastructure and application setup scripts" - type = string - default = "git clone -b main --single-branch https://github.com/vishalmmehra/microservices-datadriven" - #default = "" -} - diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/main.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/main.tf deleted file mode 100644 index 7941e4d7b..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/main.tf +++ /dev/null @@ -1,65 +0,0 @@ -locals { - compartment_id = var.target_compartment_id - display_name = "microservices" - vcn_dns_label = "onpremise" - vcn_cidr_block = "10.0.0.0/16" - subnet_cidr_block = "10.0.1.0/24" - all_cidr = "0.0.0.0/0" - vcn_id = oci_core_vcn.this.id -} - -# VCN -resource "oci_core_vcn" "this" { - compartment_id = local.compartment_id - cidr_block = local.vcn_cidr_block - display_name = "${local.display_name}-vcn" - dns_label = local.vcn_dns_label - freeform_tags = var.common_tags -} - -# internet gateway to connect to compute instance - internet gateway is for the VCN - -resource "oci_core_internet_gateway" "ig" { - # count = local.use_existing_vcn ? 0 : 1 - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-internet-gateway" # Optional - freeform_tags = var.common_tags -} - -resource "oci_core_route_table" "rt" { #TODO - change the name to "rt" instead of "subnet" - # count = local.use_existing_vcn ? 0 : 1 - compartment_id = local.compartment_id - vcn_id = local.vcn_id - display_name = "${local.display_name}-route-table" - - route_rules { - destination = local.all_cidr - destination_type = "CIDR_BLOCK" - network_entity_id = oci_core_internet_gateway.ig.id - } - - freeform_tags = var.common_tags -} - -resource "oci_core_security_list" "sl" { - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-security-list" # Optional - freeform_tags = var.common_tags - - # Intentionally left ingress and egress rules blank. Expected to set the NSG at the instance level -} - -#subnet -resource "oci_core_subnet" "regional_sn" { - cidr_block = local.subnet_cidr_block # Required - compartment_id = var.target_compartment_id # Required - vcn_id = local.vcn_id # Required - route_table_id = oci_core_route_table.rt.id # Optional - But Required in this case to associate the above created Route table - security_list_ids = [oci_core_security_list.sl.id] # Optional - defined a security list that has NO ingress and egress rules - display_name = "${local.display_name}-subnet" # Optional - freeform_tags = var.common_tags - dns_label = local.display_name - //prohibit_public_ip_on_vnic = false -} diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/outputs.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/outputs.tf deleted file mode 100644 index 6b44c72c8..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/outputs.tf +++ /dev/null @@ -1,11 +0,0 @@ -output "vcn" { - value = oci_core_vcn.this -} - -output "subnet" { - value = oci_core_subnet.regional_sn -} - -output "subnet_domain_name" { - value = oci_core_subnet.regional_sn.subnet_domain_name -} diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/variables.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/variables.tf deleted file mode 100644 index 49a404bf9..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/modules/network/variables.tf +++ /dev/null @@ -1,9 +0,0 @@ -variable "target_compartment_id" { - description = "OCID of the compartment where the VCN is being created" - type = string -} - -variable "common_tags" { - description = "Tags" - type = map(string) -} \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/outputs.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/outputs.tf deleted file mode 100644 index 39792fc84..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/outputs.tf +++ /dev/null @@ -1,64 +0,0 @@ -locals { - app_password = var.generate_app_db_passwords ? random_string.grabdish_application_password.result : var.grabdish_application_password -} -output "compute_instance_public_ip" { - value = module.compute.instance.public_ip -} - -output "compartment_id" { - value = var.compartment_ocid -} - -output "generated_instance_ssh_private_key" { - value = var.generate_ssh_key_pair ? module.compute.instance_keys.private_key_pem : "" - sensitive = true -} - -output "dbaas_public_ip" { - value = module.compute.dbaas_public_ip -} - -output "dbaas_private_ip" { - value = module.compute.dbaas_private_ip -} - -output "FQDN_database_SN" { - value = module.network.subnet -} - -output "dbaas_FQDN" { - value = join(".", [module.compute.dbaas_display_name,module.network.subnet_domain_name]) -} - -output "Database_Password"{ - value = var.generate_app_db_passwords ? random_string.grabdish_database_password.result : var.grabdish_database_password -} - -output "Grabdish_Application_Password"{ - value = local.app_password -} - -output "Login_Instructions" { - #type = URL - value = "Login to http://${module.compute.instance.public_ip} using username: grabdish password: ${local.app_password} " -} - -/* -output "dbaas_password"{ - value = var.grabdish_database_password -} - -output "app_password"{ - value = var.grabdish_application_password -} -*/ -/* -output "Database_Password"{ - value = module.compute.Grabdish_Application_Password -} - -output "Grabdish_Application_Password"{ - value = module.compute.On_Premise_Database_Password -} - -*/ \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/provider.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/provider.tf deleted file mode 100644 index 569565755..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/provider.tf +++ /dev/null @@ -1,10 +0,0 @@ -provider "oci" { - tenancy_ocid = var.tenancy_ocid - region = var.region -} - -provider "tls" { - -} - - diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/schema.yaml b/infra/oci-iaas/resource_manager/multi-node-deployment/schema.yaml deleted file mode 100644 index df45706e6..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/schema.yaml +++ /dev/null @@ -1,193 +0,0 @@ -title: Grabdish - Microservices Data-driven application on Oracle Converged Database -description: Grabdish - Microservices Data-driven application on Oracle Converged Database -stackDescription: Grabdish - Microservices Data-driven application on Oracle Converged Database -informationalText: Grabdish - Microservices Data-driven application on Oracle Converged Database -schemaVersion: 1.1.0 -version: "20200822" -locale: "en" - -variableGroups: - - title: General Configuration - visible: false - variables: - - compartment_ocid - - tenancy_ocid - - region - - - title: Required Configuration for Microservices Datadriven Application Grabdish - visible: true - variables: - - instance_shape - - generate_ssh_key_pair - - ssh_public_key - - generate_app_db_passwords - - grabdish_application_password - - grabdish_database_password - - use_tenancy_level_policy - #- iaas_public_repo - #- app_public_repo - - iaas_app_public_repo - -variables: - # General Configuration - tenancy_ocid: - title: Tenancy ID - description: The Oracle Cloud Identifier (OCID) for your tenancy - type: string - required: true - visible: false - - region: - title: Region To Provision the Compute and Database Resources - description: Region To Provision the Compute and Database Resources - type: oci:identity:region:name - required: true - visible: false - - compartment_ocid: - title: Compartment OCID - description: Compartment OCID - type: oci:identity:compartment:id - required: true - visibile: false - - # Required - instance_shape: - title: Instance Shape - description: Instance Shape - type: oci:core:instanceshape:name - default: VM.Standard.E2.1.Micro - required: true - dependsOn: - compartmentId: ${compartment_ocid} - - generate_ssh_key_pair: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.generate_ssh_key_pair.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.generate_ssh_key_pair.description()} - type: boolean - default: true - required: true - - generate_app_db_passwords: - title: Auto-generate Grabdish Application and Database Passwords - description: Automatically generate Grabdish Application and Database Passwords - type: boolean - default: true - required: true - - ssh_public_key: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.ssh_public_key.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.ssh_public_key.description()} - type: oci:core:ssh:publickey - required: false - additionalProps: - allowMultiple: true - pattern: "((^(ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)(,((ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)*$" - visible: - not: - - generate_ssh_key_pair - - use_tenancy_level_policy: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.use_tenancy_level_policy.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.use_tenancy_level_policy.description()} - type: boolean - default: true - required: true - - grabdish_database_password: - description: Provide database password. it will be used for creating admin, order_user, inventory_user for Order and Inventory PDBs. (Must be a minimum 12 characters, contain at least one uppercase letter, one lowercase letter, one number , no special characters allowed). This password will be made available to you as an output variable. - type: password - minLength: 12 - maxLength: 30 - pattern: ^[A-Za-z][A-Za-z0-9]+$ - required: true - #default: OraDB4U12345 - visible: - not: - - generate_app_db_passwords - - grabdish_application_password: - description: Provide database password. it will be used for admin, wallet and application , cannot have the word "usage" in the passowrd, (Must be a minimum 12 characters, contain at least one uppercase letter, one lowercase letter, one number , no special characters allowed). - type: password - minLength: 12 - maxLength: 30 - pattern: ^[A-Za-z][A-Za-z0-9]+$ - required: true - #default: Welcome12345 - visible: - not: - - generate_app_db_passwords - - #iaas_public_repo: - # title: Post Provisioning Infrastructure Setup URL - # description: Repository URI to execute post provisioning infrastructure scripts - # type: String - # #minLength: 12 - # #maxLength: 30 - # pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - # required: true - # #default: Welcome12345 - - #app_public_repo: - # title: Post Provisioning Application Setup URL - # description: Repository URI to execute post provisioning application scripts - # type: String - # #minLength: 12 - # #maxLength: 30 - # pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - # required: true - # #default: Welcome12345 - - iaas_app_public_repo: - title: Infrastructure and Application Setup URL - description: Repository URI to execute Infrastructure and Application provisioning scripts - type: String - #minLength: 12 - #maxLength: 30 - pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - required: true - #default: Welcome12345 - -outputGroups: - - title: outputGroups - outputs: - - compute_instance_public_ip - - compartment_id - - generated_instance_ssh_private_key - - title: On Premise Database details - outputs: - - dbaas_instance_public_ip - - generated_instance_ssh_private_key - -outputs: - compute_instance_public_ip: - title: compute_instance_public_ip - displayText: compute_instance_public_ip - type: copyableString - visible: true - - compartment_id: - title: compartment_id - displayText: compartment_id - type: string - visible: true - - generated_instance_ssh_private_key: - title: generated_instance_ssh_private_key - displayText: generated_instance_ssh_private_key - type: string - visible: true - - dbaas_instance_public_ip: - title: Database Public IP Address - displayText: module.compute.dbaas_public_ip - type: copyableString - visible: true - - Login_Instructions: - title: Login Instruction to the Application Compute Instance - displayText: Login_Instructions - type: copyableString - visible: true - - diff --git a/infra/oci-iaas/resource_manager/multi-node-deployment/variables.tf b/infra/oci-iaas/resource_manager/multi-node-deployment/variables.tf deleted file mode 100644 index cb966f1ad..000000000 --- a/infra/oci-iaas/resource_manager/multi-node-deployment/variables.tf +++ /dev/null @@ -1,91 +0,0 @@ -variable "tenancy_ocid" {} -variable "region" {} -variable "compartment_ocid" {} - -/* -resource "random_password" "onprem_dbaas_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} - -resource "random_password" "onprem_application_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} -*/ - - -variable "instance_shape" { - description = "Shape of the instance" - type = string -} - -variable "generate_ssh_key_pair" { - description = "Auto-generate SSH key pair" - type = string -} - -variable "ssh_public_key" { - description = "ssh public key used to connect to the compute instance" - default = "" # This value has to be defaulted to blank, otherwise terraform apply would request for one. - type = string - sensitive = true -} - -variable "use_tenancy_level_policy" { - description = "Compute instance to access all resources at tenancy level" - type = bool -} - -variable "generate_app_db_passwords" { - description = "Automatically generate Grabdish Application and Database Passwords" - type = string -} - -variable "grabdish_database_password" { - description = "grabdish_database_password" - type = string - default = "OraDB4U13579" - -} - -variable "grabdish_application_password" { - description = "grabdish_application_password" - type = string - default = "Welcome12345" - -} -/* -variable "iaas_public_repo" { - description = "Repository URI to execute post provisioning infrastructure setup scripts" - type = string - default = "git clone -b master --single-branch https://github.com/vishalmmehra/microservices-datadriven-infra/" - #default = "" -} - -variable "app_public_repo" { - description = "Repository URI to execute post provisioning Application setup scripts" - type = string - default = "git clone -b 21.6.1 --single-branch https://github.com/oracle/microservices-datadriven.git" - #default = "" -} -*/ - -variable "iaas_app_public_repo" { - description = "Repository URI to execute infrastructure and application setup scripts" - type = string - default = "git clone -b main --single-branch https://github.com/vishalmmehra/microservices-datadriven" - #default = "" -} - - diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/license.txt b/infra/oci-iaas/resource_manager/multnodes-deployment/license.txt deleted file mode 100644 index fa0264737..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/license.txt +++ /dev/null @@ -1,30 +0,0 @@ - - - Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - - The Universal Permissive License (UPL), Version 1.0 - - Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this - software, associated documentation and/or data (collectively the "Software"), free of charge and under any and - all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor - hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or - (ii) the Larger Works (as defined below), to deal in both - - (a) the Software, and - (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software - (each a “Larger Work” to which the Software is contributed by such licensors), - - without restriction, including without limitation the rights to copy, create derivative works of, display, - perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have - sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms. - - This license is subject to the following condition: - The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must - be included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/main.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/main.tf deleted file mode 100644 index b5900c6e7..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/main.tf +++ /dev/null @@ -1,53 +0,0 @@ -locals { - common_tags = { - Reference = "on-prem-micro-svc" - } -} - -resource "random_string" "grabdish_database_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 0 - override_special = "^[A-Za-z][A-Za-z0-9]+$" -} - -resource "random_string" "grabdish_application_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} - -module "network" { - source = "./modules/network" - target_compartment_id = var.compartment_ocid - common_tags = local.common_tags - #display_name_prefix = var.new_network_prefix - # dns_label = var.new_network_prefix -} - -module "compute" { - source = "./modules/compute" - region = var.region - tenancy_ocid = var.tenancy_ocid - target_compartment_id = var.compartment_ocid - vcn_id = module.network.vcn.id - subnet_id = module.network.subnet.id - instance_shape = var.instance_shape - generate_ssh_key_pair = var.generate_ssh_key_pair - ssh_public_key = var.ssh_public_key - generate_app_db_passwords = var.generate_app_db_passwords - use_tenancy_level_policy = var.use_tenancy_level_policy - common_tags = local.common_tags - grabdish_database_password = var.generate_app_db_passwords ? random_string.grabdish_database_password.result : var.grabdish_database_password - grabdish_application_password = var.generate_app_db_passwords ? random_string.grabdish_application_password.result : var.grabdish_application_password - iaas_public_repo = var.iaas_public_repo - app_public_repo = var.app_public_repo - dbaas_FQDN = join(".", [module.compute.dbaas_display_name,module.network.subnet_domain_name]) -} \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/main.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/main.tf deleted file mode 100644 index 891366d06..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/main.tf +++ /dev/null @@ -1,278 +0,0 @@ -locals { - compartment_id = var.target_compartment_id - vcn_id = var.vcn_id - all_cidr = "0.0.0.0/0" - current_time = formatdate("YYYYMMDDhhmmss", timestamp()) - app_name = "grabdish-microsvc" - app_compute_instance1_name = "grabdish-compute1" - app_db_instance1_name = "grabdish-database1" - display_name = join("-", [local.app_name, local.current_time]) - compartment_name = data.oci_identity_compartment.this.name - grabdish_app_password = var.grabdish_application_password - grabdish_db_password = var.grabdish_database_password - dynamic_group_tenancy_level = "Allow dynamic-group ${oci_identity_dynamic_group.for_instance.name} to manage all-resources in tenancy" - dynamic_group_compartment_level = "Allow dynamic-group ${oci_identity_dynamic_group.for_instance.name} to manage all-resources in compartment ${local.compartment_name}" - num_of_ads = length(data.oci_identity_availability_domains.ads.availability_domains) - ads = local.num_of_ads > 1 ? flatten([ - for ad_shapes in data.oci_core_shapes.this : [ - for shape in ad_shapes.shapes : ad_shapes.availability_domain if shape.name == var.instance_shape - ] - ]) : [for ad in data.oci_identity_availability_domains.ads.availability_domains : ad.name] -} - - -resource "oci_core_network_security_group" "nsg" { - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-security-group" # Optional - freeform_tags = var.common_tags -} - -resource "oci_core_network_security_group_security_rule" "ingress_ssh" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "22" # Required - min = "22" # Required - } - } - description = "ssh only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_https" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "443" # Required - min = "443" # Required - } - } - description = "https only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_http" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "80" # Required - min = "80" # Required - } - } - description = "http only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_sqlnet" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "1521" # Required - min = "1521" # Required - } - } - description = "sqlnet 1521 only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_icmp_3_4" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "1" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - icmp_options { # Optional - type = "3" # Required - code = "4" # Required - } - description = "icmp option 1" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_icmp_3" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "1" # Required - source = "10.0.0.0/16" # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - icmp_options { # Optional - type = "3" # Required - } - description = "icmp option 2" # Optional -} - -resource "oci_core_network_security_group_security_rule" "egress" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "EGRESS" # Required - protocol = "6" # Required - destination = local.all_cidr # Required - destination_type = "CIDR_BLOCK" # Required - stateless = false # Optional - description = "connect to any network" -} - -# Get a list of Availability Domains -data "oci_identity_availability_domains" "ads" { - compartment_id = var.tenancy_ocid -} - -data "oci_core_images" "this" { - compartment_id = local.compartment_id # Required - operating_system = var.image_os # Optional - operating_system_version = var.image_os_version # Optional - shape = var.instance_shape # Optional - sort_by = "TIMECREATED" # Optional - sort_order = "DESC" # Optional -} - -data "oci_core_shapes" "this" { - count = local.num_of_ads > 1 ? local.num_of_ads : 0 - #Required - compartment_id = local.compartment_id - - #Optional - availability_domain = data.oci_identity_availability_domains.ads.availability_domains[count.index].name - image_id = data.oci_core_images.this.images[0].id -} - -data "oci_identity_compartment" "this" { - id = local.compartment_id -} - -# Generate the private and public key pair -resource "tls_private_key" "ssh_keypair" { - algorithm = "RSA" # Required - rsa_bits = 2048 # Optional -} - -resource "oci_identity_dynamic_group" "for_instance" { - compartment_id = var.tenancy_ocid - description = "To Access OCI CLI" - name = "${local.display_name}-dynamic-group" - matching_rule = "ANY {instance.id = '${oci_core_instance.compute_instance1.id}'}" - freeform_tags = var.common_tags -} - -resource "oci_identity_policy" "dg_manage_all" { - compartment_id = var.use_tenancy_level_policy ? var.tenancy_ocid : local.compartment_id - description = "To Access OCI CLI" - name = "${local.display_name}-instance-policy" - statements = var.use_tenancy_level_policy ? [local.dynamic_group_tenancy_level] : [local.dynamic_group_compartment_level] - freeform_tags = var.common_tags -} - -resource "oci_core_instance" "dbaas_instance1" { - availability_domain = local.ads[0] - compartment_id = local.compartment_id - shape = var.instance_shape - preserve_boot_volume = false - freeform_tags = var.common_tags - display_name = local.app_db_instance1_name - - create_vnic_details { - subnet_id = var.subnet_id - assign_public_ip = true - nsg_ids = [ - oci_core_network_security_group.nsg.id] - } - - source_details { - source_type = "image" - #source_id = data.oci_core_images.this.images[0].id - #source_id = "ocid1.image.oc1.iad.aaaaaaaaudkqtvbfo4mm3qyhqdrpqcatijjmml2z7ddal7hojhb2gcv34kaq" # Custom Compute - #source_id = "ocid1.image.oc1..aaaaaaaa7cr4xiwx6mbdrgfbppdypdtzyxothft2sjqftygtpxnulqmk6tla" # Platform Image - #source_id = "ocid1.appcataloglisting.oc1..aaaaaaaan5rb524w7axx36ukn42l7fwzyzm3kodad7x5hxyeyz4nyy3yefgq" # Marketplace Image - #source_id ="ocid1.image.oc1..aaaaaaaamotrq5ou4qjsnzw5sv7w2nbwvhhp4kjmazlxf23ozcsd66t3pw5q" #LiveLabs Converged DB - source_id ="ocid1.image.oc1.iad.aaaaaaaajv4k3wrfdrxwapmewcw37oxsroms3f7hmrk2mc7hepweiy3cbtja" #docker-db-21c-prega - - # DB-Base Image - } - - metadata = { - ssh_authorized_keys = var.generate_ssh_key_pair ? tls_private_key.ssh_keypair.public_key_openssh : var.ssh_public_key - user_data = base64encode(file("./modules/compute/scripts/bootstrap_database_docker.sh")) - tenancy_id = var.tenancy_ocid - grabdish_application_password = var.grabdish_application_password - grabdish_database_password = var.grabdish_database_password - app_public_repo = var.app_public_repo - iaas_public_repo = var.iaas_public_repo - #dbaas_FQDN = var.dbaas_FQDN - target_compartment_id =var.target_compartment_id - vcn_id = var.vcn_id - subnet_id = var.subnet_id - image_os = var.image_os - image_os_version = var.image_os_version - instance_shape = var.instance_shape - - } -} - -resource "oci_core_instance" "compute_instance1" { - availability_domain = local.ads[0] - compartment_id = local.compartment_id - shape = var.instance_shape - preserve_boot_volume = false - freeform_tags = var.common_tags - display_name = local.app_compute_instance1_name - - - create_vnic_details { - subnet_id = var.subnet_id - assign_public_ip = true - nsg_ids = [oci_core_network_security_group.nsg.id] - } - - source_details { - source_type = "image" - #source_id = data.oci_core_images.this.images[0].id - #source_id = "ocid1.image.oc1.iad.aaaaaaaaudkqtvbfo4mm3qyhqdrpqcatijjmml2z7ddal7hojhb2gcv34kaq" # Custom Compute - #source_id = "ocid1.image.oc1..aaaaaaaa7cr4xiwx6mbdrgfbppdypdtzyxothft2sjqftygtpxnulqmk6tla" # DB-Base Image - #source_id ="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" # microservices-2-cm - #source_id="ocid1.image.oc1.phx.aaaaaaaaw6pi7tnx2pvqgzi2lgpsicjj5cl46a3llrk6nghgbthve7f72v6a" #microservices-phx-1 - - #source_id="ocid1.image.oc1.iad.aaaaaaaa643d766gxmmzk7gul6557hnp53ul3wieu4al3qjpaiklk3mom2ba" #microservices-ash-1-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" #microservices-2-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaafwnzt3vu4ebfvrhsilrqv7i2ykv2osdmf42rjtq72nxi5qldt6ua" #microservices-ash-2-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" #microservices-2-cm - source_id = "ocid1.image.oc1.iad.aaaaaaaaobsqoqegphdipcwrmt4ji6r4ukjirxvzlc7dzvto66beijmo4exa" - - - } - metadata = { - ssh_authorized_keys = var.generate_ssh_key_pair ? tls_private_key.ssh_keypair.public_key_openssh : var.ssh_public_key - user_data = base64encode(file("./modules/compute/scripts/bootstrap_compute.sh")) - tenancy_id = var.tenancy_ocid - grabdish_application_password = var.grabdish_application_password - grabdish_database_password = var.grabdish_database_password - app_public_repo = var.app_public_repo - iaas_public_repo = var.iaas_public_repo - dbaas_FQDN = var.dbaas_FQDN - target_compartment_id =var.target_compartment_id - vcn_id = var.vcn_id - subnet_id = var.subnet_id - image_os = var.image_os - image_os_version = var.image_os_version - instance_shape = var.instance_shape - } -} - - - diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/outputs.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/outputs.tf deleted file mode 100644 index c00cf6b37..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/outputs.tf +++ /dev/null @@ -1,23 +0,0 @@ -output "instance" { - value = oci_core_instance.compute_instance1 -} - -output "instance_keys" { - value = tls_private_key.ssh_keypair -} - -output "dbaas_public_ip" { - value = oci_core_instance.dbaas_instance1.public_ip -} - -output "dbaas_private_ip" { - value = oci_core_instance.dbaas_instance1.private_ip -} - -output "dbaas_compute_id" { - value = oci_core_instance.dbaas_instance1.id -} - -output "dbaas_display_name" { - value = oci_core_instance.dbaas_instance1.display_name -} diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstap06.17.21.sh b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstap06.17.21.sh deleted file mode 100644 index 9dbe198d3..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstap06.17.21.sh +++ /dev/null @@ -1,427 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -APP_NAME=oci-grabdish -DEV_TOOLS_HOME=${USER_HOME}/${APP_NAME} -APP_CONFIG_FILE_NAME=config-${APP_NAME}.json -INSTALL_LOG_FILE_NAME=install-${APP_NAME}.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # OCI Development Kit Installation is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - OCI DEV KIT Usage - =================== - This instance has OCI Dev Kit such as CLI, Terraform, Ansible, SDKs (Java, Python3.6, Go, Dotnet, Ruby, Typescript) - - To update OCI Dev Kit to the latest version, run the following command: ${UPDATE_SCRIPT_FILE} - - You could use Instance Principal authentication to use the dev tools. - - For running CLI, type the following to get more help: oci --help - ================================================================================================= -" - -start=`date +%s` - -# create a configuration file - -# Config file -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >.${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Installing OCI Dev Kit" -echo "------------------------" - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Installing yum packages ######### - -echo "Packages to install ${PACKAGES_TO_INSTALL[@]}" - -sudo yum-config-manager --enable ol7_developer ol7_developer_EPEL && echo "#################### Successfully installed ol7_developer yum packages #####################" - -echo "Manually Disabling MYSQL" -sudo yum --disablerepo=ol7_MySQL80 update - -sudo yum -y install ${PACKAGES_TO_INSTALL[@]} && echo "#################### Successfully installed all yum packages #####################" - -sudo yum -y install --enablerepo=ol7_developer_nodejs10 --enablerepo=ol7_developer oci-typescript-sdk && echo "#################### Successfully installed typescript #####################" - -####### Installing yum packages -End ######### - -####### Adding OCI Modules to Powershell ######### - -sudo -u ${USER_NAME} pwsh -c Register-PSRepository -Name LocalRepository -SourceLocation /usr/lib/dotnet/NuPkgs -InstallationPolicy Trusted -sudo -u ${USER_NAME} pwsh -c "Set-Variable -Name ProgressPreference -Value SilentlyContinue; Install-Module OCI.PSModules -Repository LocalRepository" -sudo -u ${USER_NAME} pwsh -c Uninstall-Module OCI.PSModules -sudo -u ${USER_NAME} pwsh -c Unregister-PSRepository -Name LocalRepository - -####### Adding OCI Modules to Powershell -End ######### - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so ansible can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_ANSIBLE_AUTH_TYPE=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so powershell can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_PS_AUTH="InstancePrincipal"' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo 'export GOPATH=/usr/share/gocode' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci jars are in the classpath" -JAVASDK_VERSION=$(yum list java-oci-sdk | grep -o "[0-9].[0-9]\+.[0-9]\+" | head -1) -sudo -u ${USER_NAME} echo "export CLASSPATH=/usr/lib64/java-oci-sdk/lib/oci-java-sdk-full-${JAVASDK_VERSION}.jar:/usr/lib64/java-oci-sdk/third-party/lib/*" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so ruby collections are properly set" -sudo -u ${USER_NAME} echo "source scl_source enable rh-ruby27" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export GEM_PATH=/usr/share/gems:'gem env gempath'" >> ${USER_HOME}/.bashrc -echo "Adding environment variable so dotnet collections are properly set" -sudo -u ${USER_NAME} echo "source scl_source enable rh-dotnet31" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -echo "Adding environment variable for SDK analytics" -sudo -u ${USER_NAME} echo 'export OCI_SDK_APPEND_USER_AGENT=Oracle-ORMDevTools' >> ${USER_HOME}/.bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating OCI Dev Kit" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Updating OCI Dev Kit is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} < ${SSHD_BANNER_FILE} - -exec -l $SHELL - - -curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password_password')", - "grabdish_database_password": "$($CURL_METADATA_COMMAND | jq --raw-output '.grabdish_database_passwor - - - -# 344 minikube delete -# 345 minikube start --driver=none -# 346 docker container stop registry -# 347 docker container rm registry -# 348 docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -#docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2 -#docker container stop registry -#docker container rm registry - - - -# 344 minikube delete -# 345 minikube start --driver=none -# 346 docker container stop registry -# 347 docker container rm registry -# 348 docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -#docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2 -#docker container stop registry -#docker container rm registry - - - -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_ns_msdataworkshop.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_frontendpasswd.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbpasswd.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbwallet.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_ssl-certificate-secret.sh - - -docker run --name microservice-database3 -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:RDBMS_21.3.0.0.0_LINUX.X64_210709 - - - -System parameter file is /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora -Log messages written to /opt/oracle/diag/tnslsnr/ffa6a4004a14/listener/alert/log.xml -Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) -Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) - -Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) -STATUS of the LISTENER ------------------------- -Alias LISTENER -Version TNSLSNR for Linux: Version 21.0.0.0.0 - Production -Start Date 06-AUG-2021 19:20:14 -Uptime 0 days 0 hr. 0 min. 0 sec -Trace Level off -Security ON: Local OS Authentication -SNMP OFF -Listener Parameter File /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora -Listener Log File /opt/oracle/diag/tnslsnr/ffa6a4004a14/listener/alert/log.xml -Listening Endpoints Summary... - (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) - (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) -The listener supports no services -The command completed successfully - - - -docker run --name [container name] --p [host port]:1521 -p :5500 --e ORACLE_SID=[your SID] --e ORACLE_PDB=[your PDB name] --e ORACLE_PWD=[your database passwords] --e INIT_SGA_SIZE=[your database SGA memory in MB] --e INIT_PGA_SIZE=[your database PGA memory in MB] --e ORACLE_EDITION=[your database edition] --e ORACLE_CHARACTERSET=[your character set] --v [host mount point:]/opt/oracle/oradata -dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:17754 - -Parameters: - --name: The name of the container (default: auto generated) - -p: The port mapping of the host port to the container port. - Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express) - -e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB) - -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1) - -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated) - -e INIT_SGA_SIZE: - The total memory in MB that should be used for all SGA components (optional). - -e INIT_PGA_SIZE: - The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional). - -e ORACLE_EDITION: - The Oracle Database Edition (enterprise/standard). - -e ORACLE_CHARACTERSET: - The character set to use when creating the database (default: AL32UTF8) - -v /opt/oracle/oradata - The data volume to use for the database. - Has to be writable by the Unix "oracle" (uid: 54321) user inside the container! - If omitted the database will not be persisted over container recreation. - -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup - Optional: A volume with custom scripts to be run after database startup. - -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup - Optional: A volume with custom scripts to be run after database setup. - - -docker run --name db-19300-docker -p 1 - - -docker run --name microservice-database -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:17754 - -docker run --name microservice-database -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata container-registry.oracle.com/database/enterprise:latest - - - -[oracle@grabdish_docker-db1 /]$ cp ~/tnsnames.ora /opt/oracle/oradata/dbconfig/ORCL/tnsnames.ora -[oracle@grabdish_docker-db1 /]$ cp ~/tnsnames.ora /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_compute.sh b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_compute.sh deleted file mode 100644 index 9cae13bac..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_compute.sh +++ /dev/null @@ -1,339 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -BUILD_LOG_FILE=${USER_HOME}/${APP_NAME}-build - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_LOC=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN -DOCKER_CERTS_DIR=${INFRA_INSTALL_DIR}/oci-iaas/grabdish-adapter/infrastructure - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -ORACLE_HOME="/usr/lib/oracle/19.11/client64" # For Oracle 19c client - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" -DOCKER_REG_CMD="docker run -d \ - --restart=always \ - --name registry \ - -v "$DOCKER_CERTS_DIR"/certs:/certs \ - -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - -p 443:443 \ - registry:2" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - printf "\360\237\220\261 ${print_header_count}.: $1\n" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - printf "\360\237\246\204 ${print_header_count}.${print_subheader_count}.: [INFO] $1\n" - return - } - - -start=$(date +%s) - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} ${BUILD_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} ${BUILD_LOG_FILE} - - -# Sending all stdout and stderr to log file -exec >>${INSTALL_LOG_FILE} -exec 2>&1 - - -print_header "Starting Microservices Data-driven Infrastructure installation process at $(date)" - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -print_header "Creating Microservices Data-driven Infrastructure Configuration File." - -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >>${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >>${SSHD_CONFIG_FILE} -print_subheader "SSHD Banner created" -sudo systemctl restart sshd.service | -print_subheader "Restarted SSHD Service" - -####### Adding environment variables ######### -print_header "Creating Environment Variables" -print_subheader "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -print_subheader "Adding Oracle Home and Path variables to bashrc" -sudo -u ${USER_NAME} echo "export ORACLE_HOME=${ORACLE_HOME}" >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TNS_ADMIN=${TNS_ADMIN_LOC}" >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="${ORACLE_HOME}"' >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >>${USER_HOME}/.bashrc -print_subheader "Completed" - -print_subheader "Adding APP_INSTALL_DIR and INFRA_INSTALL_DIR variables to bashrc" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "source <(kubectl completion bash)" >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >>${USER_HOME}/.bashrc -print_subheader "Completed" - -####### Adding environment variables - End ######### - - - -# Clone Application and Infrastructure Resource Files -print_header "Downloading Microservices Infrastructure and Application from public repositories" -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR -print_subheader "Created destination directories $APP_INSTALL_DIR and $INFRA_INSTALL_DIR" - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - - -print_subheader "Downloading Application code from $app_public_repo " -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR - -print_subheader "Downloading Infrastructure code from $iaas_public_repo" -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} mkdir -p $DOCKER_CERTS_DIR/certs -print_subheader "Granting read, write and execute permissions to users" -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -print_subheader "Completed" - - -######################################### TO DO ########### - -# Infrastructure to Grabdish Application Bridge - -print_header "Initialing Infrastructure to Grabdish Application Bridge" -#update tnsnames.ora -print_subheader "Updating TNS ORA " -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -print_subheader "Updating TNSNAMES and Listener ORA Files" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -#No Need for TEMP DIR -- refactor code later -sudo -u ${USER_NAME} cp $TEMP_DIR/*.ora ${TNS_ADMIN_LOC}/. - -print_subheader "Opening Firewall Port for HTTP/S, SQLNET Traffic" -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --permanent --add-port=443/tcp -sudo firewall-cmd --permanent --add-port=80/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all -print_subheader "Firewall Port opened" - -print_header "Installing required infrastructure components" - -sudo chmod 666 /var/run/docker.sock - -print_subheader "Deleting previous installation of Minikube" -sudo su - ${USER_NAME} bash -c "minikube delete" - -print_subheader "Restarting Docker" -sudo systemctl restart docker - -print_subheader "Restarting Minikube cluster" -#sudo su - ${USER_NAME} bash -c "minikube start --driver=docker" # encountering issue with https docker reg -sudo su - ${USER_NAME} bash -c "minikube start --driver=none" - -print_subheader "Enabling Ingress on K8 Cluster" -sudo su - ${USER_NAME} bash -c "minikube addons enable ingress" - -print_subheader "Starting Docker Registry" -sudo su - ${USER_NAME} bash -c "docker container stop registry && docker container rm -v registry" -#sudo su - ${USER_NAME} bash -c "docker run -d -p 5000:5000 --restart=always --name registry registry:2" - -print_subheader "Granting writing privilges to user ${USER_NAME}" -sudo chown -R opc:opc $DOCKER_CERTS_DIR - -print_subheader "Creating SSL certificates for Docker Registry" -sudo su - ${USER_NAME} bash -c "openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${DOCKER_CERTS_DIR}/certs/domain.key -out ${DOCKER_CERTS_DIR}/certs/domain.crt -subj \"/CN=grabdish/O=grabdish\"" -#print_subheader "Created Docker Certificate" - -#sudo su - ${USER_NAME} bash -c "cd$ DOCKER_CERTS_DIR; $DOCKER_REG_CMD" # Docker Pull is failing -sudo su - ${USER_NAME} bash -c "docker run -d -p 5000:5000 --restart=always --name registry registry:2" - -print_header "Creating Secrets" -print_subheader "Creating namespace" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_ns_msdataworkshop.sh" -print_subheader "Creating Secret frontendpasswd" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_frontendpasswd.sh" -print_subheader "Creating Secret dbuser" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbpasswd.sh" -print_subheader "Creating Secret dbwallet" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbwallet.sh" -print_subheader "Creating Secret ssl-certificate-secret" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_ssl-certificate-secret.sh" -print_subheader "Completed" - -# These states are required for the Grabdish application build process to work -print_header "Creating States required for Grabdish Application" -print_subheader "These states are required for the Grabdish application build process to work" -sudo su - ${USER_NAME} bash -c "state_set_done OBJECT_STORE_BUCKET" -sudo su - ${USER_NAME} bash -c "state_set_done ORDER_DB_OCID" -sudo su - ${USER_NAME} bash -c "state_set_done INVENTORY_DB_OCID" -sudo su - ${USER_NAME} bash -c "state_set_done WALLET_GET" -sudo su - ${USER_NAME} bash -c "state_set_done CWALLET_SSO_OBJECT" -sudo su - ${USER_NAME} bash -c "state_set_done DB_PASSWORD" -sudo su - ${USER_NAME} bash -c "state_set ORDER_DB_NAME orders" -sudo su - ${USER_NAME} bash -c "state_set INVENTORY_DB_NAME inventory" -#sudo su - ${USER_NAME} bash -c "state_set DOCKER_REGISTRY localhost:443" -sudo su - ${USER_NAME} bash -c "state_set DOCKER_REGISTRY localhost:5000" -print_subheader "Completed" - - -lab1_start=$(date +%s) - -print_header "Building Lab 1" - -print_subheader "Creating Jaeger Microservice" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_service_jaeger.sh" -print_subheader "Started Jaeger Service" - - -print_subheader "Building frontend-helidon Microservice" -sudo su - ${USER_NAME} bash -c "cd ${APP_INSTALL_DIR}/grabdish/frontend-helidon;time ./build.sh > ${BUILD_LOG_FILE}-frontend-helidon.log;./deploy.sh " - -print_subheader "Completed" - -print_subheader "Creating Frontend Microservice" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml" -print_subheader "Completed" - -print_subheader "Creating Frontend Ingress" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml" -print_subheader "Completed" - -MICROSERVICES="order-helidon supplier-helidon-se inventory-helidon" - -print_subheader "Building ${MICROSERVICES}" - -for service_name in $MICROSERVICES; do - print_subheader "Creating Microservice ${service_name}" - sudo su - ${USER_NAME} bash -c "cd ${APP_INSTALL_DIR}/grabdish/${service_name}; time ./build.sh>> ${BUILD_LOG_FILE}-${service_name}.log;./deploy.sh " - print_subheader "${service_name} Completed" - done - -lab1_end=$(date +%s) - -print_subheader "Lab 1 Build took $((lab1_end - lab1_start)) seconds" - -end=$(date +%s) - -executionTime=$((end - start)) - - -print_header "Provisioning Completed at $(date)" -print_header "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. Took ${executionTime} seconds" - - -sudo echo "${USAGE_INFO}" >${SSHD_BANNER_FILE} - - - diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database.sh b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database.sh deleted file mode 100644 index ecd24176b..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database.sh +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -#APP_INSTALL_DIR=${USER_HOME}/microservices-datadriven -#INFRA_INSTALL_DIR=${USER_HOME}/microservices-datadriven-infra -#INFRA_HOME=${USER_HOME}/microservices-datadriven-infra - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_DIR=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -#ORACLE_HOME=/opt/oracle/product/21c/dbhome_1 # for Docker -ORACLE_HOME="/usr/lib/oracle/19.11/client64" # for Docker Host -- i.e. Compute - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# Starting Microservices Data-driven Infrastructure installation process at ${start} " | tee -a ${INSTALL_LOG_FILE} -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -echo "" | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# 1. Create Microservices Datadriven Infrastructure Configuration File." | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating Microservices Datadriven Infrastructure" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Update Installation of Database is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -#Post Provisioning - -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all - - -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -sudo -u ${USER_NAME} echo $app_public_repo -sudo -u ${USER_NAME} echo $iaas_public_repo - - -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -sudo -u ${USER_NAME} echo "#################################### 1 ####################################" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 3 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export PATH=$ORACLE_HOME/bin:$PATH >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" - -sudo -u ${USER_NAME} echo "#################################### 4 ####################################" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 5 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 6 ####################################" -#update tnsnames.ora -sudo -u ${USER_NAME} bash -c "source ${USER_HOME}/.bashrc" -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -sudo -u ${USER_NAME} echo "#################################### 7 ####################################" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora - -sudo -u ${DBUSER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${DBUSER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" - -#use su - instead of sudo - u -sudo -u ${USER_NAME} echo "#################################### 8 ####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo "################################### 9 #####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc;source ${APP_INSTALL_DIR}/grabdish/env.sh;${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_setup.sh" - -sudo -u ${USER_NAME} echo "################################### 10 #####################################" - -end=`date +%s` - -executionTime=$((end-start)) - -echo "--------------------------------------------------------------" -echo "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} - -exec -l $SHELL \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database062121.sh b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database062121.sh deleted file mode 100644 index abefecc6a..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database062121.sh +++ /dev/null @@ -1,268 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -#APP_INSTALL_DIR=${USER_HOME}/microservices-datadriven -#INFRA_INSTALL_DIR=${USER_HOME}/microservices-datadriven-infra -#INFRA_HOME=${USER_HOME}/microservices-datadriven-infra - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - Microservices Datadriven Infrastructure is now available for usage - - For additional details regarding Microservices Datadriven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# Starting Microservices Data-driven Infrastructure installation process at ${start} " | tee -a ${INSTALL_LOG_FILE} -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -echo "" | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# 1. Create Microservices Datadriven Infrastructure Configuration File." | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating Microservices Datadriven Infrastructure" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Update Installation of Database is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -#Post Provisioning - -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all - - -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -sudo -u ${USER_NAME} echo $app_public_repo -sudo -u ${USER_NAME} echo $iaas_public_repo - - -whoami - -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -sudo -u ${USER_NAME} echo "#################################### 1 ####################################" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 3 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export PATH=$ORACLE_HOME/bin:$PATH >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" - -sudo -u ${USER_NAME} echo "#################################### 4 ####################################" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 5 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 6 ####################################" -#update tnsnames.ora -sudo -u ${USER_NAME} bash -c "source ${USER_HOME}/.bashrc" -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -sudo -u ${USER_NAME} echo "#################################### 7 ####################################" -sudo -u ${USER_NAME} $INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora - -sudo -u ${DBUSER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${DBUSER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" - -sudo -u ${USER_NAME} echo "#################################### 8 ####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - - -sudo -u ${USER_NAME} echo "################################### 9 #####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc;source ${APP_INSTALL_DIR}/grabdish/env.sh;${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_setup.sh" - -sudo -u ${USER_NAME} echo "################################### 10 #####################################" -end=`date +%s` - -executionTime=$((end-start)) - -echo "--------------------------------------------------------------" -echo "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} - -exec -l $SHELL \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database_docker.sh b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database_docker.sh deleted file mode 100644 index d3a84edbf..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/bootstrap_database_docker.sh +++ /dev/null @@ -1,253 +0,0 @@ -#!/bin/bash - -# shellcheck disable=SC2218 - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_DIR=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -ORACLE_HOME=/opt/oracle/product/21c/dbhome_1 # for Docker -DB_PASSWORD="$(curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password')" - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage. - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - echo "# ${print_header_count}.: $1" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - echo "#${print_header_count}.${print_subheader_count}.: [INFO] $1" - return - } - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - - -# Sending all stdout and stderr to log file -exec >> ${INSTALL_LOG_FILE} -exec 2>&1 - -print_header "Starting Microservices Data-driven Infrastructure installation process at $(date)" - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### - -print_header "Creating Microservices Datadriven Infrastructure Configuration File." -cat >${APP_CONFIG_FILE} < ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### - -print_header "Creating Environment Variables" -print_subheader "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -#sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export TNS_ADMIN="${TNS_ADMIN_DIR}/" >> ${USER_HOME}/.bashrc - -print_subheader "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc -print_subheader "Completed." - -####### Adding environment variables - End ######### - -#Post Provisioning -print_header "Adding port 1521 to the firewall" -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload[] -sudo firewall-cmd --list-all -print_subheader "Completed." - -print_header "Downloading Microservices Infrastructure and Application from public repositories" -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -print_subheader $app_public_repo -print_subheader $iaas_public_repo - -print_subheader "Downloading Infrastructure from $iaas_public_repo to $APP_INSTALL_DIR" -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -print_subheader "Download Completed" - -print_subheader "Downloading Application from $app_public_repo to $APP_INSTALL_DIR" -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -print_subheader "Download Completed" - -sudo chmod -R 755 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -print_header "Updating Database tnsnames.ora, sqlnet.ora and listeners.ora files to match target database" - -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -print_subheader "Creating new tnsnames.ora, sqlnet.ora and listeners.ora file" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -print_subheader "Copying tnsnames.ora" -#sudo -u ${USER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -#sudo -u ${USER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora -sudo -u ${USER_NAME} cp $TEMP_DIR/tnsnames.ora ${TNS_ADMIN_DIR}/. - -print_subheader "Copying listeners.ora" -#sudo -u ${USER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -#sudo -u ${USER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora -sudo -u ${USER_NAME} cp $TEMP_DIR/listeners.ora ${TNS_ADMIN_DIR}/. - -print_subheader "Copying sqlnet.ora" -#sudo -u ${DBUSEUSER_NAMER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -#sudo -u ${USER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" -sudo -u ${USER_NAME} cp $TEMP_DIR/sqlnet.ora ${TNS_ADMIN_DIR}/. -print_subheader "Completed" - - -#use su - instead of sudo - u -#print_subheader "#################################### 8 ####################################" -#sudo -u ${USER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -#print_subheader "################################### 9 #####################################" -#sudo su - ${USER_NAME} bash -c "${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_docker_setup.sh" -# database is already pre-provisioned for the docker image - -print_header "Changing Database System and Grabdish Application Passwords." - -sudo su - $USER_NAME bash -c "docker exec microservice-database bash -c \"${DBUSER_HOME}/setPassword.sh ${DB_PASSWORD}\"" -print_subheader "Changed SYSTEM Password" - -sudo su - $USER_NAME bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/change_passwd_orders.sh" -print_subheader "Changed ORDER PDB Password" - -sudo su - $USER_NAME bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/change_passwd_inventory.sh" -print_subheader "Changed INVENTORY PDB Password" - -end=`date +%s` - -executionTime=$((end-start)) - -print_header "Installation of Oracle Microservices Infrastructure and Data-driven Application completed at $(date)" -print_subheader "It took ${executionTime} seconds" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/create_custom_image.sh b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/create_custom_image.sh deleted file mode 100644 index 95162e2ba..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/create_custom_image.sh +++ /dev/null @@ -1,32 +0,0 @@ -python36 -oci-ansible-collection -oci oci-cli -go-toolset -jdk-16.0.1.0.1.x86_64 -git -gnupg2 curl tar -ruby -nodejs:14 -node-oracledb-node14 -oci-dotnet-sdk -maven -libnsl -instantclient19.11-basic -instantclient19.11-sqlplus -instantclient19.11-tools -graalvm -Docker -Docker Registry -Minikube -Ingress Controller - - - -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-basic-19.11.0.0.0-1.x86_64.rpm -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-sqlplus-19.11.0.0.0-1.x86_64.rpm -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-tools-19.11.0.0.0-1.x86_64.rpm - -curl -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-aarch64-20.2.0.tar.gz | tar xz -~/graalvm-ce-java11-20.2.0/bin/gu install native-image - -#kubcetl, minikube, docker, docker registry diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/temp.sh b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/temp.sh deleted file mode 100644 index 3fe1254c8..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/scripts/temp.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -BUILD_LOG_FILE=${USER_HOME}/${APP_NAME}-build - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_LOC=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN -DOCKER_CERTS_DIR=${INFRA_INSTALL_DIR}/oci-iaas/grabdish-adapter/infrastructure - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 - - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" -DOCKER_REG_CMD="docker run -d \ - --restart=always \ - --name registry \ - -v "$DOCKER_CERTS_DIR"/certs:/certs \ - -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - -p 443:443 \ - registry:2" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - echo "# ${print_header_count}.: $1" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - echo "#${print_header_count}.${print_subheader_count}.: [INFO] $1" - return - } - - -# Sending all stdout and stderr to log file -exec >>${INSTALL_LOG_FILE} -exec 2>&1 - -start=$(date +%s) - -# Log file - -print_header "Building Lab 1" - -print_subheader "Creating Jaeger Microservice" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_service_jaeger.sh" -print_subheader "Started Jaeger Service" - - -print_subheader "Building frontend-helidon Microservice" -sudo su - ${USER_NAME} bash -c "cd ${GRABDISH_HOME}/frontend-helidon;time ./build.sh > ${BUILD_LOG_FILE}-frontend-helidon.log;./deploy.sh " - -print_subheader "Completed" - -print_subheader "Creating Frontend Microservice" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml" -print_subheader "Completed" - -print_subheader "Creating Frontend Ingress" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml" -print_subheader "Completed" - -MICROSERVICES="order-helidon supplier-helidon-se inventory-helidon" - -print_subheader "Building ${MICROSERVICES}" - -for service_name in $MICROSERVICES; do - print_subheader "Creating Microservice ${service_name}" - sudo su - ${USER_NAME} bash -c "cd ${GRABDISH_HOME}/${service_name}; time ./build.sh>> ${BUILD_LOG_FILE}-${service_name}.log;./deploy.sh " - print_subheader "${service_name} Completed" - done - - -end=$(date +%s) - -executionTime=$((end - start)) - - -print_header "Provisioning Completed" -print_subheader "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" -print_subheader "" - - - - diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/variables.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/variables.tf deleted file mode 100644 index 2366aadfb..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/compute/variables.tf +++ /dev/null @@ -1,84 +0,0 @@ -variable "tenancy_ocid" {} -variable "region" {} - -variable "target_compartment_id" { - description = "OCID of the compartment where the compute is being created" - type = string -} - -variable "vcn_id" { - description = "VCN OCID where the instance is going to be created" - type = string -} - -variable "subnet_id" { - description = "Subnet OCID where the instance is going to be created" - type = string -} - -variable "image_os" { - default = "Oracle Linux" -} - -variable "image_os_version" { - default = "8" -} - -variable "instance_shape" { - description = "Shape of the instance" - type = string -} - -variable "generate_ssh_key_pair" { - description = "Auto-generate SSH key pair" - type = string -} - -variable "ssh_public_key" { - description = "ssh public key used to connect to the compute instance" - type = string -} - -variable "use_tenancy_level_policy" { - description = "Compute instance to access all resources at tenancy level" - type = bool -} - -variable "common_tags" { - description = "Tags" - type = map(string) -} - -variable "generate_app_db_passwords" { - description = "Auto-generate Grabdish Application and Database Passwords" - type = string -} - -variable "grabdish_database_password" { - description = "grabdish_database_password" - type = string -} - -variable "grabdish_application_password" { - description = "grabdish_application_password" - type = string -} - -variable "iaas_public_repo" { - description = "Repository URI to execute post provisioning infrastructure setup scripts" - type = string - #default = "" -} - -variable "app_public_repo" { - description = "Repository URI to execute post provisioning Application setup scripts" - type = string - #default = "" -} - -variable "dbaas_FQDN" { - description = "dbaas_FQDN" - type = string -} - - diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/main.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/main.tf deleted file mode 100644 index 7941e4d7b..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/main.tf +++ /dev/null @@ -1,65 +0,0 @@ -locals { - compartment_id = var.target_compartment_id - display_name = "microservices" - vcn_dns_label = "onpremise" - vcn_cidr_block = "10.0.0.0/16" - subnet_cidr_block = "10.0.1.0/24" - all_cidr = "0.0.0.0/0" - vcn_id = oci_core_vcn.this.id -} - -# VCN -resource "oci_core_vcn" "this" { - compartment_id = local.compartment_id - cidr_block = local.vcn_cidr_block - display_name = "${local.display_name}-vcn" - dns_label = local.vcn_dns_label - freeform_tags = var.common_tags -} - -# internet gateway to connect to compute instance - internet gateway is for the VCN - -resource "oci_core_internet_gateway" "ig" { - # count = local.use_existing_vcn ? 0 : 1 - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-internet-gateway" # Optional - freeform_tags = var.common_tags -} - -resource "oci_core_route_table" "rt" { #TODO - change the name to "rt" instead of "subnet" - # count = local.use_existing_vcn ? 0 : 1 - compartment_id = local.compartment_id - vcn_id = local.vcn_id - display_name = "${local.display_name}-route-table" - - route_rules { - destination = local.all_cidr - destination_type = "CIDR_BLOCK" - network_entity_id = oci_core_internet_gateway.ig.id - } - - freeform_tags = var.common_tags -} - -resource "oci_core_security_list" "sl" { - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-security-list" # Optional - freeform_tags = var.common_tags - - # Intentionally left ingress and egress rules blank. Expected to set the NSG at the instance level -} - -#subnet -resource "oci_core_subnet" "regional_sn" { - cidr_block = local.subnet_cidr_block # Required - compartment_id = var.target_compartment_id # Required - vcn_id = local.vcn_id # Required - route_table_id = oci_core_route_table.rt.id # Optional - But Required in this case to associate the above created Route table - security_list_ids = [oci_core_security_list.sl.id] # Optional - defined a security list that has NO ingress and egress rules - display_name = "${local.display_name}-subnet" # Optional - freeform_tags = var.common_tags - dns_label = local.display_name - //prohibit_public_ip_on_vnic = false -} diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/outputs.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/outputs.tf deleted file mode 100644 index 6b44c72c8..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/outputs.tf +++ /dev/null @@ -1,11 +0,0 @@ -output "vcn" { - value = oci_core_vcn.this -} - -output "subnet" { - value = oci_core_subnet.regional_sn -} - -output "subnet_domain_name" { - value = oci_core_subnet.regional_sn.subnet_domain_name -} diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/variables.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/variables.tf deleted file mode 100644 index 49a404bf9..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/modules/network/variables.tf +++ /dev/null @@ -1,9 +0,0 @@ -variable "target_compartment_id" { - description = "OCID of the compartment where the VCN is being created" - type = string -} - -variable "common_tags" { - description = "Tags" - type = map(string) -} \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/outputs.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/outputs.tf deleted file mode 100644 index 0284d7004..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/outputs.tf +++ /dev/null @@ -1,63 +0,0 @@ -locals { - app_password = var.generate_app_db_passwords ? random_string.grabdish_application_password.result : var.grabdish_application_password -} -output "compute_instance_public_ip" { - value = module.compute.instance.public_ip -} - -output "compartment_id" { - value = var.compartment_ocid -} - -output "generated_instance_ssh_private_key" { - value = var.generate_ssh_key_pair ? module.compute.instance_keys.private_key_pem : "" -} - -output "dbaas_public_ip" { - value = module.compute.dbaas_public_ip -} - -output "dbaas_private_ip" { - value = module.compute.dbaas_private_ip -} - -output "FQDN_database_SN" { - value = module.network.subnet -} - -output "dbaas_FQDN" { - value = join(".", [module.compute.dbaas_display_name,module.network.subnet_domain_name]) -} - -output "Database_Password"{ - value = var.generate_app_db_passwords ? random_string.grabdish_database_password.result : var.grabdish_database_password -} - -output "Grabdish_Application_Password"{ - value = local.app_password -} - -output "Login_Instructions" { - #type = URL - value = "Login to http://${module.compute.instance.public_ip} using username: grabdish password: ${local.app_password} " -} - -/* -output "dbaas_password"{ - value = var.grabdish_database_password -} - -output "app_password"{ - value = var.grabdish_application_password -} -*/ -/* -output "Database_Password"{ - value = module.compute.Grabdish_Application_Password -} - -output "Grabdish_Application_Password"{ - value = module.compute.On_Premise_Database_Password -} - -*/ \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/provider.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/provider.tf deleted file mode 100644 index 569565755..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/provider.tf +++ /dev/null @@ -1,10 +0,0 @@ -provider "oci" { - tenancy_ocid = var.tenancy_ocid - region = var.region -} - -provider "tls" { - -} - - diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/schema.yaml b/infra/oci-iaas/resource_manager/multnodes-deployment/schema.yaml deleted file mode 100644 index 489c6c7cf..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/schema.yaml +++ /dev/null @@ -1,176 +0,0 @@ -title: Grabdish - Microservices Data-driven application on Oracle Converged Database -description: Grabdish - Microservices Data-driven application on Oracle Converged Database -stackDescription: Grabdish - Microservices Data-driven application on Oracle Converged Database -informationalText: Grabdish - Microservices Data-driven application on Oracle Converged Database -schemaVersion: 1.1.0 -version: "20200822" -locale: "en" - -variableGroups: - - title: General Configuration - visible: false - variables: - - compartment_ocid - - tenancy_ocid - - region - - - title: Required Configuration for Microservices Datadriven Application Grabdish - visible: true - variables: - - instance_shape - - generate_ssh_key_pair - - ssh_public_key - - generate_app_db_passwords - - grabdish_application_password - - grabdish_database_password - - use_tenancy_level_policy - - iaas_public_repo - - app_public_repo - -variables: - # General Configuration - tenancy_ocid: - title: Tenancy ID - description: The Oracle Cloud Identifier (OCID) for your tenancy - type: string - required: true - visible: false - - region: - title: Region To Provision the Compute and Database Resources - description: Region To Provision the Compute and Database Resources - type: oci:identity:region:name - required: true - visible: false - - compartment_ocid: - title: Compartment OCID - description: Compartment OCID - type: oci:identity:compartment:id - required: true - visibile: false - - # Required - instance_shape: - title: Instance Shape - description: Instance Shape - type: oci:core:instanceshape:name - default: VM.Standard.E2.1.Micro - required: true - dependsOn: - compartmentId: ${compartment_ocid} - - generate_ssh_key_pair: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.generate_ssh_key_pair.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.generate_ssh_key_pair.description()} - type: boolean - default: true - required: true - - generate_app_db_passwords: - title: Auto-generate Grabdish Application and Database Passwords - description: Automatically generate Grabdish Application and Database Passwords - type: boolean - default: true - required: true - - ssh_public_key: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.ssh_public_key.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.ssh_public_key.description()} - type: oci:core:ssh:publickey - required: false - additionalProps: - allowMultiple: true - pattern: "((^(ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)(,((ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)*$" - visible: - not: - - generate_ssh_key_pair - - use_tenancy_level_policy: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.use_tenancy_level_policy.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.use_tenancy_level_policy.description()} - type: boolean - default: true - required: true - - grabdish_database_password: - description: Provide database password. it will be used for creating admin, order_user, inventory_user for Order and Inventory PDBs. (Must be a minimum 12 characters, contain at least one uppercase letter, one lowercase letter, one number , no special characters allowed). This password will be made available to you as an output variable. - type: password - minLength: 12 - maxLength: 30 - pattern: ^[A-Za-z][A-Za-z0-9]+$ - required: true - #default: OraDB4U12345 - visible: - not: - - generate_app_db_passwords - - grabdish_application_password: - description: Provide database password. it will be used for admin, wallet and application , cannot have the word "usage" in the passowrd, (Must be a minimum 12 characters, contain at least one uppercase letter, one lowercase letter, one number , no special characters allowed). - type: password - minLength: 12 - maxLength: 30 - pattern: ^[A-Za-z][A-Za-z0-9]+$ - required: true - #default: Welcome12345 - visible: - not: - - generate_app_db_passwords - - iaas_public_repo: - title: Post Provisioning Infrastructure Setup URL - description: Repository URI to execute post provisioning infrastructure scripts - type: String - #minLength: 12 - #maxLength: 30 - pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - required: true - #default: Welcome12345 - - app_public_repo: - title: Post Provisioning Application Setup URL - description: Repository URI to execute post provisioning application scripts - type: String - #minLength: 12 - #maxLength: 30 - pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - required: true - #default: Welcome12345 - -outputGroups: - - title: outputGroups - outputs: - - compute_instance_public_ip - - compartment_id - - generated_instance_ssh_private_key - - title: On Premise Database details - outputs: - - dbaas_instance_public_ip - - generated_instance_ssh_private_key - -outputs: - compute_instance_public_ip: - title: compute_instance_public_ip - displayText: compute_instance_public_ip - type: copyableString - visible: true - - compartment_id: - title: compartment_id - displayText: compartment_id - type: string - visible: true - - generated_instance_ssh_private_key: - title: generated_instance_ssh_private_key - displayText: generated_instance_ssh_private_key - type: string - visible: true - - dbaas_instance_public_ip: - title: Database Public IP Address - displayText: module.compute.dbaas_public_ip - type: copyableString - visible: true - - diff --git a/infra/oci-iaas/resource_manager/multnodes-deployment/variables.tf b/infra/oci-iaas/resource_manager/multnodes-deployment/variables.tf deleted file mode 100644 index a684b6ccc..000000000 --- a/infra/oci-iaas/resource_manager/multnodes-deployment/variables.tf +++ /dev/null @@ -1,83 +0,0 @@ -variable "tenancy_ocid" {} -variable "region" {} -variable "compartment_ocid" {} - -/* -resource "random_password" "onprem_dbaas_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} - -resource "random_password" "onprem_application_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} -*/ - - -variable "instance_shape" { - description = "Shape of the instance" - type = string -} - -variable "generate_ssh_key_pair" { - description = "Auto-generate SSH key pair" - type = string -} - -variable "ssh_public_key" { - description = "ssh public key used to connect to the compute instance" - default = "" # This value has to be defaulted to blank, otherwise terraform apply would request for one. - type = string -} - -variable "use_tenancy_level_policy" { - description = "Compute instance to access all resources at tenancy level" - type = bool -} - -variable "generate_app_db_passwords" { - description = "Automatically generate Grabdish Application and Database Passwords" - type = string -} - -variable "grabdish_database_password" { - description = "grabdish_database_password" - type = string - default = "OraDB4U13579" - -} - -variable "grabdish_application_password" { - description = "grabdish_application_password" - type = string - default = "Welcome12345" - -} - -variable "iaas_public_repo" { - description = "Repository URI to execute post provisioning infrastructure setup scripts" - type = string - default = "git clone -b master --single-branch https://github.com/vishalmmehra/microservices-datadriven-infra/" - #default = "" -} - -variable "app_public_repo" { - description = "Repository URI to execute post provisioning Application setup scripts" - type = string - default = "git clone -b 21.6.1 --single-branch https://github.com/oracle/microservices-datadriven.git" - #default = "" -} - - - diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/license.txt b/infra/oci-iaas/resource_manager/single-node-deployment/license.txt deleted file mode 100644 index fa0264737..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/license.txt +++ /dev/null @@ -1,30 +0,0 @@ - - - Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - - The Universal Permissive License (UPL), Version 1.0 - - Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this - software, associated documentation and/or data (collectively the "Software"), free of charge and under any and - all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor - hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or - (ii) the Larger Works (as defined below), to deal in both - - (a) the Software, and - (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software - (each a “Larger Work” to which the Software is contributed by such licensors), - - without restriction, including without limitation the rights to copy, create derivative works of, display, - perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have - sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms. - - This license is subject to the following condition: - The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must - be included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/main.tf b/infra/oci-iaas/resource_manager/single-node-deployment/main.tf deleted file mode 100644 index 2012db609..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/main.tf +++ /dev/null @@ -1,56 +0,0 @@ -locals { - common_tags = { - Reference = "on-prem-micro-svc" - } -} - -resource "random_string" "grabdish_database_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 0 - override_special = "^[A-Za-z][A-Za-z0-9]+$" -} - -resource "random_string" "grabdish_application_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} - -module "network" { - source = "./modules/network" - target_compartment_id = var.compartment_ocid - common_tags = local.common_tags - #display_name_prefix = var.new_network_prefix - # dns_label = var.new_network_prefix -} - -module "compute" { - source = "./modules/compute" - region = var.region - tenancy_ocid = var.tenancy_ocid - target_compartment_id = var.compartment_ocid - vcn_id = module.network.vcn.id - subnet_id = module.network.subnet.id - instance_shape = var.instance_shape - generate_ssh_key_pair = var.generate_ssh_key_pair - ssh_public_key = var.ssh_public_key - generate_app_db_passwords = var.generate_app_db_passwords - use_tenancy_level_policy = var.use_tenancy_level_policy - common_tags = local.common_tags - grabdish_database_password = var.generate_app_db_passwords ? random_string.grabdish_database_password.result : var.grabdish_database_password - grabdish_application_password = var.generate_app_db_passwords ? random_string.grabdish_application_password.result : var.grabdish_application_password - - #iaas_public_repo = var.iaas_public_repo - #app_public_repo = var.app_public_repo - - iaas_app_public_repo = var.iaas_app_public_repo - dbaas_FQDN = join(".", [module.compute.dbaas_display_name,module.network.subnet_domain_name]) -} \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/main.tf b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/main.tf deleted file mode 100644 index 4a4761478..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/main.tf +++ /dev/null @@ -1,279 +0,0 @@ -locals { - compartment_id = var.target_compartment_id - vcn_id = var.vcn_id - all_cidr = "0.0.0.0/0" - current_time = formatdate("YYYYMMDDhhmmss", timestamp()) - app_name = "grabdish-microsvc" - app_compute_instance1_name = "grabdish-compute1" - app_db_instance1_name = "grabdish-database1" - display_name = join("-", [local.app_name, local.current_time]) - compartment_name = data.oci_identity_compartment.this.name - grabdish_app_password = var.grabdish_application_password - grabdish_db_password = var.grabdish_database_password - dynamic_group_tenancy_level = "Allow dynamic-group ${oci_identity_dynamic_group.for_instance.name} to manage all-resources in tenancy" - dynamic_group_compartment_level = "Allow dynamic-group ${oci_identity_dynamic_group.for_instance.name} to manage all-resources in compartment ${local.compartment_name}" - num_of_ads = length(data.oci_identity_availability_domains.ads.availability_domains) - ads = local.num_of_ads > 1 ? flatten([ - for ad_shapes in data.oci_core_shapes.this : [ - for shape in ad_shapes.shapes : ad_shapes.availability_domain if shape.name == var.instance_shape - ] - ]) : [for ad in data.oci_identity_availability_domains.ads.availability_domains : ad.name] -} - - -resource "oci_core_network_security_group" "nsg" { - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-security-group" # Optional - freeform_tags = var.common_tags -} - -resource "oci_core_network_security_group_security_rule" "ingress_ssh" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "22" # Required - min = "22" # Required - } - } - description = "ssh only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_https" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "443" # Required - min = "443" # Required - } - } - description = "https only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_http" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "80" # Required - min = "80" # Required - } - } - description = "http only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_sqlnet" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "1521" # Required - min = "1521" # Required - } - } - description = "sqlnet 1521 only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_icmp_3_4" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "1" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - icmp_options { # Optional - type = "3" # Required - code = "4" # Required - } - description = "icmp option 1" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_icmp_3" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "1" # Required - source = "10.0.0.0/16" # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - icmp_options { # Optional - type = "3" # Required - } - description = "icmp option 2" # Optional -} - -resource "oci_core_network_security_group_security_rule" "egress" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "EGRESS" # Required - protocol = "6" # Required - destination = local.all_cidr # Required - destination_type = "CIDR_BLOCK" # Required - stateless = false # Optional - description = "connect to any network" -} - -# Get a list of Availability Domains -data "oci_identity_availability_domains" "ads" { - compartment_id = var.tenancy_ocid -} - -data "oci_core_images" "this" { - compartment_id = local.compartment_id # Required - operating_system = var.image_os # Optional - operating_system_version = var.image_os_version # Optional - shape = var.instance_shape # Optional - sort_by = "TIMECREATED" # Optional - sort_order = "DESC" # Optional -} - -data "oci_core_shapes" "this" { - count = local.num_of_ads > 1 ? local.num_of_ads : 0 - #Required - compartment_id = local.compartment_id - - #Optional - availability_domain = data.oci_identity_availability_domains.ads.availability_domains[count.index].name - image_id = data.oci_core_images.this.images[0].id -} - -data "oci_identity_compartment" "this" { - id = local.compartment_id -} - -# Generate the private and public key pair -resource "tls_private_key" "ssh_keypair" { - algorithm = "RSA" # Required - rsa_bits = 2048 # Optional -} - -resource "oci_identity_dynamic_group" "for_instance" { - compartment_id = var.tenancy_ocid - description = "To Access OCI CLI" - name = "${local.display_name}-dynamic-group" - matching_rule = "ANY {instance.id = '${oci_core_instance.compute_instance1.id}'}" - freeform_tags = var.common_tags -} - -resource "oci_identity_policy" "dg_manage_all" { - compartment_id = var.use_tenancy_level_policy ? var.tenancy_ocid : local.compartment_id - description = "To Access OCI CLI" - name = "${local.display_name}-instance-policy" - statements = var.use_tenancy_level_policy ? [local.dynamic_group_tenancy_level] : [local.dynamic_group_compartment_level] - freeform_tags = var.common_tags -} - -resource "oci_core_instance" "dbaas_instance1" { - availability_domain = local.ads[0] - compartment_id = local.compartment_id - shape = var.instance_shape - preserve_boot_volume = false - freeform_tags = var.common_tags - display_name = local.app_db_instance1_name - - create_vnic_details { - subnet_id = var.subnet_id - assign_public_ip = true - nsg_ids = [ - oci_core_network_security_group.nsg.id] - } - - source_details { - source_type = "image" - #source_id = data.oci_core_images.this.images[0].id - #source_id = "ocid1.image.oc1.iad.aaaaaaaaudkqtvbfo4mm3qyhqdrpqcatijjmml2z7ddal7hojhb2gcv34kaq" # Custom Compute - #source_id = "ocid1.image.oc1..aaaaaaaa7cr4xiwx6mbdrgfbppdypdtzyxothft2sjqftygtpxnulqmk6tla" # Platform Image - #source_id = "ocid1.appcataloglisting.oc1..aaaaaaaan5rb524w7axx36ukn42l7fwzyzm3kodad7x5hxyeyz4nyy3yefgq" # Marketplace Image - #source_id ="ocid1.image.oc1..aaaaaaaamotrq5ou4qjsnzw5sv7w2nbwvhhp4kjmazlxf23ozcsd66t3pw5q" #LiveLabs Converged DB - source_id ="ocid1.image.oc1.iad.aaaaaaaajv4k3wrfdrxwapmewcw37oxsroms3f7hmrk2mc7hepweiy3cbtja" #docker-db-21c-prega - - # DB-Base Image - } - - metadata = { - ssh_authorized_keys = var.generate_ssh_key_pair ? tls_private_key.ssh_keypair.public_key_openssh : var.ssh_public_key - user_data = base64encode(file("./modules/compute/scripts/bootstrap_database_docker.sh")) - tenancy_id = var.tenancy_ocid - grabdish_application_password = var.grabdish_application_password - grabdish_database_password = var.grabdish_database_password - #app_public_repo = var.app_public_repo - #iaas_public_repo = var.iaas_public_repo - #dbaas_FQDN = var.dbaas_FQDN - target_compartment_id =var.target_compartment_id - vcn_id = var.vcn_id - subnet_id = var.subnet_id - image_os = var.image_os - image_os_version = var.image_os_version - instance_shape = var.instance_shape - - } -} - -resource "oci_core_instance" "compute_instance1" { - availability_domain = local.ads[0] - compartment_id = local.compartment_id - shape = var.instance_shape - preserve_boot_volume = false - freeform_tags = var.common_tags - display_name = local.app_compute_instance1_name - - - create_vnic_details { - subnet_id = var.subnet_id - assign_public_ip = true - nsg_ids = [oci_core_network_security_group.nsg.id] - } - - source_details { - source_type = "image" - #source_id = data.oci_core_images.this.images[0].id - #source_id = "ocid1.image.oc1.iad.aaaaaaaaudkqtvbfo4mm3qyhqdrpqcatijjmml2z7ddal7hojhb2gcv34kaq" # Custom Compute - #source_id = "ocid1.image.oc1..aaaaaaaa7cr4xiwx6mbdrgfbppdypdtzyxothft2sjqftygtpxnulqmk6tla" # DB-Base Image - #source_id ="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" # microservices-2-cm - #source_id="ocid1.image.oc1.phx.aaaaaaaaw6pi7tnx2pvqgzi2lgpsicjj5cl46a3llrk6nghgbthve7f72v6a" #microservices-phx-1 - - #source_id="ocid1.image.oc1.iad.aaaaaaaa643d766gxmmzk7gul6557hnp53ul3wieu4al3qjpaiklk3mom2ba" #microservices-ash-1-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" #microservices-2-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaafwnzt3vu4ebfvrhsilrqv7i2ykv2osdmf42rjtq72nxi5qldt6ua" #microservices-ash-2-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" #microservices-2-cm - source_id = "ocid1.image.oc1.iad.aaaaaaaaobsqoqegphdipcwrmt4ji6r4ukjirxvzlc7dzvto66beijmo4exa" - - - } - metadata = { - ssh_authorized_keys = var.generate_ssh_key_pair ? tls_private_key.ssh_keypair.public_key_openssh : var.ssh_public_key - user_data = base64encode(file("./modules/compute/scripts/bootstrap_compute.sh")) - tenancy_id = var.tenancy_ocid - grabdish_application_password = var.grabdish_application_password - grabdish_database_password = var.grabdish_database_password - # app_public_repo = var.app_public_repo - # iaas_public_repo = var.iaas_public_repo - iaas_app_public_repo = var.iaas_app_public_repo - dbaas_FQDN = var.dbaas_FQDN - target_compartment_id =var.target_compartment_id - vcn_id = var.vcn_id - subnet_id = var.subnet_id - image_os = var.image_os - image_os_version = var.image_os_version - instance_shape = var.instance_shape - } -} - - - diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/outputs.tf b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/outputs.tf deleted file mode 100644 index c00cf6b37..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/outputs.tf +++ /dev/null @@ -1,23 +0,0 @@ -output "instance" { - value = oci_core_instance.compute_instance1 -} - -output "instance_keys" { - value = tls_private_key.ssh_keypair -} - -output "dbaas_public_ip" { - value = oci_core_instance.dbaas_instance1.public_ip -} - -output "dbaas_private_ip" { - value = oci_core_instance.dbaas_instance1.private_ip -} - -output "dbaas_compute_id" { - value = oci_core_instance.dbaas_instance1.id -} - -output "dbaas_display_name" { - value = oci_core_instance.dbaas_instance1.display_name -} diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstap06.17.21.sh b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstap06.17.21.sh deleted file mode 100644 index 1b5e0dc75..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstap06.17.21.sh +++ /dev/null @@ -1,428 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -APP_NAME=oci-grabdish -DEV_TOOLS_HOME=${USER_HOME}/${APP_NAME} -APP_CONFIG_FILE_NAME=config-${APP_NAME}.json -INSTALL_LOG_FILE_NAME=install-${APP_NAME}.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # OCI Development Kit Installation is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - OCI DEV KIT Usage - =================== - This instance has OCI Dev Kit such as CLI, Terraform, Ansible, SDKs (Java, Python3.6, Go, Dotnet, Ruby, Typescript) - - To update OCI Dev Kit to the latest version, run the following command: ${UPDATE_SCRIPT_FILE} - - You could use Instance Principal authentication to use the dev tools. - - For running CLI, type the following to get more help: oci --help - ================================================================================================= -" - -start=`date +%s` - -# create a configuration file - -# Config file -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >.${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Installing OCI Dev Kit" -echo "------------------------" - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Installing yum packages ######### - -echo "Packages to install ${PACKAGES_TO_INSTALL[@]}" - -sudo yum-config-manager --enable ol7_developer ol7_developer_EPEL && echo "#################### Successfully installed ol7_developer yum packages #####################" - -echo "Manually Disabling MYSQL" -sudo yum --disablerepo=ol7_MySQL80 update - -sudo yum -y install ${PACKAGES_TO_INSTALL[@]} && echo "#################### Successfully installed all yum packages #####################" - -sudo yum -y install --enablerepo=ol7_developer_nodejs10 --enablerepo=ol7_developer oci-typescript-sdk && echo "#################### Successfully installed typescript #####################" - -####### Installing yum packages -End ######### - -####### Adding OCI Modules to Powershell ######### - -sudo -u ${USER_NAME} pwsh -c Register-PSRepository -Name LocalRepository -SourceLocation /usr/lib/dotnet/NuPkgs -InstallationPolicy Trusted -sudo -u ${USER_NAME} pwsh -c "Set-Variable -Name ProgressPreference -Value SilentlyContinue; Install-Module OCI.PSModules -Repository LocalRepository" -sudo -u ${USER_NAME} pwsh -c Uninstall-Module OCI.PSModules -sudo -u ${USER_NAME} pwsh -c Unregister-PSRepository -Name LocalRepository - -####### Adding OCI Modules to Powershell -End ######### - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so ansible can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_ANSIBLE_AUTH_TYPE=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so powershell can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_PS_AUTH="InstancePrincipal"' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo 'export GOPATH=/usr/share/gocode' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci jars are in the classpath" -JAVASDK_VERSION=$(yum list java-oci-sdk | grep -o "[0-9].[0-9]\+.[0-9]\+" | head -1) -sudo -u ${USER_NAME} echo "export CLASSPATH=/usr/lib64/java-oci-sdk/lib/oci-java-sdk-full-${JAVASDK_VERSION}.jar:/usr/lib64/java-oci-sdk/third-party/lib/*" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so ruby collections are properly set" -sudo -u ${USER_NAME} echo "source scl_source enable rh-ruby27" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export GEM_PATH=/usr/share/gems:'gem env gempath'" >> ${USER_HOME}/.bashrc -echo "Adding environment variable so dotnet collections are properly set" -sudo -u ${USER_NAME} echo "source scl_source enable rh-dotnet31" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -echo "Adding environment variable for SDK analytics" -sudo -u ${USER_NAME} echo 'export OCI_SDK_APPEND_USER_AGENT=Oracle-ORMDevTools' >> ${USER_HOME}/.bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating OCI Dev Kit" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Updating OCI Dev Kit is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} < ${SSHD_BANNER_FILE} - -exec -l $SHELL - - -curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password_password')", - "grabdish_database_password": "$($CURL_METADATA_COMMAND | jq --raw-output '.grabdish_database_passwor - - - -# 344 minikube delete -# 345 minikube start --driver=none -# 346 docker container stop registry -# 347 docker container rm registry -# 348 docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -#docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2 -#docker container stop registry -#docker container rm registry - - - -# 344 minikube delete -# 345 minikube start --driver=none -# 346 docker container stop registry -# 347 docker container rm registry -# 348 docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -#docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2 -#docker container stop registry -#docker container rm registry - - - -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_ns_msdataworkshop.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_frontendpasswd.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbpasswd.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbwallet.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_ssl-certificate-secret.sh - - -docker run --name microservice-database3 -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:RDBMS_21.3.0.0.0_LINUX.X64_210709 - - - -System parameter file is /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora -Log messages written to /opt/oracle/diag/tnslsnr/ffa6a4004a14/listener/alert/log.xml -Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) -Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) - -Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) -STATUS of the LISTENER ------------------------- -Alias LISTENER -Version TNSLSNR for Linux: Version 21.0.0.0.0 - Production -Start Date 06-AUG-2021 19:20:14 -Uptime 0 days 0 hr. 0 min. 0 sec -Trace Level off -Security ON: Local OS Authentication -SNMP OFF -Listener Parameter File /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora -Listener Log File /opt/oracle/diag/tnslsnr/ffa6a4004a14/listener/alert/log.xml -Listening Endpoints Summary... - (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) - (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) -The listener supports no services -The command completed successfully - - - -docker run --name [container name] --p [host port]:1521 -p :5500 --e ORACLE_SID=[your SID] --e ORACLE_PDB=[your PDB name] --e ORACLE_PWD=[your database passwords] --e INIT_SGA_SIZE=[your database SGA memory in MB] --e INIT_PGA_SIZE=[your database PGA memory in MB] --e ORACLE_EDITION=[your database edition] --e ORACLE_CHARACTERSET=[your character set] --v [host mount point:]/opt/oracle/oradata -dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:17754 - -Parameters: - --name: The name of the container (default: auto generated) - -p: The port mapping of the host port to the container port. - Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express) - -e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB) - -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1) - -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated) - -e INIT_SGA_SIZE: - The total memory in MB that should be used for all SGA components (optional). - -e INIT_PGA_SIZE: - The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional). - -e ORACLE_EDITION: - The Oracle Database Edition (enterprise/standard). - -e ORACLE_CHARACTERSET: - The character set to use when creating the database (default: AL32UTF8) - -v /opt/oracle/oradata - The data volume to use for the database. - Has to be writable by the Unix "oracle" (uid: 54321) user inside the container! - If omitted the database will not be persisted over container recreation. - -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup - Optional: A volume with custom scripts to be run after database startup. - -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup - Optional: A volume with custom scripts to be run after database setup. - - -docker run --name db-19300-docker -p 1 - - -docker run --name microservice-database -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:17754 - -docker run --name microservice-database -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata container-registry.oracle.com/database/enterprise:latest - - - -[oracle@grabdish_docker-db1 /]$ cp ~/tnsnames.ora /opt/oracle/oradata/dbconfig/ORCL/tnsnames.ora -[oracle@grabdish_docker-db1 /]$ cp ~/tnsnames.ora /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_compute.sh b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_compute.sh deleted file mode 100644 index 4997ec2c2..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_compute.sh +++ /dev/null @@ -1,337 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -BUILD_LOG_FILE=${USER_HOME}/${APP_NAME}-build - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_LOC=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN -DOCKER_CERTS_DIR=${INFRA_INSTALL_DIR}/oci-iaas/grabdish-adapter/infrastructure - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -ORACLE_HOME="/usr/lib/oracle/19.11/client64" # For Oracle 19c client - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" -DOCKER_REG_CMD="docker run -d \ - --restart=always \ - --name registry \ - -v "$DOCKER_CERTS_DIR"/certs:/certs \ - -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - -p 443:443 \ - registry:2" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - printf "\360\237\220\261 ${print_header_count}.: $1\n" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - printf "\360\237\246\204 ${print_header_count}.${print_subheader_count}.: [INFO] $1\n" - return - } - - -start=$(date +%s) - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} ${BUILD_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} ${BUILD_LOG_FILE} - - -# Sending all stdout and stderr to log file -exec >>${INSTALL_LOG_FILE} -exec 2>&1 - - -print_header "Starting Microservices Data-driven Infrastructure installation process at $(date)" - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -print_header "Creating Microservices Data-driven Infrastructure Configuration File." - -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >>${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >>${SSHD_CONFIG_FILE} -print_subheader "SSHD Banner created" -sudo systemctl restart sshd.service | -print_subheader "Restarted SSHD Service" - -####### Adding environment variables ######### -print_header "Creating Environment Variables" -print_subheader "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -print_subheader "Adding Oracle Home and Path variables to bashrc" -sudo -u ${USER_NAME} echo "export ORACLE_HOME=${ORACLE_HOME}" >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TNS_ADMIN=${TNS_ADMIN_LOC}" >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="${ORACLE_HOME}"' >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >>${USER_HOME}/.bashrc -print_subheader "Completed" - -print_subheader "Adding APP_INSTALL_DIR and INFRA_INSTALL_DIR variables to bashrc" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "source <(kubectl completion bash)" >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >>${USER_HOME}/.bashrc -print_subheader "Completed" - -####### Adding environment variables - End ######### - - - -# Clone Application and Infrastructure Resource Files -print_header "Downloading Microservices Infrastructure and Application from public repositories" -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR -print_subheader "Created destination directories $APP_INSTALL_DIR and $INFRA_INSTALL_DIR" - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') -iaas_app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_app_public_repo') - -print_subheader "Downloading Application code from $app_public_repo " -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR - -print_subheader "Downloading Infrastructure code from $iaas_public_repo" -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} mkdir -p $DOCKER_CERTS_DIR/certs -print_subheader "Granting read, write and execute permissions to users" -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -print_subheader "Completed" - - -######################################### TO DO ########### - -# Infrastructure to Grabdish Application Bridge - -print_header "Initialing Infrastructure to Grabdish Application Bridge" -#update tnsnames.ora -print_subheader "Updating TNS ORA " -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -print_subheader "Updating TNSNAMES and Listener ORA Files" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -#No Need for TEMP DIR -- refactor code later -sudo -u ${USER_NAME} cp $TEMP_DIR/*.ora ${TNS_ADMIN_LOC}/. - -print_subheader "Opening Firewall Port for HTTP/S, SQLNET Traffic" -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --permanent --add-port=443/tcp -sudo firewall-cmd --permanent --add-port=80/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all -print_subheader "Firewall Port opened" - -print_header "Installing required infrastructure components" - -sudo chmod 666 /var/run/docker.sock - -print_subheader "Deleting previous installation of Minikube" -sudo su - ${USER_NAME} bash -c "minikube delete" - -print_subheader "Restarting Docker" -sudo systemctl restart docker - -print_subheader "Restarting Minikube cluster" -#sudo su - ${USER_NAME} bash -c "minikube start --driver=docker" # encountering issue with https docker reg -sudo su - ${USER_NAME} bash -c "minikube start --driver=none" - -print_subheader "Enabling Ingress on K8 Cluster" -sudo su - ${USER_NAME} bash -c "minikube addons enable ingress" - -print_subheader "Starting Docker Registry" -sudo su - ${USER_NAME} bash -c "docker container stop registry && docker container rm -v registry" -#sudo su - ${USER_NAME} bash -c "docker run -d -p 5000:5000 --restart=always --name registry registry:2" - -print_subheader "Granting writing privilges to user ${USER_NAME}" -sudo chown -R opc:opc $DOCKER_CERTS_DIR - -print_subheader "Creating SSL certificates for Docker Registry" -sudo su - ${USER_NAME} bash -c "openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${DOCKER_CERTS_DIR}/certs/domain.key -out ${DOCKER_CERTS_DIR}/certs/domain.crt -subj \"/CN=grabdish/O=grabdish\"" -#print_subheader "Created Docker Certificate" - -#sudo su - ${USER_NAME} bash -c "cd$ DOCKER_CERTS_DIR; $DOCKER_REG_CMD" # Docker Pull is failing -sudo su - ${USER_NAME} bash -c "docker run -d -p 5000:5000 --restart=always --name registry registry:2" - -print_header "Creating Secrets" -print_subheader "Creating namespace" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_ns_msdataworkshop.sh" -print_subheader "Creating Secret frontendpasswd" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_frontendpasswd.sh" -print_subheader "Creating Secret dbuser" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbpasswd.sh" -print_subheader "Creating Secret dbwallet" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbwallet.sh" -print_subheader "Creating Secret ssl-certificate-secret" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_ssl-certificate-secret.sh" -print_subheader "Completed" - -# These states are required for the Grabdish application build process to work -print_header "Creating States required for Grabdish Application" -print_subheader "These states are required for the Grabdish application build process to work" -sudo su - ${USER_NAME} bash -c "state_set_done OBJECT_STORE_BUCKET" -sudo su - ${USER_NAME} bash -c "state_set_done ORDER_DB_OCID" -sudo su - ${USER_NAME} bash -c "state_set_done INVENTORY_DB_OCID" -sudo su - ${USER_NAME} bash -c "state_set_done WALLET_GET" -sudo su - ${USER_NAME} bash -c "state_set_done CWALLET_SSO_OBJECT" -sudo su - ${USER_NAME} bash -c "state_set_done DB_PASSWORD" -sudo su - ${USER_NAME} bash -c "state_set ORDER_DB_NAME orders" -sudo su - ${USER_NAME} bash -c "state_set INVENTORY_DB_NAME inventory" -#sudo su - ${USER_NAME} bash -c "state_set DOCKER_REGISTRY localhost:443" -sudo su - ${USER_NAME} bash -c "state_set DOCKER_REGISTRY localhost:5000" -print_subheader "Completed" - - -lab1_start=$(date +%s) - -print_header "Building Lab 1" - -print_subheader "Creating Jaeger Microservice" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_service_jaeger.sh" -print_subheader "Started Jaeger Service" - - -print_subheader "Building frontend-helidon Microservice" -sudo su - ${USER_NAME} bash -c "cd ${APP_INSTALL_DIR}/grabdish/frontend-helidon;time ./build.sh > ${BUILD_LOG_FILE}-frontend-helidon.log;./deploy.sh " - -print_subheader "Completed" - -print_subheader "Creating Frontend Microservice" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml" -print_subheader "Completed" - -print_subheader "Creating Frontend Ingress" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml" -print_subheader "Completed" - -MICROSERVICES="order-helidon supplier-helidon-se inventory-helidon" - -print_subheader "Building ${MICROSERVICES}" - -for service_name in $MICROSERVICES; do - print_subheader "Creating Microservice ${service_name}" - sudo su - ${USER_NAME} bash -c "cd ${APP_INSTALL_DIR}/grabdish/${service_name}; time ./build.sh>> ${BUILD_LOG_FILE}-${service_name}.log;./deploy.sh " - print_subheader "${service_name} Completed" - done - -lab1_end=$(date +%s) - -print_subheader "Lab 1 Build took $((lab1_end - lab1_start)) seconds" - -end=$(date +%s) - -executionTime=$((end - start)) - - -print_header "Provisioning Completed at $(date)" -print_header "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. Took ${executionTime} seconds" - - -sudo echo "${USAGE_INFO}" >${SSHD_BANNER_FILE} - - - diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database.sh b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database.sh deleted file mode 100644 index ecd24176b..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database.sh +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -#APP_INSTALL_DIR=${USER_HOME}/microservices-datadriven -#INFRA_INSTALL_DIR=${USER_HOME}/microservices-datadriven-infra -#INFRA_HOME=${USER_HOME}/microservices-datadriven-infra - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_DIR=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -#ORACLE_HOME=/opt/oracle/product/21c/dbhome_1 # for Docker -ORACLE_HOME="/usr/lib/oracle/19.11/client64" # for Docker Host -- i.e. Compute - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# Starting Microservices Data-driven Infrastructure installation process at ${start} " | tee -a ${INSTALL_LOG_FILE} -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -echo "" | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# 1. Create Microservices Datadriven Infrastructure Configuration File." | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating Microservices Datadriven Infrastructure" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Update Installation of Database is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -#Post Provisioning - -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all - - -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -sudo -u ${USER_NAME} echo $app_public_repo -sudo -u ${USER_NAME} echo $iaas_public_repo - - -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -sudo -u ${USER_NAME} echo "#################################### 1 ####################################" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 3 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export PATH=$ORACLE_HOME/bin:$PATH >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" - -sudo -u ${USER_NAME} echo "#################################### 4 ####################################" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 5 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 6 ####################################" -#update tnsnames.ora -sudo -u ${USER_NAME} bash -c "source ${USER_HOME}/.bashrc" -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -sudo -u ${USER_NAME} echo "#################################### 7 ####################################" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora - -sudo -u ${DBUSER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${DBUSER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" - -#use su - instead of sudo - u -sudo -u ${USER_NAME} echo "#################################### 8 ####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo "################################### 9 #####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc;source ${APP_INSTALL_DIR}/grabdish/env.sh;${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_setup.sh" - -sudo -u ${USER_NAME} echo "################################### 10 #####################################" - -end=`date +%s` - -executionTime=$((end-start)) - -echo "--------------------------------------------------------------" -echo "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} - -exec -l $SHELL \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database062121.sh b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database062121.sh deleted file mode 100644 index abefecc6a..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database062121.sh +++ /dev/null @@ -1,268 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -#APP_INSTALL_DIR=${USER_HOME}/microservices-datadriven -#INFRA_INSTALL_DIR=${USER_HOME}/microservices-datadriven-infra -#INFRA_HOME=${USER_HOME}/microservices-datadriven-infra - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - Microservices Datadriven Infrastructure is now available for usage - - For additional details regarding Microservices Datadriven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# Starting Microservices Data-driven Infrastructure installation process at ${start} " | tee -a ${INSTALL_LOG_FILE} -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -echo "" | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# 1. Create Microservices Datadriven Infrastructure Configuration File." | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating Microservices Datadriven Infrastructure" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Update Installation of Database is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -#Post Provisioning - -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all - - -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -sudo -u ${USER_NAME} echo $app_public_repo -sudo -u ${USER_NAME} echo $iaas_public_repo - - -whoami - -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -sudo -u ${USER_NAME} echo "#################################### 1 ####################################" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 3 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export PATH=$ORACLE_HOME/bin:$PATH >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" - -sudo -u ${USER_NAME} echo "#################################### 4 ####################################" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 5 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 6 ####################################" -#update tnsnames.ora -sudo -u ${USER_NAME} bash -c "source ${USER_HOME}/.bashrc" -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -sudo -u ${USER_NAME} echo "#################################### 7 ####################################" -sudo -u ${USER_NAME} $INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora - -sudo -u ${DBUSER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${DBUSER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" - -sudo -u ${USER_NAME} echo "#################################### 8 ####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - - -sudo -u ${USER_NAME} echo "################################### 9 #####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc;source ${APP_INSTALL_DIR}/grabdish/env.sh;${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_setup.sh" - -sudo -u ${USER_NAME} echo "################################### 10 #####################################" -end=`date +%s` - -executionTime=$((end-start)) - -echo "--------------------------------------------------------------" -echo "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} - -exec -l $SHELL \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database_docker.sh b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database_docker.sh deleted file mode 100644 index d3a84edbf..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/bootstrap_database_docker.sh +++ /dev/null @@ -1,253 +0,0 @@ -#!/bin/bash - -# shellcheck disable=SC2218 - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_DIR=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -ORACLE_HOME=/opt/oracle/product/21c/dbhome_1 # for Docker -DB_PASSWORD="$(curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password')" - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage. - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - echo "# ${print_header_count}.: $1" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - echo "#${print_header_count}.${print_subheader_count}.: [INFO] $1" - return - } - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - - -# Sending all stdout and stderr to log file -exec >> ${INSTALL_LOG_FILE} -exec 2>&1 - -print_header "Starting Microservices Data-driven Infrastructure installation process at $(date)" - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### - -print_header "Creating Microservices Datadriven Infrastructure Configuration File." -cat >${APP_CONFIG_FILE} < ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### - -print_header "Creating Environment Variables" -print_subheader "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -#sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export TNS_ADMIN="${TNS_ADMIN_DIR}/" >> ${USER_HOME}/.bashrc - -print_subheader "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc -print_subheader "Completed." - -####### Adding environment variables - End ######### - -#Post Provisioning -print_header "Adding port 1521 to the firewall" -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload[] -sudo firewall-cmd --list-all -print_subheader "Completed." - -print_header "Downloading Microservices Infrastructure and Application from public repositories" -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -print_subheader $app_public_repo -print_subheader $iaas_public_repo - -print_subheader "Downloading Infrastructure from $iaas_public_repo to $APP_INSTALL_DIR" -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -print_subheader "Download Completed" - -print_subheader "Downloading Application from $app_public_repo to $APP_INSTALL_DIR" -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -print_subheader "Download Completed" - -sudo chmod -R 755 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -print_header "Updating Database tnsnames.ora, sqlnet.ora and listeners.ora files to match target database" - -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -print_subheader "Creating new tnsnames.ora, sqlnet.ora and listeners.ora file" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -print_subheader "Copying tnsnames.ora" -#sudo -u ${USER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -#sudo -u ${USER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora -sudo -u ${USER_NAME} cp $TEMP_DIR/tnsnames.ora ${TNS_ADMIN_DIR}/. - -print_subheader "Copying listeners.ora" -#sudo -u ${USER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -#sudo -u ${USER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora -sudo -u ${USER_NAME} cp $TEMP_DIR/listeners.ora ${TNS_ADMIN_DIR}/. - -print_subheader "Copying sqlnet.ora" -#sudo -u ${DBUSEUSER_NAMER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -#sudo -u ${USER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" -sudo -u ${USER_NAME} cp $TEMP_DIR/sqlnet.ora ${TNS_ADMIN_DIR}/. -print_subheader "Completed" - - -#use su - instead of sudo - u -#print_subheader "#################################### 8 ####################################" -#sudo -u ${USER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -#print_subheader "################################### 9 #####################################" -#sudo su - ${USER_NAME} bash -c "${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_docker_setup.sh" -# database is already pre-provisioned for the docker image - -print_header "Changing Database System and Grabdish Application Passwords." - -sudo su - $USER_NAME bash -c "docker exec microservice-database bash -c \"${DBUSER_HOME}/setPassword.sh ${DB_PASSWORD}\"" -print_subheader "Changed SYSTEM Password" - -sudo su - $USER_NAME bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/change_passwd_orders.sh" -print_subheader "Changed ORDER PDB Password" - -sudo su - $USER_NAME bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/change_passwd_inventory.sh" -print_subheader "Changed INVENTORY PDB Password" - -end=`date +%s` - -executionTime=$((end-start)) - -print_header "Installation of Oracle Microservices Infrastructure and Data-driven Application completed at $(date)" -print_subheader "It took ${executionTime} seconds" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/create_custom_image.sh b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/create_custom_image.sh deleted file mode 100644 index 95162e2ba..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/create_custom_image.sh +++ /dev/null @@ -1,32 +0,0 @@ -python36 -oci-ansible-collection -oci oci-cli -go-toolset -jdk-16.0.1.0.1.x86_64 -git -gnupg2 curl tar -ruby -nodejs:14 -node-oracledb-node14 -oci-dotnet-sdk -maven -libnsl -instantclient19.11-basic -instantclient19.11-sqlplus -instantclient19.11-tools -graalvm -Docker -Docker Registry -Minikube -Ingress Controller - - - -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-basic-19.11.0.0.0-1.x86_64.rpm -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-sqlplus-19.11.0.0.0-1.x86_64.rpm -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-tools-19.11.0.0.0-1.x86_64.rpm - -curl -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-aarch64-20.2.0.tar.gz | tar xz -~/graalvm-ce-java11-20.2.0/bin/gu install native-image - -#kubcetl, minikube, docker, docker registry diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/temp.sh b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/temp.sh deleted file mode 100644 index 3fe1254c8..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/scripts/temp.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -BUILD_LOG_FILE=${USER_HOME}/${APP_NAME}-build - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_LOC=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN -DOCKER_CERTS_DIR=${INFRA_INSTALL_DIR}/oci-iaas/grabdish-adapter/infrastructure - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 - - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" -DOCKER_REG_CMD="docker run -d \ - --restart=always \ - --name registry \ - -v "$DOCKER_CERTS_DIR"/certs:/certs \ - -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - -p 443:443 \ - registry:2" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - echo "# ${print_header_count}.: $1" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - echo "#${print_header_count}.${print_subheader_count}.: [INFO] $1" - return - } - - -# Sending all stdout and stderr to log file -exec >>${INSTALL_LOG_FILE} -exec 2>&1 - -start=$(date +%s) - -# Log file - -print_header "Building Lab 1" - -print_subheader "Creating Jaeger Microservice" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_service_jaeger.sh" -print_subheader "Started Jaeger Service" - - -print_subheader "Building frontend-helidon Microservice" -sudo su - ${USER_NAME} bash -c "cd ${GRABDISH_HOME}/frontend-helidon;time ./build.sh > ${BUILD_LOG_FILE}-frontend-helidon.log;./deploy.sh " - -print_subheader "Completed" - -print_subheader "Creating Frontend Microservice" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml" -print_subheader "Completed" - -print_subheader "Creating Frontend Ingress" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml" -print_subheader "Completed" - -MICROSERVICES="order-helidon supplier-helidon-se inventory-helidon" - -print_subheader "Building ${MICROSERVICES}" - -for service_name in $MICROSERVICES; do - print_subheader "Creating Microservice ${service_name}" - sudo su - ${USER_NAME} bash -c "cd ${GRABDISH_HOME}/${service_name}; time ./build.sh>> ${BUILD_LOG_FILE}-${service_name}.log;./deploy.sh " - print_subheader "${service_name} Completed" - done - - -end=$(date +%s) - -executionTime=$((end - start)) - - -print_header "Provisioning Completed" -print_subheader "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" -print_subheader "" - - - - diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/variables.tf b/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/variables.tf deleted file mode 100644 index 11c99bbdf..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/compute/variables.tf +++ /dev/null @@ -1,90 +0,0 @@ -variable "tenancy_ocid" {} -variable "region" {} - -variable "target_compartment_id" { - description = "OCID of the compartment where the compute is being created" - type = string -} - -variable "vcn_id" { - description = "VCN OCID where the instance is going to be created" - type = string -} - -variable "subnet_id" { - description = "Subnet OCID where the instance is going to be created" - type = string -} - -variable "image_os" { - default = "Oracle Linux" -} - -variable "image_os_version" { - default = "8" -} - -variable "instance_shape" { - description = "Shape of the instance" - type = string -} - -variable "generate_ssh_key_pair" { - description = "Auto-generate SSH key pair" - type = string -} - -variable "ssh_public_key" { - description = "ssh public key used to connect to the compute instance" - type = string -} - -variable "use_tenancy_level_policy" { - description = "Compute instance to access all resources at tenancy level" - type = bool -} - -variable "common_tags" { - description = "Tags" - type = map(string) -} - -variable "generate_app_db_passwords" { - description = "Auto-generate Grabdish Application and Database Passwords" - type = string -} - -variable "grabdish_database_password" { - description = "grabdish_database_password" - type = string -} - -variable "grabdish_application_password" { - description = "grabdish_application_password" - type = string -} -/* -variable "iaas_public_repo" { - description = "Repository URI to execute post provisioning infrastructure setup scripts" - type = string - #default = "" -} - -variable "app_public_repo" { - description = "Repository URI to execute post provisioning Application setup scripts" - type = string - #default = "" -} -*/ -variable "iaas_app_public_repo" { - description = "Repository URI to execute Infrastructure and Application provisioning setup scripts" - type = string - #default = "" -} - -variable "dbaas_FQDN" { - description = "dbaas_FQDN" - type = string -} - - diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/main.tf b/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/main.tf deleted file mode 100644 index 7941e4d7b..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/main.tf +++ /dev/null @@ -1,65 +0,0 @@ -locals { - compartment_id = var.target_compartment_id - display_name = "microservices" - vcn_dns_label = "onpremise" - vcn_cidr_block = "10.0.0.0/16" - subnet_cidr_block = "10.0.1.0/24" - all_cidr = "0.0.0.0/0" - vcn_id = oci_core_vcn.this.id -} - -# VCN -resource "oci_core_vcn" "this" { - compartment_id = local.compartment_id - cidr_block = local.vcn_cidr_block - display_name = "${local.display_name}-vcn" - dns_label = local.vcn_dns_label - freeform_tags = var.common_tags -} - -# internet gateway to connect to compute instance - internet gateway is for the VCN - -resource "oci_core_internet_gateway" "ig" { - # count = local.use_existing_vcn ? 0 : 1 - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-internet-gateway" # Optional - freeform_tags = var.common_tags -} - -resource "oci_core_route_table" "rt" { #TODO - change the name to "rt" instead of "subnet" - # count = local.use_existing_vcn ? 0 : 1 - compartment_id = local.compartment_id - vcn_id = local.vcn_id - display_name = "${local.display_name}-route-table" - - route_rules { - destination = local.all_cidr - destination_type = "CIDR_BLOCK" - network_entity_id = oci_core_internet_gateway.ig.id - } - - freeform_tags = var.common_tags -} - -resource "oci_core_security_list" "sl" { - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-security-list" # Optional - freeform_tags = var.common_tags - - # Intentionally left ingress and egress rules blank. Expected to set the NSG at the instance level -} - -#subnet -resource "oci_core_subnet" "regional_sn" { - cidr_block = local.subnet_cidr_block # Required - compartment_id = var.target_compartment_id # Required - vcn_id = local.vcn_id # Required - route_table_id = oci_core_route_table.rt.id # Optional - But Required in this case to associate the above created Route table - security_list_ids = [oci_core_security_list.sl.id] # Optional - defined a security list that has NO ingress and egress rules - display_name = "${local.display_name}-subnet" # Optional - freeform_tags = var.common_tags - dns_label = local.display_name - //prohibit_public_ip_on_vnic = false -} diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/outputs.tf b/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/outputs.tf deleted file mode 100644 index 6b44c72c8..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/outputs.tf +++ /dev/null @@ -1,11 +0,0 @@ -output "vcn" { - value = oci_core_vcn.this -} - -output "subnet" { - value = oci_core_subnet.regional_sn -} - -output "subnet_domain_name" { - value = oci_core_subnet.regional_sn.subnet_domain_name -} diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/variables.tf b/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/variables.tf deleted file mode 100644 index 49a404bf9..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/modules/network/variables.tf +++ /dev/null @@ -1,9 +0,0 @@ -variable "target_compartment_id" { - description = "OCID of the compartment where the VCN is being created" - type = string -} - -variable "common_tags" { - description = "Tags" - type = map(string) -} \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/outputs.tf b/infra/oci-iaas/resource_manager/single-node-deployment/outputs.tf deleted file mode 100644 index 0284d7004..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/outputs.tf +++ /dev/null @@ -1,63 +0,0 @@ -locals { - app_password = var.generate_app_db_passwords ? random_string.grabdish_application_password.result : var.grabdish_application_password -} -output "compute_instance_public_ip" { - value = module.compute.instance.public_ip -} - -output "compartment_id" { - value = var.compartment_ocid -} - -output "generated_instance_ssh_private_key" { - value = var.generate_ssh_key_pair ? module.compute.instance_keys.private_key_pem : "" -} - -output "dbaas_public_ip" { - value = module.compute.dbaas_public_ip -} - -output "dbaas_private_ip" { - value = module.compute.dbaas_private_ip -} - -output "FQDN_database_SN" { - value = module.network.subnet -} - -output "dbaas_FQDN" { - value = join(".", [module.compute.dbaas_display_name,module.network.subnet_domain_name]) -} - -output "Database_Password"{ - value = var.generate_app_db_passwords ? random_string.grabdish_database_password.result : var.grabdish_database_password -} - -output "Grabdish_Application_Password"{ - value = local.app_password -} - -output "Login_Instructions" { - #type = URL - value = "Login to http://${module.compute.instance.public_ip} using username: grabdish password: ${local.app_password} " -} - -/* -output "dbaas_password"{ - value = var.grabdish_database_password -} - -output "app_password"{ - value = var.grabdish_application_password -} -*/ -/* -output "Database_Password"{ - value = module.compute.Grabdish_Application_Password -} - -output "Grabdish_Application_Password"{ - value = module.compute.On_Premise_Database_Password -} - -*/ \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/provider.tf b/infra/oci-iaas/resource_manager/single-node-deployment/provider.tf deleted file mode 100644 index 569565755..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/provider.tf +++ /dev/null @@ -1,10 +0,0 @@ -provider "oci" { - tenancy_ocid = var.tenancy_ocid - region = var.region -} - -provider "tls" { - -} - - diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/schema.yaml b/infra/oci-iaas/resource_manager/single-node-deployment/schema.yaml deleted file mode 100644 index ad1ba01ce..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/schema.yaml +++ /dev/null @@ -1,187 +0,0 @@ -title: Grabdish - Microservices Data-driven application on Oracle Converged Database -description: Grabdish - Microservices Data-driven application on Oracle Converged Database -stackDescription: Grabdish - Microservices Data-driven application on Oracle Converged Database -informationalText: Grabdish - Microservices Data-driven application on Oracle Converged Database -schemaVersion: 1.1.0 -version: "20200822" -locale: "en" - -variableGroups: - - title: General Configuration - visible: false - variables: - - compartment_ocid - - tenancy_ocid - - region - - - title: Required Configuration for Microservices Datadriven Application Grabdish - visible: true - variables: - - instance_shape - - generate_ssh_key_pair - - ssh_public_key - - generate_app_db_passwords - - grabdish_application_password - - grabdish_database_password - - use_tenancy_level_policy - - iaas_app_public_repo - #- iaas_public_repo - #- app_public_repo - -variables: - # General Configuration - tenancy_ocid: - title: Tenancy ID - description: The Oracle Cloud Identifier (OCID) for your tenancy - type: string - required: true - visible: false - - region: - title: Region To Provision the Compute and Database Resources - description: Region To Provision the Compute and Database Resources - type: oci:identity:region:name - required: true - visible: false - - compartment_ocid: - title: Compartment OCID - description: Compartment OCID - type: oci:identity:compartment:id - required: true - visibile: false - - # Required - instance_shape: - title: Instance Shape - description: Instance Shape - type: oci:core:instanceshape:name - default: VM.Standard.E2.1.Micro - required: true - dependsOn: - compartmentId: ${compartment_ocid} - - generate_ssh_key_pair: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.generate_ssh_key_pair.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.generate_ssh_key_pair.description()} - type: boolean - default: true - required: true - - generate_app_db_passwords: - title: Auto-generate Grabdish Application and Database Passwords - description: Automatically generate Grabdish Application and Database Passwords - type: boolean - default: true - required: true - - ssh_public_key: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.ssh_public_key.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.ssh_public_key.description()} - type: oci:core:ssh:publickey - required: false - additionalProps: - allowMultiple: true - pattern: "((^(ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)(,((ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)*$" - visible: - not: - - generate_ssh_key_pair - - use_tenancy_level_policy: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.use_tenancy_level_policy.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.use_tenancy_level_policy.description()} - type: boolean - default: true - required: true - - grabdish_database_password: - description: Provide database password. it will be used for creating admin, order_user, inventory_user for Order and Inventory PDBs. (Must be a minimum 12 characters, contain at least one uppercase letter, one lowercase letter, one number , no special characters allowed). This password will be made available to you as an output variable. - type: password - minLength: 12 - maxLength: 30 - pattern: ^[A-Za-z][A-Za-z0-9]+$ - required: true - #default: OraDB4U12345 - visible: - not: - - generate_app_db_passwords - - grabdish_application_password: - description: Provide database password. it will be used for admin, wallet and application , cannot have the word "usage" in the passowrd, (Must be a minimum 12 characters, contain at least one uppercase letter, one lowercase letter, one number , no special characters allowed). - type: password - minLength: 12 - maxLength: 30 - pattern: ^[A-Za-z][A-Za-z0-9]+$ - required: true - #default: Welcome12345 - visible: - not: - - generate_app_db_passwords - - #iaas_public_repo: - # title: Post Provisioning Infrastructure Setup URL - # description: Repository URI to execute post provisioning infrastructure scripts - # type: String - # #minLength: 12 - # #maxLength: 30 - # pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - # required: true - # #default: Welcome12345 - - #app_public_repo: - # title: Post Provisioning Application Setup URL - # description: Repository URI to execute post provisioning application scripts - # type: String - # #minLength: 12 - # #maxLength: 30 - # pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - # required: true - # #default: Welcome12345 - - iaas_app_public_repo: - title: Infrastructure and Application Setup URL - description: Repository URI to execute Infrastructure and Application provisioning scripts - type: String - #minLength: 12 - #maxLength: 30 - pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - required: true - #default: Welcome12345 - -outputGroups: - - title: outputGroups - outputs: - - compute_instance_public_ip - - compartment_id - - generated_instance_ssh_private_key - - title: On Premise Database details - outputs: - - dbaas_instance_public_ip - - generated_instance_ssh_private_key - -outputs: - compute_instance_public_ip: - title: compute_instance_public_ip - displayText: compute_instance_public_ip - type: copyableString - visible: true - - compartment_id: - title: compartment_id - displayText: compartment_id - type: string - visible: true - - generated_instance_ssh_private_key: - title: generated_instance_ssh_private_key - displayText: generated_instance_ssh_private_key - type: string - visible: true - - dbaas_instance_public_ip: - title: Database Public IP Address - displayText: module.compute.dbaas_public_ip - type: copyableString - visible: true - - diff --git a/infra/oci-iaas/resource_manager/single-node-deployment/variables.tf b/infra/oci-iaas/resource_manager/single-node-deployment/variables.tf deleted file mode 100644 index 130daf431..000000000 --- a/infra/oci-iaas/resource_manager/single-node-deployment/variables.tf +++ /dev/null @@ -1,93 +0,0 @@ -variable "tenancy_ocid" {} -variable "region" {} -variable "compartment_ocid" {} - -/* -resource "random_password" "onprem_dbaas_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} - -resource "random_password" "onprem_application_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} -*/ - - -variable "instance_shape" { - description = "Shape of the instance" - type = string -} - -variable "generate_ssh_key_pair" { - description = "Auto-generate SSH key pair" - type = string -} - -variable "ssh_public_key" { - description = "ssh public key used to connect to the compute instance" - default = "" # This value has to be defaulted to blank, otherwise terraform apply would request for one. - type = string -} - -variable "use_tenancy_level_policy" { - description = "Compute instance to access all resources at tenancy level" - type = bool -} - -variable "generate_app_db_passwords" { - description = "Automatically generate Grabdish Application and Database Passwords" - type = string -} - -variable "grabdish_database_password" { - description = "grabdish_database_password" - type = string - default = "OraDB4U13579" - -} - -variable "grabdish_application_password" { - description = "grabdish_application_password" - type = string - default = "Welcome12345" - -} - - -variable "iaas_app_public_repo" { - description = "Repository URI to execute infrastructure and application setup scripts" - type = string - default = "git clone -b main --single-branch https://github.com/vishalmmehra/microservices-datadriven" - #default = "" -} - -/* -variable "iaas_public_repo" { - description = "Repository URI to execute infrastructure setup scripts" - type = string - default = "git clone -b master --single-branch https://github.com/vishalmmehra/microservices-datadriven-infra/" - #default = "" -} - - -variable "app_public_repo" { - description = "Repository URI to execute post provisioning Application setup scripts" - type = string - default = "git clone -b 21.6.1 --single-branch https://github.com/oracle/microservices-datadriven.git" - #default = "" -} - -*/ - diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/license.txt b/infra/oci-iaas/resource_manager/singlenode-deployment/license.txt deleted file mode 100644 index fa0264737..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/license.txt +++ /dev/null @@ -1,30 +0,0 @@ - - - Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. - - The Universal Permissive License (UPL), Version 1.0 - - Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this - software, associated documentation and/or data (collectively the "Software"), free of charge and under any and - all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor - hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or - (ii) the Larger Works (as defined below), to deal in both - - (a) the Software, and - (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software - (each a “Larger Work” to which the Software is contributed by such licensors), - - without restriction, including without limitation the rights to copy, create derivative works of, display, - perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have - sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms. - - This license is subject to the following condition: - The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must - be included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/main.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/main.tf deleted file mode 100644 index b5900c6e7..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/main.tf +++ /dev/null @@ -1,53 +0,0 @@ -locals { - common_tags = { - Reference = "on-prem-micro-svc" - } -} - -resource "random_string" "grabdish_database_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 0 - override_special = "^[A-Za-z][A-Za-z0-9]+$" -} - -resource "random_string" "grabdish_application_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} - -module "network" { - source = "./modules/network" - target_compartment_id = var.compartment_ocid - common_tags = local.common_tags - #display_name_prefix = var.new_network_prefix - # dns_label = var.new_network_prefix -} - -module "compute" { - source = "./modules/compute" - region = var.region - tenancy_ocid = var.tenancy_ocid - target_compartment_id = var.compartment_ocid - vcn_id = module.network.vcn.id - subnet_id = module.network.subnet.id - instance_shape = var.instance_shape - generate_ssh_key_pair = var.generate_ssh_key_pair - ssh_public_key = var.ssh_public_key - generate_app_db_passwords = var.generate_app_db_passwords - use_tenancy_level_policy = var.use_tenancy_level_policy - common_tags = local.common_tags - grabdish_database_password = var.generate_app_db_passwords ? random_string.grabdish_database_password.result : var.grabdish_database_password - grabdish_application_password = var.generate_app_db_passwords ? random_string.grabdish_application_password.result : var.grabdish_application_password - iaas_public_repo = var.iaas_public_repo - app_public_repo = var.app_public_repo - dbaas_FQDN = join(".", [module.compute.dbaas_display_name,module.network.subnet_domain_name]) -} \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/main.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/main.tf deleted file mode 100644 index 891366d06..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/main.tf +++ /dev/null @@ -1,278 +0,0 @@ -locals { - compartment_id = var.target_compartment_id - vcn_id = var.vcn_id - all_cidr = "0.0.0.0/0" - current_time = formatdate("YYYYMMDDhhmmss", timestamp()) - app_name = "grabdish-microsvc" - app_compute_instance1_name = "grabdish-compute1" - app_db_instance1_name = "grabdish-database1" - display_name = join("-", [local.app_name, local.current_time]) - compartment_name = data.oci_identity_compartment.this.name - grabdish_app_password = var.grabdish_application_password - grabdish_db_password = var.grabdish_database_password - dynamic_group_tenancy_level = "Allow dynamic-group ${oci_identity_dynamic_group.for_instance.name} to manage all-resources in tenancy" - dynamic_group_compartment_level = "Allow dynamic-group ${oci_identity_dynamic_group.for_instance.name} to manage all-resources in compartment ${local.compartment_name}" - num_of_ads = length(data.oci_identity_availability_domains.ads.availability_domains) - ads = local.num_of_ads > 1 ? flatten([ - for ad_shapes in data.oci_core_shapes.this : [ - for shape in ad_shapes.shapes : ad_shapes.availability_domain if shape.name == var.instance_shape - ] - ]) : [for ad in data.oci_identity_availability_domains.ads.availability_domains : ad.name] -} - - -resource "oci_core_network_security_group" "nsg" { - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-security-group" # Optional - freeform_tags = var.common_tags -} - -resource "oci_core_network_security_group_security_rule" "ingress_ssh" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "22" # Required - min = "22" # Required - } - } - description = "ssh only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_https" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "443" # Required - min = "443" # Required - } - } - description = "https only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_http" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "80" # Required - min = "80" # Required - } - } - description = "http only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_sqlnet" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "6" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - tcp_options { # Optional - destination_port_range { # Optional - max = "1521" # Required - min = "1521" # Required - } - } - description = "sqlnet 1521 only allowed" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_icmp_3_4" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "1" # Required - source = local.all_cidr # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - icmp_options { # Optional - type = "3" # Required - code = "4" # Required - } - description = "icmp option 1" # Optional -} - -resource "oci_core_network_security_group_security_rule" "ingress_icmp_3" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "INGRESS" # Required - protocol = "1" # Required - source = "10.0.0.0/16" # Required - source_type = "CIDR_BLOCK" # Required - stateless = false # Optional - icmp_options { # Optional - type = "3" # Required - } - description = "icmp option 2" # Optional -} - -resource "oci_core_network_security_group_security_rule" "egress" { - network_security_group_id = oci_core_network_security_group.nsg.id # Required - direction = "EGRESS" # Required - protocol = "6" # Required - destination = local.all_cidr # Required - destination_type = "CIDR_BLOCK" # Required - stateless = false # Optional - description = "connect to any network" -} - -# Get a list of Availability Domains -data "oci_identity_availability_domains" "ads" { - compartment_id = var.tenancy_ocid -} - -data "oci_core_images" "this" { - compartment_id = local.compartment_id # Required - operating_system = var.image_os # Optional - operating_system_version = var.image_os_version # Optional - shape = var.instance_shape # Optional - sort_by = "TIMECREATED" # Optional - sort_order = "DESC" # Optional -} - -data "oci_core_shapes" "this" { - count = local.num_of_ads > 1 ? local.num_of_ads : 0 - #Required - compartment_id = local.compartment_id - - #Optional - availability_domain = data.oci_identity_availability_domains.ads.availability_domains[count.index].name - image_id = data.oci_core_images.this.images[0].id -} - -data "oci_identity_compartment" "this" { - id = local.compartment_id -} - -# Generate the private and public key pair -resource "tls_private_key" "ssh_keypair" { - algorithm = "RSA" # Required - rsa_bits = 2048 # Optional -} - -resource "oci_identity_dynamic_group" "for_instance" { - compartment_id = var.tenancy_ocid - description = "To Access OCI CLI" - name = "${local.display_name}-dynamic-group" - matching_rule = "ANY {instance.id = '${oci_core_instance.compute_instance1.id}'}" - freeform_tags = var.common_tags -} - -resource "oci_identity_policy" "dg_manage_all" { - compartment_id = var.use_tenancy_level_policy ? var.tenancy_ocid : local.compartment_id - description = "To Access OCI CLI" - name = "${local.display_name}-instance-policy" - statements = var.use_tenancy_level_policy ? [local.dynamic_group_tenancy_level] : [local.dynamic_group_compartment_level] - freeform_tags = var.common_tags -} - -resource "oci_core_instance" "dbaas_instance1" { - availability_domain = local.ads[0] - compartment_id = local.compartment_id - shape = var.instance_shape - preserve_boot_volume = false - freeform_tags = var.common_tags - display_name = local.app_db_instance1_name - - create_vnic_details { - subnet_id = var.subnet_id - assign_public_ip = true - nsg_ids = [ - oci_core_network_security_group.nsg.id] - } - - source_details { - source_type = "image" - #source_id = data.oci_core_images.this.images[0].id - #source_id = "ocid1.image.oc1.iad.aaaaaaaaudkqtvbfo4mm3qyhqdrpqcatijjmml2z7ddal7hojhb2gcv34kaq" # Custom Compute - #source_id = "ocid1.image.oc1..aaaaaaaa7cr4xiwx6mbdrgfbppdypdtzyxothft2sjqftygtpxnulqmk6tla" # Platform Image - #source_id = "ocid1.appcataloglisting.oc1..aaaaaaaan5rb524w7axx36ukn42l7fwzyzm3kodad7x5hxyeyz4nyy3yefgq" # Marketplace Image - #source_id ="ocid1.image.oc1..aaaaaaaamotrq5ou4qjsnzw5sv7w2nbwvhhp4kjmazlxf23ozcsd66t3pw5q" #LiveLabs Converged DB - source_id ="ocid1.image.oc1.iad.aaaaaaaajv4k3wrfdrxwapmewcw37oxsroms3f7hmrk2mc7hepweiy3cbtja" #docker-db-21c-prega - - # DB-Base Image - } - - metadata = { - ssh_authorized_keys = var.generate_ssh_key_pair ? tls_private_key.ssh_keypair.public_key_openssh : var.ssh_public_key - user_data = base64encode(file("./modules/compute/scripts/bootstrap_database_docker.sh")) - tenancy_id = var.tenancy_ocid - grabdish_application_password = var.grabdish_application_password - grabdish_database_password = var.grabdish_database_password - app_public_repo = var.app_public_repo - iaas_public_repo = var.iaas_public_repo - #dbaas_FQDN = var.dbaas_FQDN - target_compartment_id =var.target_compartment_id - vcn_id = var.vcn_id - subnet_id = var.subnet_id - image_os = var.image_os - image_os_version = var.image_os_version - instance_shape = var.instance_shape - - } -} - -resource "oci_core_instance" "compute_instance1" { - availability_domain = local.ads[0] - compartment_id = local.compartment_id - shape = var.instance_shape - preserve_boot_volume = false - freeform_tags = var.common_tags - display_name = local.app_compute_instance1_name - - - create_vnic_details { - subnet_id = var.subnet_id - assign_public_ip = true - nsg_ids = [oci_core_network_security_group.nsg.id] - } - - source_details { - source_type = "image" - #source_id = data.oci_core_images.this.images[0].id - #source_id = "ocid1.image.oc1.iad.aaaaaaaaudkqtvbfo4mm3qyhqdrpqcatijjmml2z7ddal7hojhb2gcv34kaq" # Custom Compute - #source_id = "ocid1.image.oc1..aaaaaaaa7cr4xiwx6mbdrgfbppdypdtzyxothft2sjqftygtpxnulqmk6tla" # DB-Base Image - #source_id ="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" # microservices-2-cm - #source_id="ocid1.image.oc1.phx.aaaaaaaaw6pi7tnx2pvqgzi2lgpsicjj5cl46a3llrk6nghgbthve7f72v6a" #microservices-phx-1 - - #source_id="ocid1.image.oc1.iad.aaaaaaaa643d766gxmmzk7gul6557hnp53ul3wieu4al3qjpaiklk3mom2ba" #microservices-ash-1-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" #microservices-2-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaafwnzt3vu4ebfvrhsilrqv7i2ykv2osdmf42rjtq72nxi5qldt6ua" #microservices-ash-2-cm - #source_id="ocid1.image.oc1.iad.aaaaaaaad5tynmdcvyyt7idrox2ciuq6jlgjmivfgud6rs76dubivyufe6wq" #microservices-2-cm - source_id = "ocid1.image.oc1.iad.aaaaaaaaobsqoqegphdipcwrmt4ji6r4ukjirxvzlc7dzvto66beijmo4exa" - - - } - metadata = { - ssh_authorized_keys = var.generate_ssh_key_pair ? tls_private_key.ssh_keypair.public_key_openssh : var.ssh_public_key - user_data = base64encode(file("./modules/compute/scripts/bootstrap_compute.sh")) - tenancy_id = var.tenancy_ocid - grabdish_application_password = var.grabdish_application_password - grabdish_database_password = var.grabdish_database_password - app_public_repo = var.app_public_repo - iaas_public_repo = var.iaas_public_repo - dbaas_FQDN = var.dbaas_FQDN - target_compartment_id =var.target_compartment_id - vcn_id = var.vcn_id - subnet_id = var.subnet_id - image_os = var.image_os - image_os_version = var.image_os_version - instance_shape = var.instance_shape - } -} - - - diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/outputs.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/outputs.tf deleted file mode 100644 index c00cf6b37..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/outputs.tf +++ /dev/null @@ -1,23 +0,0 @@ -output "instance" { - value = oci_core_instance.compute_instance1 -} - -output "instance_keys" { - value = tls_private_key.ssh_keypair -} - -output "dbaas_public_ip" { - value = oci_core_instance.dbaas_instance1.public_ip -} - -output "dbaas_private_ip" { - value = oci_core_instance.dbaas_instance1.private_ip -} - -output "dbaas_compute_id" { - value = oci_core_instance.dbaas_instance1.id -} - -output "dbaas_display_name" { - value = oci_core_instance.dbaas_instance1.display_name -} diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstap06.17.21.sh b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstap06.17.21.sh deleted file mode 100644 index 9dbe198d3..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstap06.17.21.sh +++ /dev/null @@ -1,427 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -APP_NAME=oci-grabdish -DEV_TOOLS_HOME=${USER_HOME}/${APP_NAME} -APP_CONFIG_FILE_NAME=config-${APP_NAME}.json -INSTALL_LOG_FILE_NAME=install-${APP_NAME}.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # OCI Development Kit Installation is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - OCI DEV KIT Usage - =================== - This instance has OCI Dev Kit such as CLI, Terraform, Ansible, SDKs (Java, Python3.6, Go, Dotnet, Ruby, Typescript) - - To update OCI Dev Kit to the latest version, run the following command: ${UPDATE_SCRIPT_FILE} - - You could use Instance Principal authentication to use the dev tools. - - For running CLI, type the following to get more help: oci --help - ================================================================================================= -" - -start=`date +%s` - -# create a configuration file - -# Config file -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >.${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Installing OCI Dev Kit" -echo "------------------------" - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Installing yum packages ######### - -echo "Packages to install ${PACKAGES_TO_INSTALL[@]}" - -sudo yum-config-manager --enable ol7_developer ol7_developer_EPEL && echo "#################### Successfully installed ol7_developer yum packages #####################" - -echo "Manually Disabling MYSQL" -sudo yum --disablerepo=ol7_MySQL80 update - -sudo yum -y install ${PACKAGES_TO_INSTALL[@]} && echo "#################### Successfully installed all yum packages #####################" - -sudo yum -y install --enablerepo=ol7_developer_nodejs10 --enablerepo=ol7_developer oci-typescript-sdk && echo "#################### Successfully installed typescript #####################" - -####### Installing yum packages -End ######### - -####### Adding OCI Modules to Powershell ######### - -sudo -u ${USER_NAME} pwsh -c Register-PSRepository -Name LocalRepository -SourceLocation /usr/lib/dotnet/NuPkgs -InstallationPolicy Trusted -sudo -u ${USER_NAME} pwsh -c "Set-Variable -Name ProgressPreference -Value SilentlyContinue; Install-Module OCI.PSModules -Repository LocalRepository" -sudo -u ${USER_NAME} pwsh -c Uninstall-Module OCI.PSModules -sudo -u ${USER_NAME} pwsh -c Unregister-PSRepository -Name LocalRepository - -####### Adding OCI Modules to Powershell -End ######### - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so ansible can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_ANSIBLE_AUTH_TYPE=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so powershell can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_PS_AUTH="InstancePrincipal"' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo 'export GOPATH=/usr/share/gocode' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci jars are in the classpath" -JAVASDK_VERSION=$(yum list java-oci-sdk | grep -o "[0-9].[0-9]\+.[0-9]\+" | head -1) -sudo -u ${USER_NAME} echo "export CLASSPATH=/usr/lib64/java-oci-sdk/lib/oci-java-sdk-full-${JAVASDK_VERSION}.jar:/usr/lib64/java-oci-sdk/third-party/lib/*" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so ruby collections are properly set" -sudo -u ${USER_NAME} echo "source scl_source enable rh-ruby27" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export GEM_PATH=/usr/share/gems:'gem env gempath'" >> ${USER_HOME}/.bashrc -echo "Adding environment variable so dotnet collections are properly set" -sudo -u ${USER_NAME} echo "source scl_source enable rh-dotnet31" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -echo "Adding environment variable for SDK analytics" -sudo -u ${USER_NAME} echo 'export OCI_SDK_APPEND_USER_AGENT=Oracle-ORMDevTools' >> ${USER_HOME}/.bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating OCI Dev Kit" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Updating OCI Dev Kit is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} < ${SSHD_BANNER_FILE} - -exec -l $SHELL - - -curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password_password')", - "grabdish_database_password": "$($CURL_METADATA_COMMAND | jq --raw-output '.grabdish_database_passwor - - - -# 344 minikube delete -# 345 minikube start --driver=none -# 346 docker container stop registry -# 347 docker container rm registry -# 348 docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -#docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2 -#docker container stop registry -#docker container rm registry - - - -# 344 minikube delete -# 345 minikube start --driver=none -# 346 docker container stop registry -# 347 docker container rm registry -# 348 docker run -d -p 5000:5000 --restart=always --name registry registry:2 - -#docker run -d --restart=always --name registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key -p 443:443 registry:2 -#docker container stop registry -#docker container rm registry - - - -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_ns_msdataworkshop.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_frontendpasswd.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbpasswd.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbwallet.sh -$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_ssl-certificate-secret.sh - - -docker run --name microservice-database3 -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:RDBMS_21.3.0.0.0_LINUX.X64_210709 - - - -System parameter file is /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora -Log messages written to /opt/oracle/diag/tnslsnr/ffa6a4004a14/listener/alert/log.xml -Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) -Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) - -Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) -STATUS of the LISTENER ------------------------- -Alias LISTENER -Version TNSLSNR for Linux: Version 21.0.0.0.0 - Production -Start Date 06-AUG-2021 19:20:14 -Uptime 0 days 0 hr. 0 min. 0 sec -Trace Level off -Security ON: Local OS Authentication -SNMP OFF -Listener Parameter File /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora -Listener Log File /opt/oracle/diag/tnslsnr/ffa6a4004a14/listener/alert/log.xml -Listening Endpoints Summary... - (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) - (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) -The listener supports no services -The command completed successfully - - - -docker run --name [container name] --p [host port]:1521 -p :5500 --e ORACLE_SID=[your SID] --e ORACLE_PDB=[your PDB name] --e ORACLE_PWD=[your database passwords] --e INIT_SGA_SIZE=[your database SGA memory in MB] --e INIT_PGA_SIZE=[your database PGA memory in MB] --e ORACLE_EDITION=[your database edition] --e ORACLE_CHARACTERSET=[your character set] --v [host mount point:]/opt/oracle/oradata -dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:17754 - -Parameters: - --name: The name of the container (default: auto generated) - -p: The port mapping of the host port to the container port. - Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express) - -e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB) - -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1) - -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated) - -e INIT_SGA_SIZE: - The total memory in MB that should be used for all SGA components (optional). - -e INIT_PGA_SIZE: - The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (optional). - -e ORACLE_EDITION: - The Oracle Database Edition (enterprise/standard). - -e ORACLE_CHARACTERSET: - The character set to use when creating the database (default: AL32UTF8) - -v /opt/oracle/oradata - The data volume to use for the database. - Has to be writable by the Unix "oracle" (uid: 54321) user inside the container! - If omitted the database will not be persisted over container recreation. - -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup - Optional: A volume with custom scripts to be run after database startup. - -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup - Optional: A volume with custom scripts to be run after database setup. - - -docker run --name db-19300-docker -p 1 - - -docker run --name microservice-database -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup dbcs-dev-docker.dockerhub-phx.oci.oraclecorp.com/oracle/database:17754 - -docker run --name microservice-database -p 1521:1521 -p 5500:5500 --user 54321:54321 --hostname grabdish_docker-db1 -e ORACLE_SID=orcl -e ORACLE_PDB=orcl_pdb -e ORACLE_PWD=Welcome123 -e ORACLE_EDITION=enterprise -v /opt/oracle/oradata container-registry.oracle.com/database/enterprise:latest - - - -[oracle@grabdish_docker-db1 /]$ cp ~/tnsnames.ora /opt/oracle/oradata/dbconfig/ORCL/tnsnames.ora -[oracle@grabdish_docker-db1 /]$ cp ~/tnsnames.ora /opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_compute.sh b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_compute.sh deleted file mode 100644 index 9cae13bac..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_compute.sh +++ /dev/null @@ -1,339 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -BUILD_LOG_FILE=${USER_HOME}/${APP_NAME}-build - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_LOC=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN -DOCKER_CERTS_DIR=${INFRA_INSTALL_DIR}/oci-iaas/grabdish-adapter/infrastructure - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -ORACLE_HOME="/usr/lib/oracle/19.11/client64" # For Oracle 19c client - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" -DOCKER_REG_CMD="docker run -d \ - --restart=always \ - --name registry \ - -v "$DOCKER_CERTS_DIR"/certs:/certs \ - -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - -p 443:443 \ - registry:2" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - printf "\360\237\220\261 ${print_header_count}.: $1\n" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - printf "\360\237\246\204 ${print_header_count}.${print_subheader_count}.: [INFO] $1\n" - return - } - - -start=$(date +%s) - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} ${BUILD_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} ${BUILD_LOG_FILE} - - -# Sending all stdout and stderr to log file -exec >>${INSTALL_LOG_FILE} -exec 2>&1 - - -print_header "Starting Microservices Data-driven Infrastructure installation process at $(date)" - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -print_header "Creating Microservices Data-driven Infrastructure Configuration File." - -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >>${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >>${SSHD_CONFIG_FILE} -print_subheader "SSHD Banner created" -sudo systemctl restart sshd.service | -print_subheader "Restarted SSHD Service" - -####### Adding environment variables ######### -print_header "Creating Environment Variables" -print_subheader "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -print_subheader "Adding Oracle Home and Path variables to bashrc" -sudo -u ${USER_NAME} echo "export ORACLE_HOME=${ORACLE_HOME}" >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TNS_ADMIN=${TNS_ADMIN_LOC}" >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="${ORACLE_HOME}"' >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >>${USER_HOME}/.bashrc -print_subheader "Completed" - -print_subheader "Adding APP_INSTALL_DIR and INFRA_INSTALL_DIR variables to bashrc" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >>${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "source <(kubectl completion bash)" >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >>${USER_HOME}/.bashrc -print_subheader "Completed" - -####### Adding environment variables - End ######### - - - -# Clone Application and Infrastructure Resource Files -print_header "Downloading Microservices Infrastructure and Application from public repositories" -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR -print_subheader "Created destination directories $APP_INSTALL_DIR and $INFRA_INSTALL_DIR" - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - - -print_subheader "Downloading Application code from $app_public_repo " -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR - -print_subheader "Downloading Infrastructure code from $iaas_public_repo" -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} mkdir -p $DOCKER_CERTS_DIR/certs -print_subheader "Granting read, write and execute permissions to users" -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -print_subheader "Completed" - - -######################################### TO DO ########### - -# Infrastructure to Grabdish Application Bridge - -print_header "Initialing Infrastructure to Grabdish Application Bridge" -#update tnsnames.ora -print_subheader "Updating TNS ORA " -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -print_subheader "Updating TNSNAMES and Listener ORA Files" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -#No Need for TEMP DIR -- refactor code later -sudo -u ${USER_NAME} cp $TEMP_DIR/*.ora ${TNS_ADMIN_LOC}/. - -print_subheader "Opening Firewall Port for HTTP/S, SQLNET Traffic" -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --permanent --add-port=443/tcp -sudo firewall-cmd --permanent --add-port=80/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all -print_subheader "Firewall Port opened" - -print_header "Installing required infrastructure components" - -sudo chmod 666 /var/run/docker.sock - -print_subheader "Deleting previous installation of Minikube" -sudo su - ${USER_NAME} bash -c "minikube delete" - -print_subheader "Restarting Docker" -sudo systemctl restart docker - -print_subheader "Restarting Minikube cluster" -#sudo su - ${USER_NAME} bash -c "minikube start --driver=docker" # encountering issue with https docker reg -sudo su - ${USER_NAME} bash -c "minikube start --driver=none" - -print_subheader "Enabling Ingress on K8 Cluster" -sudo su - ${USER_NAME} bash -c "minikube addons enable ingress" - -print_subheader "Starting Docker Registry" -sudo su - ${USER_NAME} bash -c "docker container stop registry && docker container rm -v registry" -#sudo su - ${USER_NAME} bash -c "docker run -d -p 5000:5000 --restart=always --name registry registry:2" - -print_subheader "Granting writing privilges to user ${USER_NAME}" -sudo chown -R opc:opc $DOCKER_CERTS_DIR - -print_subheader "Creating SSL certificates for Docker Registry" -sudo su - ${USER_NAME} bash -c "openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ${DOCKER_CERTS_DIR}/certs/domain.key -out ${DOCKER_CERTS_DIR}/certs/domain.crt -subj \"/CN=grabdish/O=grabdish\"" -#print_subheader "Created Docker Certificate" - -#sudo su - ${USER_NAME} bash -c "cd$ DOCKER_CERTS_DIR; $DOCKER_REG_CMD" # Docker Pull is failing -sudo su - ${USER_NAME} bash -c "docker run -d -p 5000:5000 --restart=always --name registry registry:2" - -print_header "Creating Secrets" -print_subheader "Creating namespace" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_ns_msdataworkshop.sh" -print_subheader "Creating Secret frontendpasswd" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_frontendpasswd.sh" -print_subheader "Creating Secret dbuser" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbpasswd.sh" -print_subheader "Creating Secret dbwallet" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_dbwallet.sh" -print_subheader "Creating Secret ssl-certificate-secret" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_secret_ssl-certificate-secret.sh" -print_subheader "Completed" - -# These states are required for the Grabdish application build process to work -print_header "Creating States required for Grabdish Application" -print_subheader "These states are required for the Grabdish application build process to work" -sudo su - ${USER_NAME} bash -c "state_set_done OBJECT_STORE_BUCKET" -sudo su - ${USER_NAME} bash -c "state_set_done ORDER_DB_OCID" -sudo su - ${USER_NAME} bash -c "state_set_done INVENTORY_DB_OCID" -sudo su - ${USER_NAME} bash -c "state_set_done WALLET_GET" -sudo su - ${USER_NAME} bash -c "state_set_done CWALLET_SSO_OBJECT" -sudo su - ${USER_NAME} bash -c "state_set_done DB_PASSWORD" -sudo su - ${USER_NAME} bash -c "state_set ORDER_DB_NAME orders" -sudo su - ${USER_NAME} bash -c "state_set INVENTORY_DB_NAME inventory" -#sudo su - ${USER_NAME} bash -c "state_set DOCKER_REGISTRY localhost:443" -sudo su - ${USER_NAME} bash -c "state_set DOCKER_REGISTRY localhost:5000" -print_subheader "Completed" - - -lab1_start=$(date +%s) - -print_header "Building Lab 1" - -print_subheader "Creating Jaeger Microservice" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_service_jaeger.sh" -print_subheader "Started Jaeger Service" - - -print_subheader "Building frontend-helidon Microservice" -sudo su - ${USER_NAME} bash -c "cd ${APP_INSTALL_DIR}/grabdish/frontend-helidon;time ./build.sh > ${BUILD_LOG_FILE}-frontend-helidon.log;./deploy.sh " - -print_subheader "Completed" - -print_subheader "Creating Frontend Microservice" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml" -print_subheader "Completed" - -print_subheader "Creating Frontend Ingress" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml" -print_subheader "Completed" - -MICROSERVICES="order-helidon supplier-helidon-se inventory-helidon" - -print_subheader "Building ${MICROSERVICES}" - -for service_name in $MICROSERVICES; do - print_subheader "Creating Microservice ${service_name}" - sudo su - ${USER_NAME} bash -c "cd ${APP_INSTALL_DIR}/grabdish/${service_name}; time ./build.sh>> ${BUILD_LOG_FILE}-${service_name}.log;./deploy.sh " - print_subheader "${service_name} Completed" - done - -lab1_end=$(date +%s) - -print_subheader "Lab 1 Build took $((lab1_end - lab1_start)) seconds" - -end=$(date +%s) - -executionTime=$((end - start)) - - -print_header "Provisioning Completed at $(date)" -print_header "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. Took ${executionTime} seconds" - - -sudo echo "${USAGE_INFO}" >${SSHD_BANNER_FILE} - - - diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database.sh b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database.sh deleted file mode 100644 index ecd24176b..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database.sh +++ /dev/null @@ -1,282 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -#APP_INSTALL_DIR=${USER_HOME}/microservices-datadriven -#INFRA_INSTALL_DIR=${USER_HOME}/microservices-datadriven-infra -#INFRA_HOME=${USER_HOME}/microservices-datadriven-infra - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_DIR=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -#ORACLE_HOME=/opt/oracle/product/21c/dbhome_1 # for Docker -ORACLE_HOME="/usr/lib/oracle/19.11/client64" # for Docker Host -- i.e. Compute - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# Starting Microservices Data-driven Infrastructure installation process at ${start} " | tee -a ${INSTALL_LOG_FILE} -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -echo "" | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# 1. Create Microservices Datadriven Infrastructure Configuration File." | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating Microservices Datadriven Infrastructure" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Update Installation of Database is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -#Post Provisioning - -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all - - -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -sudo -u ${USER_NAME} echo $app_public_repo -sudo -u ${USER_NAME} echo $iaas_public_repo - - -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -sudo -u ${USER_NAME} echo "#################################### 1 ####################################" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 3 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export PATH=$ORACLE_HOME/bin:$PATH >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" - -sudo -u ${USER_NAME} echo "#################################### 4 ####################################" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 5 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 6 ####################################" -#update tnsnames.ora -sudo -u ${USER_NAME} bash -c "source ${USER_HOME}/.bashrc" -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -sudo -u ${USER_NAME} echo "#################################### 7 ####################################" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora - -sudo -u ${DBUSER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${DBUSER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" - -#use su - instead of sudo - u -sudo -u ${USER_NAME} echo "#################################### 8 ####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo "################################### 9 #####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc;source ${APP_INSTALL_DIR}/grabdish/env.sh;${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_setup.sh" - -sudo -u ${USER_NAME} echo "################################### 10 #####################################" - -end=`date +%s` - -executionTime=$((end-start)) - -echo "--------------------------------------------------------------" -echo "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} - -exec -l $SHELL \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database062121.sh b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database062121.sh deleted file mode 100644 index abefecc6a..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database062121.sh +++ /dev/null @@ -1,268 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -#APP_INSTALL_DIR=${USER_HOME}/microservices-datadriven -#INFRA_INSTALL_DIR=${USER_HOME}/microservices-datadriven-infra -#INFRA_HOME=${USER_HOME}/microservices-datadriven-infra - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -UPDATE_SCRIPT_FILE=update-kit.sh -UPDATE_SCRIPT_WITH_PATH=/usr/local/bin/${UPDATE_SCRIPT_FILE} -UPDATE_SCRIPT_LOG_FILE=${USER_HOME}/${UPDATE_SCRIPT_FILE}.log -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - Microservices Datadriven Infrastructure is now available for usage - - For additional details regarding Microservices Datadriven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# Starting Microservices Data-driven Infrastructure installation process at ${start} " | tee -a ${INSTALL_LOG_FILE} -echo "##################################################" | tee -a ${INSTALL_LOG_FILE} - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### -echo "" | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -echo "# 1. Create Microservices Datadriven Infrastructure Configuration File." | tee -a ${INSTALL_LOG_FILE} -echo "########################################################################" | tee -a ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} touch ${APP_CONFIG_FILE} - -cat >${APP_CONFIG_FILE} <> ${INSTALL_LOG_FILE} -exec 2>&1 - -echo "Creating sshd banner" -sudo touch ${SSHD_BANNER_FILE} -sudo echo "${INSTALLATION_IN_PROGRESS}" > ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### -echo "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -echo "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -####### Adding environment variables - End ######### - -####### Generating upgrade script ######### -DOLLAR_SIGN="$" - -echo "Creating update script" -echo "----------------------" -cat > ${UPDATE_SCRIPT_WITH_PATH} < >(tee ${UPDATE_SCRIPT_LOG_FILE}) -exec 2>&1 - -echo "Updating Microservices Datadriven Infrastructure" -echo "----------------------" - -echo "Packages to update ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]}" -sudo yum -y install ${DOLLAR_SIGN}{PACKAGES_TO_UPDATE[@]} && echo "#################### Successfully updated all yum packages #####################" - -echo "-----------------------------------" -echo "Update Installation of Database is complete" - -EOL -####### Generating upgrade script -End ######### -echo "Update script creation complete" - -sudo chmod +x ${UPDATE_SCRIPT_WITH_PATH} - -#Post Provisioning - -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload -sudo firewall-cmd --list-all - - -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -sudo -u ${USER_NAME} echo $app_public_repo -sudo -u ${USER_NAME} echo $iaas_public_repo - - -whoami - -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -sudo -u ${USER_NAME} echo "#################################### 1 ####################################" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc - -sudo -u ${USER_NAME} echo "#################################### 3 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export PATH=$ORACLE_HOME/bin:$PATH >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME >> ${DBUSER_HOME}/.bashrc" - -sudo -u ${USER_NAME} echo "#################################### 4 ####################################" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -#sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 5 ####################################" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export INFRA_HOME=${INFRA_HOME} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${DBUSER_HOME}/.bashrc" -sudo -u ${DBUSER_NAME} bash -c "echo source ${APP_INSTALL_DIR}/grabdish/env.sh >> ${DBUSER_HOME}/.bashrc" - - -sudo -u ${USER_NAME} echo "#################################### 6 ####################################" -#update tnsnames.ora -sudo -u ${USER_NAME} bash -c "source ${USER_HOME}/.bashrc" -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -sudo -u ${USER_NAME} echo "#################################### 7 ####################################" -sudo -u ${USER_NAME} $INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora - -sudo -u ${DBUSER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -sudo -u ${DBUSER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora - -sudo -u ${DBUSER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -sudo -u ${DBUSER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" - -sudo -u ${USER_NAME} echo "#################################### 8 ####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - - -sudo -u ${USER_NAME} echo "################################### 9 #####################################" -sudo -u ${DBUSER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc;source ${APP_INSTALL_DIR}/grabdish/env.sh;${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_setup.sh" - -sudo -u ${USER_NAME} echo "################################### 10 #####################################" -end=`date +%s` - -executionTime=$((end-start)) - -echo "--------------------------------------------------------------" -echo "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} - -exec -l $SHELL \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database_docker.sh b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database_docker.sh deleted file mode 100644 index d3a84edbf..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/bootstrap_database_docker.sh +++ /dev/null @@ -1,253 +0,0 @@ -#!/bin/bash - -# shellcheck disable=SC2218 - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_DIR=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -#ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 -ORACLE_HOME=/opt/oracle/product/21c/dbhome_1 # for Docker -DB_PASSWORD="$(curl -L http://169.254.169.254/opc/v1/instance/metadata | jq --raw-output '.grabdish_database_password')" - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage. - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - echo "# ${print_header_count}.: $1" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - echo "#${print_header_count}.${print_subheader_count}.: [INFO] $1" - return - } - -start=`date +%s` - -# Log file -sudo -u ${USER_NAME} touch ${INSTALL_LOG_FILE} -sudo -u ${USER_NAME} chmod +w ${INSTALL_LOG_FILE} - - -# Sending all stdout and stderr to log file -exec >> ${INSTALL_LOG_FILE} -exec 2>&1 - -print_header "Starting Microservices Data-driven Infrastructure installation process at $(date)" - -########################################### -# Create Microservices Data-driven Infrastructure Configuration File -########################################### - -print_header "Creating Microservices Datadriven Infrastructure Configuration File." -cat >${APP_CONFIG_FILE} < ${SSHD_BANNER_FILE} -sudo echo "${USAGE_INFO}" >> ${SSHD_BANNER_FILE} -sudo echo "Banner ${SSHD_BANNER_FILE}" >> ${SSHD_CONFIG_FILE} -sudo systemctl restart sshd.service - -####### Adding environment variables ######### - -print_header "Creating Environment Variables" -print_subheader "Adding environment variable so terraform can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export TF_VAR_auth=InstancePrincipal' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_region=$(oci-metadata -g regionIdentifier --value-only)" >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo "export TF_VAR_tenancy_ocid=$(oci-metadata -g tenancy_id --value-only)" >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo -u ${USER_NAME} echo 'export OCI_CLI_AUTH=instance_principal' >> ${USER_HOME}/.bashrc - -print_subheader "Adding environment variable so oci-cli can be AuthN using instance principal" -sudo echo 'export OCI_CLI_AUTH=instance_principal' >> /etc/bashrc - -#sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH="$ORACLE_HOME"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export PATH="$ORACLE_HOME/bin:$PATH"' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME' >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export TNS_ADMIN="${TNS_ADMIN_DIR}/" >> ${USER_HOME}/.bashrc - -print_subheader "#################################### 2 ####################################" -sudo -u ${USER_NAME} echo export INFRA_INSTALL_DIR=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export INFRA_HOME=${INFRA_HOME} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo export APP_INSTALL_DIR=${APP_INSTALL_DIR} >> ${USER_HOME}/.bashrc -sudo -u ${USER_NAME} echo 'source ${APP_INSTALL_DIR}/grabdish/env.sh' >> ${USER_HOME}/.bashrc -print_subheader "Completed." - -####### Adding environment variables - End ######### - -#Post Provisioning -print_header "Adding port 1521 to the firewall" -sudo firewall-cmd --permanent --add-port=1521/tcp -sudo firewall-cmd --reload[] -sudo firewall-cmd --list-all -print_subheader "Completed." - -print_header "Downloading Microservices Infrastructure and Application from public repositories" -sudo mkdir -p $APP_INSTALL_DIR -sudo mkdir -p $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -app_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.app_public_repo') -iaas_public_repo=$($CURL_METADATA_COMMAND | jq --raw-output '.iaas_public_repo') - -print_subheader $app_public_repo -print_subheader $iaas_public_repo - -print_subheader "Downloading Infrastructure from $iaas_public_repo to $APP_INSTALL_DIR" -sudo -u ${USER_NAME} $iaas_public_repo $INFRA_INSTALL_DIR -print_subheader "Download Completed" - -print_subheader "Downloading Application from $app_public_repo to $APP_INSTALL_DIR" -sudo -u ${USER_NAME} $app_public_repo $APP_INSTALL_DIR -print_subheader "Download Completed" - -sudo chmod -R 755 $APP_INSTALL_DIR $INFRA_INSTALL_DIR - - -print_header "Updating Database tnsnames.ora, sqlnet.ora and listeners.ora files to match target database" - -sudo mkdir -p $TEMP_DIR -sudo chown -R opc:opc $TEMP_DIR -sudo chmod +rw $TEMP_DIR - -print_subheader "Creating new tnsnames.ora, sqlnet.ora and listeners.ora file" -sudo -u ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/update_tnsnames-ora.sh" - -print_subheader "Copying tnsnames.ora" -#sudo -u ${USER_NAME} cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora.bck -#sudo -u ${USER_NAME} cp $TEMP_DIR/tnsnames.ora $ORACLE_HOME/network/admin/tnsnames.ora -sudo -u ${USER_NAME} cp $TEMP_DIR/tnsnames.ora ${TNS_ADMIN_DIR}/. - -print_subheader "Copying listeners.ora" -#sudo -u ${USER_NAME} cp $ORACLE_HOME/network/admin/listeners.ora $ORACLE_HOME/network/admin/listeners.ora.bck -#sudo -u ${USER_NAME} cp $TEMP_DIR/listeners.ora $ORACLE_HOME/network/admin/listeners.ora -sudo -u ${USER_NAME} cp $TEMP_DIR/listeners.ora ${TNS_ADMIN_DIR}/. - -print_subheader "Copying sqlnet.ora" -#sudo -u ${DBUSEUSER_NAMER_NAME} bash -c "cp $ORACLE_HOME/network/admin/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora.bck" -#sudo -u ${USER_NAME} bash -c "cp $TEMP_DIR/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora" -sudo -u ${USER_NAME} cp $TEMP_DIR/sqlnet.ora ${TNS_ADMIN_DIR}/. -print_subheader "Completed" - - -#use su - instead of sudo - u -#print_subheader "#################################### 8 ####################################" -#sudo -u ${USER_NAME} bash -c "source ${DBUSER_HOME}/.bashrc; lsnrctl reload;lsnrctl status" - -sudo chmod -R 777 $APP_INSTALL_DIR $INFRA_INSTALL_DIR -sudo chown -R opc:opc $APP_INSTALL_DIR $INFRA_INSTALL_DIR - -#print_subheader "################################### 9 #####################################" -#sudo su - ${USER_NAME} bash -c "${INFRA_HOME}/oci-iaas/grabdish-adapter/database/db_docker_setup.sh" -# database is already pre-provisioned for the docker image - -print_header "Changing Database System and Grabdish Application Passwords." - -sudo su - $USER_NAME bash -c "docker exec microservice-database bash -c \"${DBUSER_HOME}/setPassword.sh ${DB_PASSWORD}\"" -print_subheader "Changed SYSTEM Password" - -sudo su - $USER_NAME bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/change_passwd_orders.sh" -print_subheader "Changed ORDER PDB Password" - -sudo su - $USER_NAME bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/database/change_passwd_inventory.sh" -print_subheader "Changed INVENTORY PDB Password" - -end=`date +%s` - -executionTime=$((end-start)) - -print_header "Installation of Oracle Microservices Infrastructure and Data-driven Application completed at $(date)" -print_subheader "It took ${executionTime} seconds" - -sudo echo "${USAGE_INFO}" > ${SSHD_BANNER_FILE} diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/create_custom_image.sh b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/create_custom_image.sh deleted file mode 100644 index 95162e2ba..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/create_custom_image.sh +++ /dev/null @@ -1,32 +0,0 @@ -python36 -oci-ansible-collection -oci oci-cli -go-toolset -jdk-16.0.1.0.1.x86_64 -git -gnupg2 curl tar -ruby -nodejs:14 -node-oracledb-node14 -oci-dotnet-sdk -maven -libnsl -instantclient19.11-basic -instantclient19.11-sqlplus -instantclient19.11-tools -graalvm -Docker -Docker Registry -Minikube -Ingress Controller - - - -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-basic-19.11.0.0.0-1.x86_64.rpm -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-sqlplus-19.11.0.0.0-1.x86_64.rpm -sudo rpm -i https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.11-tools-19.11.0.0.0-1.x86_64.rpm - -curl -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-aarch64-20.2.0.tar.gz | tar xz -~/graalvm-ce-java11-20.2.0/bin/gu install native-image - -#kubcetl, minikube, docker, docker registry diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/temp.sh b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/temp.sh deleted file mode 100644 index 3fe1254c8..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/scripts/temp.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash - -# Variables -USER_NAME=opc -USER_HOME=/home/${USER_NAME} -DBUSER_NAME=oracle -DBUSER_HOME=/home/${DBUSER_NAME} -APP_NAME=microservices-infra -APP_CONFIG_FILE_NAME=${APP_NAME}-config.json -INSTALL_LOG_FILE_NAME=${APP_NAME}-install.log -INSTALL_LOG_FILE=${USER_HOME}/${INSTALL_LOG_FILE_NAME} -APP_CONFIG_FILE=${USER_HOME}/${APP_CONFIG_FILE_NAME} -BUILD_LOG_FILE=${USER_HOME}/${APP_NAME}-build - -INSTALL_ROOT=/microservices -APP_INSTALL_DIR=$INSTALL_ROOT/microservices-datadriven -INFRA_INSTALL_DIR=${INSTALL_ROOT}/microservices-datadriven-infra -INFRA_HOME=${INSTALL_ROOT}/microservices-datadriven-infra -TNS_ADMIN_LOC=${INFRA_HOME}/oci-iaas/grabdish-adapter/database/TNS_ADMIN -DOCKER_CERTS_DIR=${INFRA_INSTALL_DIR}/oci-iaas/grabdish-adapter/infrastructure - -SSHD_BANNER_FILE=/etc/ssh/sshd-banner -SSHD_CONFIG_FILE=/etc/ssh/sshd_config -CURL_METADATA_COMMAND="curl -L http://169.254.169.254/opc/v1/instance/metadata" -TEMP_DIR=/grabdish_tmp -PWD=$(dirname "$0") -ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1 - - - -INSTALLATION_IN_PROGRESS=" - ################################################################################################# - # WARNING! # - # Microservices Data-driven Infrastructure Build is still in progress. # - # To check the progress of the installation run -> tail -f ${INSTALL_LOG_FILE_NAME} # - ################################################################################################# -" - -USAGE_INFO=" - ================================================================================================= - Microservices Data-driven Infrastructure - ================================================ - - Microservices Data-driven Infrastructure is now available for usage - - For additional details regarding Microservices Data-driven applications on Oracle Converged Database check, - - https://github.com/oracle/microservices-datadriven - - ================================================================================================= -" -DOCKER_REG_CMD="docker run -d \ - --restart=always \ - --name registry \ - -v "$DOCKER_CERTS_DIR"/certs:/certs \ - -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - -p 443:443 \ - registry:2" - -declare -i print_header_count=0 -declare -i print_subheader_count=0 - -function print_header (){ - print_header_count=$((print_header_count + 1)) - print_subheader_count=0 - echo "" - echo "================================================================================" - echo "# ${print_header_count}.: $1" - echo "================================================================================" - echo "" - - return -} - -function print_subheader(){ - print_subheader_count=$((print_subheader_count + 1)) - echo "#${print_header_count}.${print_subheader_count}.: [INFO] $1" - return - } - - -# Sending all stdout and stderr to log file -exec >>${INSTALL_LOG_FILE} -exec 2>&1 - -start=$(date +%s) - -# Log file - -print_header "Building Lab 1" - -print_subheader "Creating Jaeger Microservice" -sudo su - ${USER_NAME} bash -c "$INFRA_HOME/oci-iaas/grabdish-adapter/k8s/create_service_jaeger.sh" -print_subheader "Started Jaeger Service" - - -print_subheader "Building frontend-helidon Microservice" -sudo su - ${USER_NAME} bash -c "cd ${GRABDISH_HOME}/frontend-helidon;time ./build.sh > ${BUILD_LOG_FILE}-frontend-helidon.log;./deploy.sh " - -print_subheader "Completed" - -print_subheader "Creating Frontend Microservice" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-service-nodeport.yaml" -print_subheader "Completed" - -print_subheader "Creating Frontend Ingress" -sudo su - ${USER_NAME} bash -c "kubectl apply -n msdataworkshop -f $INFRA_HOME/oci-iaas/grabdish-adapter/k8s/frontend-ingress.yaml" -print_subheader "Completed" - -MICROSERVICES="order-helidon supplier-helidon-se inventory-helidon" - -print_subheader "Building ${MICROSERVICES}" - -for service_name in $MICROSERVICES; do - print_subheader "Creating Microservice ${service_name}" - sudo su - ${USER_NAME} bash -c "cd ${GRABDISH_HOME}/${service_name}; time ./build.sh>> ${BUILD_LOG_FILE}-${service_name}.log;./deploy.sh " - print_subheader "${service_name} Completed" - done - - -end=$(date +%s) - -executionTime=$((end - start)) - - -print_header "Provisioning Completed" -print_subheader "Installation of Oracle Microservices Infrastructure and Data-driven Application is complete. (Took ${executionTime} seconds)" -print_subheader "" - - - - diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/variables.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/variables.tf deleted file mode 100644 index 2366aadfb..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/compute/variables.tf +++ /dev/null @@ -1,84 +0,0 @@ -variable "tenancy_ocid" {} -variable "region" {} - -variable "target_compartment_id" { - description = "OCID of the compartment where the compute is being created" - type = string -} - -variable "vcn_id" { - description = "VCN OCID where the instance is going to be created" - type = string -} - -variable "subnet_id" { - description = "Subnet OCID where the instance is going to be created" - type = string -} - -variable "image_os" { - default = "Oracle Linux" -} - -variable "image_os_version" { - default = "8" -} - -variable "instance_shape" { - description = "Shape of the instance" - type = string -} - -variable "generate_ssh_key_pair" { - description = "Auto-generate SSH key pair" - type = string -} - -variable "ssh_public_key" { - description = "ssh public key used to connect to the compute instance" - type = string -} - -variable "use_tenancy_level_policy" { - description = "Compute instance to access all resources at tenancy level" - type = bool -} - -variable "common_tags" { - description = "Tags" - type = map(string) -} - -variable "generate_app_db_passwords" { - description = "Auto-generate Grabdish Application and Database Passwords" - type = string -} - -variable "grabdish_database_password" { - description = "grabdish_database_password" - type = string -} - -variable "grabdish_application_password" { - description = "grabdish_application_password" - type = string -} - -variable "iaas_public_repo" { - description = "Repository URI to execute post provisioning infrastructure setup scripts" - type = string - #default = "" -} - -variable "app_public_repo" { - description = "Repository URI to execute post provisioning Application setup scripts" - type = string - #default = "" -} - -variable "dbaas_FQDN" { - description = "dbaas_FQDN" - type = string -} - - diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/main.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/main.tf deleted file mode 100644 index 7941e4d7b..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/main.tf +++ /dev/null @@ -1,65 +0,0 @@ -locals { - compartment_id = var.target_compartment_id - display_name = "microservices" - vcn_dns_label = "onpremise" - vcn_cidr_block = "10.0.0.0/16" - subnet_cidr_block = "10.0.1.0/24" - all_cidr = "0.0.0.0/0" - vcn_id = oci_core_vcn.this.id -} - -# VCN -resource "oci_core_vcn" "this" { - compartment_id = local.compartment_id - cidr_block = local.vcn_cidr_block - display_name = "${local.display_name}-vcn" - dns_label = local.vcn_dns_label - freeform_tags = var.common_tags -} - -# internet gateway to connect to compute instance - internet gateway is for the VCN - -resource "oci_core_internet_gateway" "ig" { - # count = local.use_existing_vcn ? 0 : 1 - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-internet-gateway" # Optional - freeform_tags = var.common_tags -} - -resource "oci_core_route_table" "rt" { #TODO - change the name to "rt" instead of "subnet" - # count = local.use_existing_vcn ? 0 : 1 - compartment_id = local.compartment_id - vcn_id = local.vcn_id - display_name = "${local.display_name}-route-table" - - route_rules { - destination = local.all_cidr - destination_type = "CIDR_BLOCK" - network_entity_id = oci_core_internet_gateway.ig.id - } - - freeform_tags = var.common_tags -} - -resource "oci_core_security_list" "sl" { - compartment_id = local.compartment_id # Required - vcn_id = local.vcn_id # Required - display_name = "${local.display_name}-security-list" # Optional - freeform_tags = var.common_tags - - # Intentionally left ingress and egress rules blank. Expected to set the NSG at the instance level -} - -#subnet -resource "oci_core_subnet" "regional_sn" { - cidr_block = local.subnet_cidr_block # Required - compartment_id = var.target_compartment_id # Required - vcn_id = local.vcn_id # Required - route_table_id = oci_core_route_table.rt.id # Optional - But Required in this case to associate the above created Route table - security_list_ids = [oci_core_security_list.sl.id] # Optional - defined a security list that has NO ingress and egress rules - display_name = "${local.display_name}-subnet" # Optional - freeform_tags = var.common_tags - dns_label = local.display_name - //prohibit_public_ip_on_vnic = false -} diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/outputs.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/outputs.tf deleted file mode 100644 index 6b44c72c8..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/outputs.tf +++ /dev/null @@ -1,11 +0,0 @@ -output "vcn" { - value = oci_core_vcn.this -} - -output "subnet" { - value = oci_core_subnet.regional_sn -} - -output "subnet_domain_name" { - value = oci_core_subnet.regional_sn.subnet_domain_name -} diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/variables.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/variables.tf deleted file mode 100644 index 49a404bf9..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/modules/network/variables.tf +++ /dev/null @@ -1,9 +0,0 @@ -variable "target_compartment_id" { - description = "OCID of the compartment where the VCN is being created" - type = string -} - -variable "common_tags" { - description = "Tags" - type = map(string) -} \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/outputs.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/outputs.tf deleted file mode 100644 index 0284d7004..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/outputs.tf +++ /dev/null @@ -1,63 +0,0 @@ -locals { - app_password = var.generate_app_db_passwords ? random_string.grabdish_application_password.result : var.grabdish_application_password -} -output "compute_instance_public_ip" { - value = module.compute.instance.public_ip -} - -output "compartment_id" { - value = var.compartment_ocid -} - -output "generated_instance_ssh_private_key" { - value = var.generate_ssh_key_pair ? module.compute.instance_keys.private_key_pem : "" -} - -output "dbaas_public_ip" { - value = module.compute.dbaas_public_ip -} - -output "dbaas_private_ip" { - value = module.compute.dbaas_private_ip -} - -output "FQDN_database_SN" { - value = module.network.subnet -} - -output "dbaas_FQDN" { - value = join(".", [module.compute.dbaas_display_name,module.network.subnet_domain_name]) -} - -output "Database_Password"{ - value = var.generate_app_db_passwords ? random_string.grabdish_database_password.result : var.grabdish_database_password -} - -output "Grabdish_Application_Password"{ - value = local.app_password -} - -output "Login_Instructions" { - #type = URL - value = "Login to http://${module.compute.instance.public_ip} using username: grabdish password: ${local.app_password} " -} - -/* -output "dbaas_password"{ - value = var.grabdish_database_password -} - -output "app_password"{ - value = var.grabdish_application_password -} -*/ -/* -output "Database_Password"{ - value = module.compute.Grabdish_Application_Password -} - -output "Grabdish_Application_Password"{ - value = module.compute.On_Premise_Database_Password -} - -*/ \ No newline at end of file diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/provider.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/provider.tf deleted file mode 100644 index 569565755..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/provider.tf +++ /dev/null @@ -1,10 +0,0 @@ -provider "oci" { - tenancy_ocid = var.tenancy_ocid - region = var.region -} - -provider "tls" { - -} - - diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/schema.yaml b/infra/oci-iaas/resource_manager/singlenode-deployment/schema.yaml deleted file mode 100644 index 489c6c7cf..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/schema.yaml +++ /dev/null @@ -1,176 +0,0 @@ -title: Grabdish - Microservices Data-driven application on Oracle Converged Database -description: Grabdish - Microservices Data-driven application on Oracle Converged Database -stackDescription: Grabdish - Microservices Data-driven application on Oracle Converged Database -informationalText: Grabdish - Microservices Data-driven application on Oracle Converged Database -schemaVersion: 1.1.0 -version: "20200822" -locale: "en" - -variableGroups: - - title: General Configuration - visible: false - variables: - - compartment_ocid - - tenancy_ocid - - region - - - title: Required Configuration for Microservices Datadriven Application Grabdish - visible: true - variables: - - instance_shape - - generate_ssh_key_pair - - ssh_public_key - - generate_app_db_passwords - - grabdish_application_password - - grabdish_database_password - - use_tenancy_level_policy - - iaas_public_repo - - app_public_repo - -variables: - # General Configuration - tenancy_ocid: - title: Tenancy ID - description: The Oracle Cloud Identifier (OCID) for your tenancy - type: string - required: true - visible: false - - region: - title: Region To Provision the Compute and Database Resources - description: Region To Provision the Compute and Database Resources - type: oci:identity:region:name - required: true - visible: false - - compartment_ocid: - title: Compartment OCID - description: Compartment OCID - type: oci:identity:compartment:id - required: true - visibile: false - - # Required - instance_shape: - title: Instance Shape - description: Instance Shape - type: oci:core:instanceshape:name - default: VM.Standard.E2.1.Micro - required: true - dependsOn: - compartmentId: ${compartment_ocid} - - generate_ssh_key_pair: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.generate_ssh_key_pair.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.generate_ssh_key_pair.description()} - type: boolean - default: true - required: true - - generate_app_db_passwords: - title: Auto-generate Grabdish Application and Database Passwords - description: Automatically generate Grabdish Application and Database Passwords - type: boolean - default: true - required: true - - ssh_public_key: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.ssh_public_key.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.ssh_public_key.description()} - type: oci:core:ssh:publickey - required: false - additionalProps: - allowMultiple: true - pattern: "((^(ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)(,((ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+\/]+[=]{0,3})( [^,]*)?)*$" - visible: - not: - - generate_ssh_key_pair - - use_tenancy_level_policy: - title: ${Messages.solutionsHub.solutions.ociDevTools.variables.use_tenancy_level_policy.title()} - description: ${Messages.solutionsHub.solutions.ociDevTools.variables.use_tenancy_level_policy.description()} - type: boolean - default: true - required: true - - grabdish_database_password: - description: Provide database password. it will be used for creating admin, order_user, inventory_user for Order and Inventory PDBs. (Must be a minimum 12 characters, contain at least one uppercase letter, one lowercase letter, one number , no special characters allowed). This password will be made available to you as an output variable. - type: password - minLength: 12 - maxLength: 30 - pattern: ^[A-Za-z][A-Za-z0-9]+$ - required: true - #default: OraDB4U12345 - visible: - not: - - generate_app_db_passwords - - grabdish_application_password: - description: Provide database password. it will be used for admin, wallet and application , cannot have the word "usage" in the passowrd, (Must be a minimum 12 characters, contain at least one uppercase letter, one lowercase letter, one number , no special characters allowed). - type: password - minLength: 12 - maxLength: 30 - pattern: ^[A-Za-z][A-Za-z0-9]+$ - required: true - #default: Welcome12345 - visible: - not: - - generate_app_db_passwords - - iaas_public_repo: - title: Post Provisioning Infrastructure Setup URL - description: Repository URI to execute post provisioning infrastructure scripts - type: String - #minLength: 12 - #maxLength: 30 - pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - required: true - #default: Welcome12345 - - app_public_repo: - title: Post Provisioning Application Setup URL - description: Repository URI to execute post provisioning application scripts - type: String - #minLength: 12 - #maxLength: 30 - pattern: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) - required: true - #default: Welcome12345 - -outputGroups: - - title: outputGroups - outputs: - - compute_instance_public_ip - - compartment_id - - generated_instance_ssh_private_key - - title: On Premise Database details - outputs: - - dbaas_instance_public_ip - - generated_instance_ssh_private_key - -outputs: - compute_instance_public_ip: - title: compute_instance_public_ip - displayText: compute_instance_public_ip - type: copyableString - visible: true - - compartment_id: - title: compartment_id - displayText: compartment_id - type: string - visible: true - - generated_instance_ssh_private_key: - title: generated_instance_ssh_private_key - displayText: generated_instance_ssh_private_key - type: string - visible: true - - dbaas_instance_public_ip: - title: Database Public IP Address - displayText: module.compute.dbaas_public_ip - type: copyableString - visible: true - - diff --git a/infra/oci-iaas/resource_manager/singlenode-deployment/variables.tf b/infra/oci-iaas/resource_manager/singlenode-deployment/variables.tf deleted file mode 100644 index a684b6ccc..000000000 --- a/infra/oci-iaas/resource_manager/singlenode-deployment/variables.tf +++ /dev/null @@ -1,83 +0,0 @@ -variable "tenancy_ocid" {} -variable "region" {} -variable "compartment_ocid" {} - -/* -resource "random_password" "onprem_dbaas_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} - -resource "random_password" "onprem_application_password" { - length = 12 - special = true - min_upper = 3 - min_lower = 3 - min_numeric = 3 - min_special = 3 - override_special = "{}#^*<>[]%~" -} -*/ - - -variable "instance_shape" { - description = "Shape of the instance" - type = string -} - -variable "generate_ssh_key_pair" { - description = "Auto-generate SSH key pair" - type = string -} - -variable "ssh_public_key" { - description = "ssh public key used to connect to the compute instance" - default = "" # This value has to be defaulted to blank, otherwise terraform apply would request for one. - type = string -} - -variable "use_tenancy_level_policy" { - description = "Compute instance to access all resources at tenancy level" - type = bool -} - -variable "generate_app_db_passwords" { - description = "Automatically generate Grabdish Application and Database Passwords" - type = string -} - -variable "grabdish_database_password" { - description = "grabdish_database_password" - type = string - default = "OraDB4U13579" - -} - -variable "grabdish_application_password" { - description = "grabdish_application_password" - type = string - default = "Welcome12345" - -} - -variable "iaas_public_repo" { - description = "Repository URI to execute post provisioning infrastructure setup scripts" - type = string - default = "git clone -b master --single-branch https://github.com/vishalmmehra/microservices-datadriven-infra/" - #default = "" -} - -variable "app_public_repo" { - description = "Repository URI to execute post provisioning Application setup scripts" - type = string - default = "git clone -b 21.6.1 --single-branch https://github.com/oracle/microservices-datadriven.git" - #default = "" -} - - - diff --git a/infra/os/oci/apply.sh b/infra/os/oci/apply.sh deleted file mode 100755 index a6bfc0494..000000000 --- a/infra/os/oci/apply.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -eu - - -if ! provisioning-helper-pre-apply; then - exit 1 -fi - - -oci os bucket create --compartment-id "$COMPARTMENT_OCID" --name "$BUCKET_NAME" - -touch $OUTPUT_FILE \ No newline at end of file diff --git a/infra/os/oci/destroy.sh b/infra/os/oci/destroy.sh deleted file mode 100755 index 9beeebb8c..000000000 --- a/infra/os/oci/destroy.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -e - -if ! provisioning-helper-pre-destroy; then - exit 1 -fi - -oci os bucket delete --force --name "$BUCKET_NAME" - -rm -f $STATE_FILE \ No newline at end of file diff --git a/infra/os/oci/requirements.env b/infra/os/oci/requirements.env deleted file mode 100644 index c3d185218..000000000 --- a/infra/os/oci/requirements.env +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -REQ_UTILS="touch oci" -REQ_INPUT_PARAMS="COMPARTMENT_OCID BUCKET_NAME" -REQ_OUTPUT_PARAMS="" \ No newline at end of file diff --git a/infra/state_store/apply.sh b/infra/state_store/apply.sh deleted file mode 100755 index c0df5eb52..000000000 --- a/infra/state_store/apply.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Make sure this is run via source or . - -if ! provisioning-helper-pre-apply; then - exit 1 -fi - -STATE_STORE_STATE_DIR=$MY_STATE/state -mkdir -p $STATE_STORE_STATE_DIR -cat >$OUTPUT_FILE <>$OUTPUT_FILE \ No newline at end of file diff --git a/infra/state_store/destroy.sh b/infra/state_store/destroy.sh deleted file mode 100755 index 4fa2b4aab..000000000 --- a/infra/state_store/destroy.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Make sure this is run via source or . - -if ! provisioning-helper-pre-destroy; then - return 1 -fi - -STATE_STORE_STATE_DIR=$MY_STATE/state - -if test -d $STATE_STORE_STATE_DIR; then - rm -rf $STATE_STORE_STATE_DIR -fi - -rm -f $STATE_FILE \ No newline at end of file diff --git a/infra/state_store/requirements.env b/infra/state_store/requirements.env deleted file mode 100644 index bb1b33fbe..000000000 --- a/infra/state_store/requirements.env +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -REQ_UTILS="touch rm mkdir" -REQ_INPUT_PARAMS="STATE_LOG" -REQ_OUTPUT_PARAMS="STATE_STORE_STATE_DIR STATE_LOG" \ No newline at end of file diff --git a/infra/state_store/state-functions.env b/infra/state_store/state-functions.env deleted file mode 100644 index cb6f96efd..000000000 --- a/infra/state_store/state-functions.env +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Test if the state is done (file exists) -function state_done() { - STATE_NAME="$1" - test -f $STATE_STORE_STATE_DIR/"$1" -} - -# Set the state to done -function state_set_done() { - STATE_NAME="$1" - touch $STATE_STORE_STATE_DIR/"$STATE_NAME" - echo "`date`: $STATE_NAME" >>$STATE_LOG - echo "$STATE_NAME completed" -} - -# Set the state to done and it's value -function state_set() { - STATE_NAME="$1" - STATE_VALUE="$2" - echo "$STATE_VALUE" > $STATE_STORE_STATE_DIR/"$STATE_NAME" - echo "`date`: $STATE_NAME: $STATE_VALUE" >>$STATE_LOG -# echo "$STATE_NAME: $STATE_VALUE" -} - -# Reset the state - not done and no value -function state_reset() { - STATE_NAME="$1" - rm -f $STATE_STORE_STATE_DIR/"$STATE_NAME" -} - -# Get state value -function state_get() { - STATE_NAME="$1" - if ! state_done "$STATE_NAME"; then - return 1 - fi - echo "$(<$STATE_STORE_STATE_DIR/$STATE_NAME)" -} - -# Export the functions so that they are available to subshells -export -f state_done -export -f state_set_done -export -f state_set -export -f state_reset -export -f state_get diff --git a/infra/vault/folder/apply.sh b/infra/vault/folder/apply.sh deleted file mode 100755 index 2d8e44ef2..000000000 --- a/infra/vault/folder/apply.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -if ! provisioning-helper-pre-apply; then - exit 1 -fi - -VAULT_FOLDER=$MY_STATE/vault -mkdir -p $VAULT_FOLDER -chmod 700 $VAULT_FOLDER -export VAULT_FOLDER - -cat >$OUTPUT_FILE <>$OUTPUT_FILE \ No newline at end of file diff --git a/infra/vault/folder/destroy.sh b/infra/vault/folder/destroy.sh deleted file mode 100755 index accce42de..000000000 --- a/infra/vault/folder/destroy.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -if ! provisioning-helper-pre-destroy; then - return 1 -fi - -VAULT_FOLDER=$MY_STATE/vault - -if test -d $VAULT_FOLDER; then - rm -rf $VAULT_FOLDER -fi - -rm -f $STATE_FILE \ No newline at end of file diff --git a/infra/vault/folder/requirements.env b/infra/vault/folder/requirements.env deleted file mode 100644 index e83f2808f..000000000 --- a/infra/vault/folder/requirements.env +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -REQ_UTILS="touch rm mkdir chmod" -REQ_INPUT_PARAMS="" -REQ_OUTPUT_PARAMS="VAULT_FOLDER" \ No newline at end of file diff --git a/infra/vault/folder/vault-folder-functions.env b/infra/vault/folder/vault-folder-functions.env deleted file mode 100644 index 42a4bf829..000000000 --- a/infra/vault/folder/vault-folder-functions.env +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Set the secret value -function set_secret() { - local SECRET_NAME="$1" - local SECRET_VALUE="$2" - echo "$SECRET_VALUE" > $VAULT_FOLDER/"$SECRET_NAME" - chmod 700 $VAULT_FOLDER/"$SECRET_NAME" -} - -# Test if the secret exists -function is_secret_set() { - local SECRET_NAME="$1" - test -f $VAULT_FOLDER/"$SECRET_NAME" -} - -# Get secret value -function get_secret() { - local SECRET_NAME="$1" - if ! is_secret_set "$SECRET_NAME"; then - return 1 - fi - echo "$(<$VAULT_FOLDER/"$SECRET_NAME")" -} - -# Export the functions so that they are available to subshells -export -f set_secret -export -f is_secret_set -export -f get_secret diff --git a/infra/vault/oci-os/apply.sh b/infra/vault/oci-os/apply.sh deleted file mode 100755 index 7857cc4b4..000000000 --- a/infra/vault/oci-os/apply.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -eu - - -if ! provisioning-helper-pre-apply; then - exit 1 -fi - - -oci os bucket create --compartment-id "$COMPARTMENT_OCID" --name "$BUCKET_NAME" >/dev/null - -cat >$OUTPUT_FILE <>$OUTPUT_FILE \ No newline at end of file diff --git a/infra/vault/oci-os/destroy.sh b/infra/vault/oci-os/destroy.sh deleted file mode 100755 index 9beeebb8c..000000000 --- a/infra/vault/oci-os/destroy.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -e - -if ! provisioning-helper-pre-destroy; then - exit 1 -fi - -oci os bucket delete --force --name "$BUCKET_NAME" - -rm -f $STATE_FILE \ No newline at end of file diff --git a/infra/vault/oci-os/requirements.env b/infra/vault/oci-os/requirements.env deleted file mode 100644 index c3d185218..000000000 --- a/infra/vault/oci-os/requirements.env +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -REQ_UTILS="touch oci" -REQ_INPUT_PARAMS="COMPARTMENT_OCID BUCKET_NAME" -REQ_OUTPUT_PARAMS="" \ No newline at end of file diff --git a/infra/vault/oci-os/vault-oci-os-functions.env b/infra/vault/oci-os/vault-oci-os-functions.env deleted file mode 100644 index 37371561c..000000000 --- a/infra/vault/oci-os/vault-oci-os-functions.env +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Set the secret value -function set_secret() { - local SECRET_NAME="$1" - local SECRET_VALUE="$2" - if ! echo -n "$SECRET_VALUE" | oci os object put --bucket-name $VAULT_BUCKET --name "$SECRET_NAME" --force --file - >/dev/null 2>&1; then - return 1 - fi -} - -# Test if the secret exists -function is_secret_set() { - local SECRET_NAME="$1" - local SECRET_VALUE - if ! SECRET=$(oci os object get --bucket-name $VAULT_BUCKET --name "$SECRET_NAME" --file - >/dev/null 2>&1); then - return 1 - fi -} - -# Get secret value -function get_secret() { - local SECRET_NAME="$1" - local SECRET_VALUE - if SECRET_VALUE=$(oci os object get --bucket-name $VAULT_BUCKET --name "$SECRET_NAME" --file - 2>/dev/null); then - echo "$SECRET_VALUE" - else - return 1 - fi -} - -# Export the functions so that they are available to subshells -export -f set_secret -export -f is_secret_set -export -f get_secret diff --git a/workshops/dcms-cicd/config/apply.sh b/workshops/dcms-cicd/config/apply.sh deleted file mode 100755 index 95da5ecd7..000000000 --- a/workshops/dcms-cicd/config/apply.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Fail on error -set -eu - -if ! provisioning-helper-pre-apply; then - exit 1 -fi - - -if ! test -d $MY_STATE/terraform; then - rm -rf $MY_STATE/terraform - cp -r $DCMS_CICD_JNKNS_DIR $MY_STATE -fi - - -# Start the provisioning apply -cd $MY_STATE/terraform -source $DCMS_CICD_JNKNS_DIR/terraform-env.sh - -if ! terraform init; then - echo 'ERROR: terraform init failed!' - exit 1 -fi - -if ! terraform apply -auto-approve; then - echo 'ERROR: terraform apply failed!' - exit 1 -fi - -state_set JENKINS_IP `terraform output jenkins_public_ip` -set_secret JENKINS_PRIVATE_KEY `terraform output -raw generated_ssh_private_key` - -# Write the output -cat >$OUTPUT_FILE < - Installed agent node for pipeline jobs - /home/jenkins/agent - 1 - NORMAL - - - - false - remoting - false - - false - -