Skip to content

Commit

Permalink
vintner study technology (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Aug 27, 2024
1 parent b8e1d90 commit f64d0a6
Show file tree
Hide file tree
Showing 19 changed files with 2,693 additions and 363 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -e
source configuration.sh

# Study
time ts-node -r tsconfig-paths/register ${TEMPLATE_DIR}/scripts/study.ts
$VINTNER study technology --application boutique --experimental
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
study: technology
originals:
- gcp
- kubernetes
- os-medium
- os-large
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,7 @@ topology_template:
type: mysql.database
technology:
- ansible:
conditions: {logic_expression: is_openstack}
- ansible:
conditions: {logic_expression: is_kubernetes}
conditions: {or: [{logic_expression: is_openstack}, {logic_expression: is_kubernetes}]}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,9 @@ topology_template:
gcp_project:
type: string

k8s_host:
type: string

k8s_ca_cert_file:
type: string

k8s_client_cert_file:
type: string

k8s_client_key_file:
type: string

variability:
expressions:
is_gcp: {equal: [{variability_input: env}, GCP]}
is_kubernetes: {equal: [{variability_input: env}, KUBERNETES]}
is_openstack: {equal: [{variability_input: env}, OPENSTACK]}
has_optional_payment_feature: {equal: [{variability_input: optional_payment_feature}, true]}
has_premium_payment_feature: {equal: [{variability_input: premium_payment_feature}, true]}
Expand Down Expand Up @@ -115,8 +102,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand Down Expand Up @@ -153,7 +138,6 @@ topology_template:
- recommendation: recommendation_component
- advertisement: advertisement_component
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -162,14 +146,9 @@ topology_template:

frontend_ingress:
type: ingress
technology:
- ansible:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
technology: ansible
requirements:
- application: frontend_component
- host: kubernetes_cluster
- host: virtual_machine

###################################################
Expand All @@ -183,8 +162,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand Down Expand Up @@ -218,7 +195,6 @@ topology_template:
- cart: cart_component
- product: product_component
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -236,8 +212,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -247,7 +221,6 @@ topology_template:
- disable_profiler: '1'
requirements:
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -265,8 +238,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -288,7 +259,6 @@ topology_template:
conditions: {not: {logic_expression: has_premium_payment_feature}}
requirements:
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -306,8 +276,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -317,7 +285,6 @@ topology_template:
- disable_profiler: '1'
requirements:
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -335,8 +302,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -346,7 +311,6 @@ topology_template:
- disable_profiler: '1'
requirements:
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -364,8 +328,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -383,7 +345,6 @@ topology_template:
requirements:
- database: cart_database
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -395,8 +356,6 @@ topology_template:
technology:
- ansible:
conditions: {logic_expression: is_openstack}
- ansible:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -411,16 +370,13 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
- dbms_name: unfurl-technology-boutique-cart-dbms
- dbms_password: {get_input: dbms_password}
requirements:
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudsql

###################################################
Expand All @@ -434,8 +390,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -445,7 +399,6 @@ topology_template:
- disable_profiler: '1'
requirements:
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -463,8 +416,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -476,7 +427,6 @@ topology_template:
requirements:
- product: product_component
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand All @@ -494,8 +444,6 @@ topology_template:
technology:
- compose:
conditions: {logic_expression: is_openstack}
- kubernetes:
conditions: {logic_expression: is_kubernetes}
- terraform:
conditions: {logic_expression: is_gcp}
properties:
Expand All @@ -505,7 +453,6 @@ topology_template:
- disable_profiler: '1'
requirements:
- host: docker_engine
- host: kubernetes_cluster
- host: gcp_cloudrun
artifacts:
- docker_image:
Expand Down Expand Up @@ -634,23 +581,3 @@ topology_template:
- gcp_region: {get_input: gcp_region}
- gcp_service_account_file: {get_input: gcp_service_account_file}
- gcp_project: {get_input: gcp_project}

###################################################
#
# Kubernetes
#
###################################################

kubernetes_cluster:
type: kubernetes.cluster
conditions: {logic_expression: is_kubernetes}
properties:
- k8s_host: {get_input: k8s_host}
- k8s_ca_cert_file: {get_input: k8s_ca_cert_file}
- k8s_client_cert_file: {get_input: k8s_client_cert_file}
- k8s_client_key_file: {get_input: k8s_client_key_file}
requirements:
- host: kubernetes_provider

kubernetes_provider:
type: cloud.provider
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

# Load configuration
source configuration.sh

# Study
$VINTNER study technology --application shop --experimental
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
study: technology
originals:
- elastic
- kubernetes
- static
- static-large
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,9 @@ topology_template:
type: mysql.database
technology:
- ansible:
conditions: {equal: [{variability_input: env}, STATIC]}
conditions: {or: [{equal: [{variability_input: env}, STATIC]}, {equal: [{variability_input: env}, KUBERNETES]}]}
- terraform:
conditions: {equal: [{variability_input: env}, ELASTIC]}
- ansible:
conditions: {equal: [{variability_input: env}, KUBERNETES]}
properties:
- database_name: shop
- database_user: shop
Expand Down
16 changes: 16 additions & 0 deletions src/cli/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1134,3 +1134,19 @@ program
if (options.format === 'json') std.out(files.toJSON(result))
})
)

/**
* Case Study
*/
const study = program.command('study').description('conduct case studies')

study
.command('technology')
.description('conduct technology case study')
.requiredOption('--application <string>', 'application name, e.g., boutique or shop')
.requiredOption('--experimental', 'enable experimental feature')
.action(
hae.exit(async options => {
await Controller.study.technology(options)
})
)
2 changes: 2 additions & 0 deletions src/controller/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import QueryController from './query'
import SensorsController from './sensors'
import ServerController from './server'
import SetupController from './setup'
import StudyController from './study'
import TemplateController from './template'
import TemplatesController from './templates'
import UtilsController from './utils'
Expand All @@ -21,6 +22,7 @@ export default {
sensors: SensorsController,
server: ServerController,
setup: SetupController,
study: StudyController,
template: TemplateController,
templates: TemplatesController,
utils: UtilsController,
Expand Down
5 changes: 5 additions & 0 deletions src/controller/study/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import _technology from './technology'

export default {
technology: _technology,
}
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
"x": 304.1499938964844,
"y": 780,
"width": 715.0394287109375,
"height": 250,
"height": 300,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
Expand All @@ -520,21 +520,21 @@
"frameId": null,
"roundness": null,
"seed": 2010480017,
"version": 739,
"versionNonce": 1329286577,
"version": 764,
"versionNonce": 737352163,
"isDeleted": false,
"boundElements": null,
"updated": 1722941170816,
"updated": 1724775005387,
"link": null,
"locked": false,
"text": "G / D = 200 LOC/ 500 LOC = 0.4 = 40%\n\n100% - (G/ D) = 60% \n\n\"man muss 60% weniger LOC schreiben um die Maintenance durchzuführen\nmit den neuen Modellierungskonstrukten im Vergleich zu ohne\"\n\nalternativ \n\n\"man muss nur 40% der ansonsten benötigten LOC schreiben\"",
"text": "G / D = 200 LOC/ 500 LOC = 0.4 = 40%\n\n\"man muss nur 40% der ansonsten benötigten LOC schreiben\"\n\n\nalternativ \n\n\n100% - (G/ D) = 60% \n\n\"man muss 60% weniger LOC schreiben um die Maintenance durchzuführen\nmit den neuen Modellierungskonstrukten im Vergleich zu ohne\"",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "top",
"baseline": 243,
"baseline": 293,
"containerId": null,
"originalText": "G / D = 200 LOC/ 500 LOC = 0.4 = 40%\n\n100% - (G/ D) = 60% \n\n\"man muss 60% weniger LOC schreiben um die Maintenance durchzuführen\nmit den neuen Modellierungskonstrukten im Vergleich zu ohne\"\n\nalternativ \n\n\"man muss nur 40% der ansonsten benötigten LOC schreiben\"",
"originalText": "G / D = 200 LOC/ 500 LOC = 0.4 = 40%\n\n\"man muss nur 40% der ansonsten benötigten LOC schreiben\"\n\n\nalternativ \n\n\n100% - (G/ D) = 60% \n\n\"man muss 60% weniger LOC schreiben um die Maintenance durchzuführen\nmit den neuen Modellierungskonstrukten im Vergleich zu ohne\"",
"lineHeight": 1.25
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f64d0a6

Please sign in to comment.