From 9f36bc2b2e3b05a385a7d12fb3d1d81f09414e0f Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Sun, 8 Jul 2018 07:46:58 +0200 Subject: [PATCH 01/11] prepare release 2.1.0 --- docker-types/docker-types.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-types/docker-types.yml b/docker-types/docker-types.yml index 0dfaf92..f2fcc97 100644 --- a/docker-types/docker-types.yml +++ b/docker-types/docker-types.yml @@ -3,7 +3,7 @@ tosca_definitions_version: alien_dsl_2_0_0 metadata: template_name: docker-types template_author: alien4cloud - template_version: 2.0.0 + template_version: 2.1.0-SNAPSHOT imports: - tosca-normative-types:1.0.0-ALIEN20 From b70bc3eb16b4f2e96e240ada2e6bae37626c18ed Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Mon, 9 Jul 2018 22:28:21 +0200 Subject: [PATCH 02/11] prepare release 2.1.0-SM5 --- docker-types/docker-types.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-types/docker-types.yml b/docker-types/docker-types.yml index f2fcc97..91c24de 100644 --- a/docker-types/docker-types.yml +++ b/docker-types/docker-types.yml @@ -3,7 +3,7 @@ tosca_definitions_version: alien_dsl_2_0_0 metadata: template_name: docker-types template_author: alien4cloud - template_version: 2.1.0-SNAPSHOT + template_version: 2.1.0-SM5 imports: - tosca-normative-types:1.0.0-ALIEN20 From 04f12c6d341c10f5a162be189b4f1de26212edd8 Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Tue, 17 Jul 2018 10:18:09 +0200 Subject: [PATCH 03/11] Prepare next iteration --- docker-types/docker-types.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-types/docker-types.yml b/docker-types/docker-types.yml index 91c24de..f2fcc97 100644 --- a/docker-types/docker-types.yml +++ b/docker-types/docker-types.yml @@ -3,7 +3,7 @@ tosca_definitions_version: alien_dsl_2_0_0 metadata: template_name: docker-types template_author: alien4cloud - template_version: 2.1.0-SM5 + template_version: 2.1.0-SNAPSHOT imports: - tosca-normative-types:1.0.0-ALIEN20 From 93c66159ab3e057158d00e45872b44771c0883ce Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Tue, 21 Aug 2018 17:16:55 +0200 Subject: [PATCH 04/11] [ALIEN-2956] add config map autogeneration feature --- docker-types/{docker-types.yml => types.yml} | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) rename docker-types/{docker-types.yml => types.yml} (83%) diff --git a/docker-types/docker-types.yml b/docker-types/types.yml similarity index 83% rename from docker-types/docker-types.yml rename to docker-types/types.yml index f2fcc97..0a1d433 100644 --- a/docker-types/docker-types.yml +++ b/docker-types/types.yml @@ -17,6 +17,24 @@ artifact_types: description: Docker Container Image derived_from: tosca.artifacts.Deployment.Image +data_types: + org.alien4cloud.extended.container.datatypes.ConfigSetting: + derived_from: tosca.datatypes.Root + description: Setting for a set of prefixed inputs related to a given folder in the topology and for which a configMap will be mounted on the container (K8S). + properties: + mount_path: + type: string + description: where the config map will be mount onto the container. + required: true + input_prefix: + type: string + description: the prefix used for the input names. + required: true + config_path: + type: string + description: where to to find the files that will be used to create the configMap. + required: true + node_types: org.alien4cloud.extended.container.types.ContainerRuntime: @@ -105,6 +123,18 @@ node_types: # will be [1, 1] since it's not an option occurrences: [1, 1] + tosca.nodes.Container.Application.ConfigurableDockerContainer: + abstract: true + derived_from: tosca.nodes.Container.Application.DockerContainer + description: > + A specification of a DockerContainer that is configurable. In K8S, we'll use configMaps. + properties: + config_settings: + type: list + required: false + entry_schema: + type: org.alien4cloud.extended.container.datatypes.ConfigSetting + org.alien4cloud.nodes.DockerExtVolume: abstract: true derived_from: tosca.nodes.BlockStorage From b08c24618163415fa03ac2eca0e265d52ea9c5fb Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Thu, 13 Sep 2018 16:39:27 +0200 Subject: [PATCH 05/11] Add a way to specify which bash to use for K8S --- docker-types/types.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker-types/types.yml b/docker-types/types.yml index 0a1d433..73d53de 100644 --- a/docker-types/types.yml +++ b/docker-types/types.yml @@ -98,6 +98,15 @@ node_types: entry_schema: description: Docker run arguments. Allows safe usage of Docker ENTRYPOINT statement in the Dockerfile. type: string + docker_bash_cmd: + type: list + entry_schema: + type: string + required: false + default: + - "/bin/bash" + - "-c" + description: Docker run command. Will override the Dockerfile CMD statement. docker_run_cmd: type: string required: false From 11d215556da2b57c5bedfdb67ad1a0c2e6c6675e Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Fri, 5 Oct 2018 14:56:14 +0200 Subject: [PATCH 06/11] [ALIEN-2989] Add DockerArtifactVolume type, a volume handle an artifact (used to manage K8S secrets) - add cpu_share_limit & mem_share_limit optional properties on docker container - add readonly and container_subPath to volume mount relationship --- docker-types/types.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/docker-types/types.yml b/docker-types/types.yml index 73d53de..b482c32 100644 --- a/docker-types/types.yml +++ b/docker-types/types.yml @@ -77,12 +77,22 @@ node_types: type: float required: true default: 1.0 + cpu_share_limit: + type: float + required: false + default: 1.0 mem_share: type: scalar-unit.size required: true default: 128 MB constraints: - greater_or_equal: 0 MB + mem_share_limit: + type: scalar-unit.size + required: false + default: 128 MB + constraints: + - greater_or_equal: 0 MB disk_share: type: integer required: false @@ -168,6 +178,16 @@ node_types: relationship: tosca.relationships.HostedOn occurrences: [0, 1] + org.alien4cloud.nodes.DockerArtifactVolume: + derived_from: org.alien4cloud.nodes.DockerExtVolume + abstract: true + description: | + This volume has an artifact, can be used to create a K8S secret from a file or files in a directory for example. + tags: + icon: /images/volume.png + artifacts: + - resources: + type: tosca.artifacts.File capability_types: @@ -187,7 +207,6 @@ capability_types: Capability to mount a Docker volume valid_source_types: [ org.alien4cloud.nodes.DockerExtVolume ] - relationship_types: org.alien4cloud.extended.container.relationships.HostedOnContainerRuntime: @@ -202,3 +221,11 @@ relationship_types: type: string required: true description: Specifies where the volume is mounted inside the container. + container_subPath: + type: string + required: false + description: Path within the volume from which the container's volume should be mounted. + readonly: + type: boolean + required: false + default: false From 35f930fbc5e9e7e05e6c81b3dd97f5fb962fcf71 Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Fri, 5 Oct 2018 21:07:22 +0200 Subject: [PATCH 07/11] [ALIEN-2989] Fix issue : Yorc needs artifacts to be defined to a file to parse --- docker-types/README.md | 3 +++ docker-types/types.yml | 10 +--------- 2 files changed, 4 insertions(+), 9 deletions(-) create mode 100644 docker-types/README.md diff --git a/docker-types/README.md b/docker-types/README.md new file mode 100644 index 0000000..60b94b0 --- /dev/null +++ b/docker-types/README.md @@ -0,0 +1,3 @@ +# docker-tosca-types + +TODO diff --git a/docker-types/types.yml b/docker-types/types.yml index b482c32..fa2e551 100644 --- a/docker-types/types.yml +++ b/docker-types/types.yml @@ -159,15 +159,6 @@ node_types: derived_from: tosca.nodes.BlockStorage tags: icon: /images/volume.png - # properties: - # volume_name: - # type: string - # description: Name of the volume. If it does not exist, it is created implicitly. Otherwise, the existing volume is reused. - # required: true - # device: - # type: string - # required: false - # default: "" requirements: - attachment: capability: org.alien4cloud.capabilities.DockerVolumeAttachment @@ -188,6 +179,7 @@ node_types: artifacts: - resources: type: tosca.artifacts.File + file: README.md capability_types: From f293c1e43e98d82d17f47625f846e40baaa69aa3 Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Fri, 5 Oct 2018 21:47:55 +0200 Subject: [PATCH 08/11] [ALIEN-2990] we can now set mem_limit and cpu_limit with different values from _request --- docker-types/types.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-types/types.yml b/docker-types/types.yml index fa2e551..6048f2b 100644 --- a/docker-types/types.yml +++ b/docker-types/types.yml @@ -80,7 +80,6 @@ node_types: cpu_share_limit: type: float required: false - default: 1.0 mem_share: type: scalar-unit.size required: true @@ -90,7 +89,6 @@ node_types: mem_share_limit: type: scalar-unit.size required: false - default: 128 MB constraints: - greater_or_equal: 0 MB disk_share: From 502cd3de478671b0fc47549ddf0013ebf94a7523 Mon Sep 17 00:00:00 2001 From: Xavier DEGENNE Date: Sun, 7 Oct 2018 15:04:43 +0200 Subject: [PATCH 09/11] we can need to mount a config map using a subpath so add an optional property on configurable container --- docker-types/types.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-types/types.yml b/docker-types/types.yml index 6048f2b..ba9d35c 100644 --- a/docker-types/types.yml +++ b/docker-types/types.yml @@ -26,6 +26,10 @@ data_types: type: string description: where the config map will be mount onto the container. required: true + mount_subPath: + type: string + description: where the config map will be mount onto the container. + required: false input_prefix: type: string description: the prefix used for the input names. From ed9127b7e1ed628d8df9c33870b7c7fcd96b4abb Mon Sep 17 00:00:00 2001 From: Adriana Danes Date: Wed, 10 Oct 2018 09:17:10 +0200 Subject: [PATCH 10/11] Add deployment unit for Jobs ContainerRuntime --- docker-types/docker-types.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker-types/docker-types.yml b/docker-types/docker-types.yml index 0dfaf92..20e43dd 100644 --- a/docker-types/docker-types.yml +++ b/docker-types/docker-types.yml @@ -44,6 +44,14 @@ node_types: capabilities: host: tosca.capabilities.Container.Docker scalable: tosca.capabilities.Scalable + + org.alien4cloud.extended.container.types.ContainerJobUnit: + abstract: true + derived_from: tosca.nodes.Root + description: > + Can host containers to be run as Jobs. + capabilities: + host: tosca.capabilities.Container.Docker # rename as ContainerApplication ? tosca.nodes.Container.Application.DockerContainer: From f8e7e3b26d8415e39314d1fb6ad5c0d8298ff95f Mon Sep 17 00:00:00 2001 From: Adriana Danes Date: Wed, 10 Oct 2018 09:56:42 +0200 Subject: [PATCH 11/11] Update template version --- docker-types/docker-types.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-types/docker-types.yml b/docker-types/docker-types.yml index 20e43dd..2832e90 100644 --- a/docker-types/docker-types.yml +++ b/docker-types/docker-types.yml @@ -3,7 +3,7 @@ tosca_definitions_version: alien_dsl_2_0_0 metadata: template_name: docker-types template_author: alien4cloud - template_version: 2.0.0 + template_version: 2.1.0-SNAPSHOT imports: - tosca-normative-types:1.0.0-ALIEN20 @@ -44,7 +44,7 @@ node_types: capabilities: host: tosca.capabilities.Container.Docker scalable: tosca.capabilities.Scalable - + org.alien4cloud.extended.container.types.ContainerJobUnit: abstract: true derived_from: tosca.nodes.Root