Skip to content

Commit

Permalink
continue object storage (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Sep 11, 2024
1 parent 2aecb85 commit e1cab7b
Show file tree
Hide file tree
Showing 61 changed files with 2,120 additions and 829 deletions.
711 changes: 375 additions & 336 deletions docs/docs/variability4tosca/rules/index.md

Large diffs are not rendered by default.

179 changes: 105 additions & 74 deletions docs/docs/variability4tosca/rules/technology-rules.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,3 @@
- technology: ansible
component: bucket
hosting:
- gcp.cloudstorage
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: terraform
component: bucket
hosting:
- gcp.cloudstorage
weight: 1
reason: Terraform provides a declarative module.
- technology: ansible
component: bucket
artifact: cache.image
hosting:
- gcp.memorystore
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: ansible
component: bucket
hosting:
- minio.server
- '*'
- local.machine
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: terraform
component: bucket
hosting:
- minio.server
- '*'
- local.machine
weight: 1
reason: Terraform provides a declarative module.
- technology: ansible
component: bucket
hosting:
- minio.server
- '*'
- remote.machine
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: terraform
component: bucket
hosting:
- minio.server
- '*'
- remote.machine
weight: 1
reason: Terraform provides a declarative module.
- technology: ansible
component: bucket
hosting:
- minio.server
- kubernetes.cluster
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: terraform
component: bucket
hosting:
- minio.server
- kubernetes.cluster
weight: 1
reason: Terraform provides a declarative module.
- technology: ansible
component: docker.engine
hosting:
Expand Down Expand Up @@ -389,6 +324,87 @@
weight: 0
reason: Ansible is more specialized. Also using provisioners is a "last resort".
details: '"terraform_data" resource with an "ssh" connection to the virtual machine to copy the install script using the "file" provisioner on the virtual machine and to execute the script using the "remote-exec" provisioner'
- technology: ansible
component: object.storage
hosting:
- gcp.cloudstorage
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: terraform
component: object.storage
hosting:
- gcp.cloudstorage
weight: 1
reason: Terraform provides a declarative module.
- technology: ansible
component: object.storage
hosting:
- minio.server
- docker.engine
- local.machine
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: compose
component: object.storage
hosting:
- minio.server
- docker.engine
- local.machine
weight: 0
reason: One-time use docker container ("fake Kubernetes job") with imperative parts, while other technologies provide declarative modules.
- technology: terraform
component: object.storage
hosting:
- minio.server
- docker.engine
- local.machine
weight: 1
reason: Terraform provides a declarative module.
- technology: ansible
component: object.storage
hosting:
- minio.server
- docker.engine
- remote.machine
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: compose
component: object.storage
hosting:
- minio.server
- docker.engine
- remote.machine
weight: 0
reason: One-time use docker container ("fake Kubernetes job") with imperative parts, while other technologies provide declarative modules.
- technology: terraform
component: object.storage
hosting:
- minio.server
- docker.engine
- remote.machine
weight: 0.5
reason: Terraform provides a declarative module. However, Terraform requires an SSH workaround. Ansible is more specialized.
- technology: ansible
component: object.storage
hosting:
- minio.server
- kubernetes.cluster
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: kubernetes
component: object.storage
hosting:
- minio.server
- kubernetes.cluster
weight: 0
reason: Kubernetes Job with imperative parts, while declarative other technologies provide declarative modules.
- technology: terraform
component: object.storage
hosting:
- minio.server
- kubernetes.cluster
weight: 0
reason: Ansible is more specialized.
- technology: ansible
component: redis.server
artifact: cache.image
Expand Down Expand Up @@ -443,6 +459,13 @@
weight: 0.5
reason: Docker Compose is more specialized.
details: '"docker_container" and "docker_image" resources'
- technology: ansible
component: redis.server
artifact: cache.image
hosting:
- gcp.memorystore
weight: 1
reason: Primary use case due to the specialization of Ansible.
- technology: terraform
component: redis.server
artifact: cache.image
Expand All @@ -457,6 +480,14 @@
- kubernetes.cluster
weight: 0.5
reason: Kubernetes is more specialized.
- technology: kubernetes
component: redis.server
artifact: cache.image
hosting:
- kubernetes.cluster
weight: 1
reason: Kubernetes is the underlying technology.
details: Kubernetes manifest generated and applied
- technology: terraform
component: redis.server
artifact: cache.image
Expand Down Expand Up @@ -646,15 +677,6 @@
weight: 1
reason: Terraform provides a declarative module.
details: '"google_app_engine_standard_app_version", "google_project_iam_member", "google_service_account", "google_storage_bucket", and "google_storage_bucket_object" resources'
- technology: terraform
component: software.application
artifact: apt.archive
hosting:
- '*'
- remote.machine
weight: 0
reason: Ansible is more specialized. Also using provisioners is a "last resort".
details: '"file" provisioner to upload scripts and "remote-exec" to execute scripts'
- technology: ansible
component: software.application
artifact: apt.package
Expand Down Expand Up @@ -682,6 +704,15 @@
weight: 1
reason: Primary use case due to the specialization of Ansible.
details: '"ansible.builtin.shell", "ansible.builtin.apt_key", "ansible.builtin.apt_repository", "ansible.builtin.apt", and "ansible.builtin.copy", tasks with "when" statements'
- technology: terraform
component: software.application
artifact: apt.package
hosting:
- '*'
- remote.machine
weight: 0
reason: Ansible is more specialized. Also using provisioners is a "last resort".
details: '"file" provisioner to upload scripts and "remote-exec" to execute scripts'
- technology: ansible
component: software.application
artifact: tar.archive
Expand Down
2 changes: 1 addition & 1 deletion src/assets/scripts/install-unfurl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ fi
# See also https://github.com/onecommons/unfurl/blob/main/full-requirements.txt
# requests==2.31.0 is required, see https://github.com/ansible-collections/community.docker/issues/868
pip install unfurl==1.0.0 openstacksdk==0.61 python-openstackclient==6.0.0 pymysql==1.1.0 kubernetes==24.2.0 openshift==0.13.2 docker[tls] requests==2.31.0 ansible==8.7.0 ansible-core==2.15.9
ansible-galaxy collection install community.docker:3.9.0 kubernetes.core:3.2.0 google.cloud:1.2.0 --force
ansible-galaxy collection install community.docker:3.9.0 kubernetes.core:3.2.0 google.cloud:1.2.0 dubzland.minio:1.2.0 --force
2 changes: 1 addition & 1 deletion src/assets/scripts/install-xopera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ fi
# pyyaml==5.3.1 is required, see https://github.com/yaml/pyyaml/issues/724#issuecomment-1638587228
# requests==2.31.0 is required, see https://github.com/ansible-collections/community.docker/issues/868
pip install opera==0.6.9 openstacksdk==0.61 python-openstackclient==6.0.0 pyyaml==5.3.1 pymysql==1.1.0 ansible==8.7.0 ansible-core==2.15.9
ansible-galaxy collection install community.docker:3.9.0 kubernetes.core:3.2.0 google.cloud:1.2.0 --force
ansible-galaxy collection install community.docker:3.9.0 kubernetes.core:3.2.0 google.cloud:1.2.0 dubzland.minio:1.2.0 --force
21 changes: 21 additions & 0 deletions src/normative/dialects/unfurl/core/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,27 @@ const nodes: RecursivePartial<NodeTypeMap> = {
},
},
},
cache: {
attributes: {
application_endpoint: {
default: {
concat: [
{
eval: '.::application_protocol',
},
'://',
{
eval: '.::application_address',
},
':',
{
eval: '.::application_port',
},
],
},
},
},
},
}

export default nodes
48 changes: 38 additions & 10 deletions src/normative/types/core/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,37 +228,59 @@ const nodes: NodeTypeMap = {
},
cache: {
derived_from: 'software.application',
properties: {
cache_name: {
type: 'string',
},
cache_port: {
type: 'string',
},
},
attributes: {
application_endpoint: {
type: 'string',
},
application_address: {
type: 'string',
},
},
},
storage: {
derived_from: 'node',
metadata: {
...MetadataNormative(),
},
},
'block.storage': {
derived_from: 'storage',
metadata: {
...MetadataNormative(),
},
},
'object.storage': {
derived_from: 'storage',
},
'file.storage': {
derived_from: 'storage',
},
bucket: {
derived_from: 'object.storage',
metadata: {
...MetadataNormative(),
},
properties: {
bucket_name: {
storage_name: {
type: 'string',
},
storage_dialect: {
type: 'string',
},
bucket_dialect: {
storage_user: {
type: 'string',
},
storage_token: {
type: 'string',
},
},
attributes: {
bucket_endpoint: {
storage_endpoint: {
type: 'string',
},
bucket_token: {
storage_token: {
type: 'string',
},
},
Expand All @@ -271,6 +293,12 @@ const nodes: NodeTypeMap = {
},
],
},
'file.storage': {
derived_from: 'storage',
metadata: {
...MetadataNormative(),
},
},
ingress: {
derived_from: 'node',
metadata: {
Expand Down
21 changes: 15 additions & 6 deletions src/normative/types/extended/nodes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {NodeTypeMap} from '#spec/node-type'
import {METADATA} from '#technologies/plugins/rules/types'
import {MetadataAbstract, MetadataNormative} from '../utils'

const nodes: NodeTypeMap = {
Expand Down Expand Up @@ -585,19 +586,27 @@ const nodes: NodeTypeMap = {
metadata: {
...MetadataNormative(),
},
properties: {
access_key: {
type: 'string',
metadata: {
[METADATA.VINTNER_NAME]: 'MINIO_ROOT_USER',
},
},
secret_key: {
type: 'string',
metadata: {
[METADATA.VINTNER_NAME]: 'MINIO_ROOT_PASSWORD',
},
},
},
},
'redis.server': {
derived_from: 'cache',
metadata: {
...MetadataNormative(),
},
properties: {
cache_name: {
type: 'string',
},
cache_port: {
type: 'string',
},
application_protocol: {
type: 'string',
default: 'redis',
Expand Down
Loading

0 comments on commit e1cab7b

Please sign in to comment.