Skip to content

Commit

Permalink
mysql.dbms.image
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Sep 3, 2024
1 parent 031f152 commit df44284
Show file tree
Hide file tree
Showing 46 changed files with 224 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,6 @@ topology_template:
- mysql_password: {eval: '.::.requirements::[.name=database]::.target::database_password'}
- mysql_table: 'cart'
- mysql_ssl_mode: {eval: '.::.requirements::[.name=database]::.target::.requirements::[.name=host]::.target::dbms_ssl_mode'}

requirements:
- database: cart_database_terraform
- host: gcp_cloudrun
Expand Down Expand Up @@ -726,6 +725,10 @@ topology_template:
- dbms_password: {get_input: dbms_password}
requirements:
- host: docker_engine
artifacts:
- mysql_dbms_image:
type: mysql.dbms.image
file: 5.7

cart_dbms_kubernetes:
type: mysql.dbms
Expand All @@ -735,6 +738,10 @@ topology_template:
- dbms_password: {get_input: dbms_password}
requirements:
- host: kubernetes_cluster
artifacts:
- mysql_dbms_image:
type: mysql.dbms.image
file: 5.7

cart_dbms_terraform:
type: mysql.dbms
Expand All @@ -744,6 +751,10 @@ topology_template:
- dbms_password: {get_input: dbms_password}
requirements:
- host: gcp_cloudsql
artifacts:
- mysql_dbms_image:
type: mysql.dbms.image
file: 5.7

###################################################
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ topology_template:
- dbms_password: {get_input: dbms_password}
requirements:
- host: docker_engine
artifacts:
- mysql_dbms_image:
type: mysql.dbms.image
file: 5.7

cart_dbms_terraform:
type: mysql.dbms
Expand All @@ -519,6 +523,10 @@ topology_template:
- dbms_password: {get_input: dbms_password}
requirements:
- host: gcp_cloudsql
artifacts:
- mysql_dbms_image:
type: mysql.dbms.image
file: 5.7

###################################################
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,29 @@ ansible:
weight: 1
reason: Primary use case due to the specialization of Ansible.
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- docker.engine
- virtual.machine
weight: 0.5
reason: Docker Compose is more specialized
details: '"community.docker.docker_container" task'
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- gcp.cloudsql
weight: 1
reason: Primary use case due to the specialization of Ansible.
details: '"google.cloud.gcp_sql_instance" and "google.cloud.gcp_sql_user" tasks'
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- kubernetes.cluster
weight: 0.5
reason: Kubernetes is more specialized.
details: '"kubernetes.core.k8s" tasks'
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- virtual.machine
weight: 1
Expand Down Expand Up @@ -204,25 +208,29 @@ terraform:
weight: 0.5
reason: Terraform provides a declarative module. However, Terraform requires an SSH workaround. Ansible is more specialized.
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- docker.engine
- virtual.machine
weight: 0.5
reason: Docker Compose is more specialized.
details: '"docker_container" and "docker_image" resources'
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- gcp.cloudsql
weight: 1
reason: Terraform provides a declarative module.
details: '"google_sql_database_instance" and "google_sql_user" resources'
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- kubernetes.cluster
weight: 0.5
reason: Kubernetes is more specialized.
details: '"kubernetes_deployment_v1" and "kubernetes_service_v1" resources'
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- virtual.machine
weight: 0
Expand Down Expand Up @@ -318,6 +326,7 @@ kubernetes:
weight: 0
reason: Kubernetes Job with imperative parts, while declarative other technologies provide declarative modules.
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- kubernetes.cluster
weight: 1
Expand All @@ -337,8 +346,9 @@ compose:
- docker.engine
- virtual.machine
weight: 0
reason: One-time use docker container ("fake Kubernetes job") with imperative parts, while declarative other technologies provide declarative modules.
reason: One-time use docker container ("fake Kubernetes job") with imperative parts, while other technologies provide declarative modules.
- component: mysql.dbms
artifact: mysql.dbms.image
hosting:
- docker.engine
- virtual.machine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ artifact_types:
machine.image:
derived_from: artifact
description: expects image reference in "file"
dbms.image:
derived_from: artifact
description: expects image reference in "file"
interface_types:
interface:
derived_from: tosca.interfaces.Root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ artifact_types:
docker.image:
derived_from: container.image
description: expects image reference in "file"
mysql.dbms.image:
derived_from: artifact
description: expects image reference in "file"
zip.archive:
derived_from: source.archive
tar.archive:
Expand Down Expand Up @@ -401,9 +404,6 @@ node_types:
type: string
default:
eval: .::dbms_name
dbms_version:
type: string
default: '5.7'
dbms_password:
type: string
dbms_ssl_mode:
Expand Down Expand Up @@ -7086,7 +7086,7 @@ node_types:
- sudo bash /tmp/stop-docker.engine.sh
- sudo bash /tmp/delete-docker.engine.sh
when: destroy
mysql.dbms~mysql.dbms::[email protected]>virtual.machine:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]>virtual.machine:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -7131,7 +7131,7 @@ node_types:
- name: start container
community.docker.docker_container:
name: '{{ SELF.dbms_name }}'
image: mysql:{{ SELF.dbms_version }}
image: mysql:{{ ".artifacts::mysql_dbms_image::file" | eval }}
network_mode: host
env:
MYSQL_ROOT_PASSWORD: '{{ SELF.dbms_password | string }}'
Expand All @@ -7140,7 +7140,7 @@ node_types:
- '--key-file={{ SELF.os_ssh_key_file }}'
- '--user={{ SELF.os_ssh_user }}'
delete: exit 0
mysql.dbms~mysql.dbms::[email protected]:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -7191,7 +7191,7 @@ node_types:
register: instance_info
google.cloud.gcp_sql_instance:
name: '{{ SELF.dbms_name }}'
database_version: MYSQL_{{ SELF.dbms_version | replace(".", "_") }}
database_version: MYSQL_{{ ".artifacts::mysql_dbms_image::file" | eval | replace(".", "_") }}
settings:
tier: db-f1-micro
availability_type: REGIONAL
Expand Down Expand Up @@ -7234,7 +7234,7 @@ node_types:
ansible.builtin.shell: gcloud sql instances delete {{ SELF.dbms_name }} --quiet
args:
executable: /bin/bash
mysql.dbms~mysql.dbms::[email protected]:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -7310,7 +7310,7 @@ node_types:
app: '{{ SELF.dbms_name }}'
spec:
containers:
- image: mysql:{{ SELF.dbms_version }}
- image: mysql:{{ ".artifacts::mysql_dbms_image::file" | eval }}
name: '{{ SELF.dbms_name }}'
env:
- name: MYSQL_ROOT_PASSWORD
Expand All @@ -7335,7 +7335,7 @@ node_types:
app: '{{ SELF.dbms_name }}'
type: ClusterIP
delete: exit 0
mysql.dbms~mysql.dbms::[email protected]:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -7736,7 +7736,6 @@ node_types:
content: |-
DBMS_NAME="{{ SELF.dbms_name }}"
APPLICATION_NAME="{{ SELF.application_name }}"
DBMS_VERSION="{{ SELF.dbms_version }}"
DBMS_PASSWORD="{{ SELF.dbms_password }}"
DBMS_SSL_MODE="{{ SELF.dbms_ssl_mode }}"
- name: copy management operation
Expand Down Expand Up @@ -7961,7 +7960,6 @@ node_types:
content: |-
DBMS_NAME="{{ SELF.dbms_name }}"
APPLICATION_NAME="{{ SELF.application_name }}"
DBMS_VERSION="{{ SELF.dbms_version }}"
DBMS_PASSWORD="{{ SELF.dbms_password }}"
DBMS_SSL_MODE="{{ SELF.dbms_ssl_mode }}"
- name: copy management operation
Expand Down Expand Up @@ -8120,7 +8118,7 @@ node_types:
- '--become'
- '--key-file={{ SELF.os_ssh_key_file }}'
- '--user={{ SELF.os_ssh_user }}'
mysql.dbms~mysql.dbms::[email protected]>virtual.machine:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]>virtual.machine:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -8200,8 +8198,8 @@ node_types:
- MYSQL_ROOT_PASSWORD={{ SELF.dbms_password }}
docker_image:
image:
- name: mysql:{{ SELF.dbms_version }}
mysql.dbms~mysql.dbms::[email protected]:
- name: mysql:{{ ".artifacts::mysql_dbms_image::file" | eval }}
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -8264,7 +8262,7 @@ node_types:
resource:
google_sql_database_instance:
dbms:
- database_version: MYSQL_{{ SELF.dbms_version | replace(".", "_") }}
- database_version: MYSQL_{{ ".artifacts::mysql_dbms_image::file" | eval | replace(".", "_") }}
deletion_protection: false
name: '{{ SELF.dbms_name }}'
root_password: '{{ SELF.dbms_password }}'
Expand All @@ -8285,7 +8283,7 @@ node_types:
instance: ${google_sql_database_instance.dbms.name}
name: root
password: ${google_sql_database_instance.dbms.root_password}
mysql.dbms~mysql.dbms::[email protected]:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -8363,7 +8361,7 @@ node_types:
spec:
- container:
- name: '{{ SELF.dbms_name }}'
image: mysql:{{ SELF.dbms_version }}
image: mysql:{{ ".artifacts::mysql_dbms_image::file" | eval }}
env:
- name: MYSQL_ROOT_PASSWORD
value: '{{ SELF.dbms_password }}'
Expand All @@ -8382,7 +8380,7 @@ node_types:
selector:
app: '{{ SELF.dbms_name }}'
type: ClusterIP
mysql.dbms~mysql.dbms::[email protected]:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -8571,7 +8569,6 @@ node_types:
cat <<EOF > {{ SELF.application_directory }}/.env
DBMS_NAME="{{ SELF.dbms_name }}"
APPLICATION_NAME="{{ SELF.application_name }}"
DBMS_VERSION="{{ SELF.dbms_version }}"
DBMS_PASSWORD="{{ SELF.dbms_password }}"
DBMS_SSL_MODE="{{ SELF.dbms_ssl_mode }}"
EOF>>
Expand Down Expand Up @@ -8749,7 +8746,6 @@ node_types:
cat <<EOF > {{ SELF.application_directory }}/.env
DBMS_NAME="{{ SELF.dbms_name }}"
APPLICATION_NAME="{{ SELF.application_name }}"
DBMS_VERSION="{{ SELF.dbms_version }}"
DBMS_PASSWORD="{{ SELF.dbms_password }}"
DBMS_SSL_MODE="{{ SELF.dbms_ssl_mode }}"
EOF>>
Expand Down Expand Up @@ -8936,7 +8932,6 @@ node_types:
cat <<EOF > {{ SELF.application_directory }}/.env
DBMS_NAME="{{ SELF.dbms_name }}"
APPLICATION_NAME="{{ SELF.application_name }}"
DBMS_VERSION="{{ SELF.dbms_version }}"
DBMS_PASSWORD="{{ SELF.dbms_password }}"
DBMS_SSL_MODE="{{ SELF.dbms_ssl_mode }}"
EOF>>
Expand Down Expand Up @@ -9062,7 +9057,7 @@ node_types:
- sudo bash /tmp/stop-mysql.dbms.sh
- sudo bash /tmp/delete-mysql.dbms.sh
when: destroy
mysql.dbms~mysql.dbms::[email protected]:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -9138,7 +9133,7 @@ node_types:
app: '{{ SELF.dbms_name }}'
spec:
containers:
- image: mysql:{{ SELF.dbms_version }}
- image: mysql:{{ ".artifacts::mysql_dbms_image::file" | eval }}
name: '{{ SELF.dbms_name }}'
env:
- name: MYSQL_ROOT_PASSWORD
Expand Down Expand Up @@ -9171,7 +9166,7 @@ node_types:
ansible.builtin.pause:
seconds: 10
delete: exit 0
mysql.dbms~mysql.dbms::[email protected]>virtual.machine:
mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]>virtual.machine:
derived_from: mysql.dbms
metadata:
vintner_generated: 'true'
Expand Down Expand Up @@ -9234,7 +9229,7 @@ node_types:
services:
application:
container_name: '{{ SELF.dbms_name }}'
image: mysql:{{ SELF.dbms_version }}
image: mysql:{{ ".artifacts::mysql_dbms_image::file" | eval }}
network_mode: host
environment:
MYSQL_ROOT_PASSWORD: '{{ SELF.dbms_password }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,16 @@ topology_template:
- host: cart_dbms

cart_dbms:
type: mysql.dbms~mysql.dbms::[email protected]
type: mysql.dbms~mysql.dbms#mysql.dbms.image::[email protected]
properties:
dbms_name: unfurl-technology-boutique-cart-dbms
dbms_password: {get_input: dbms_password}
requirements:
- host: gcp_cloudsql
artifacts:
mysql_dbms_image:
type: mysql.dbms.image
file: 5.7

###################################################
#
Expand Down
Loading

0 comments on commit df44284

Please sign in to comment.