Skip to content

Commit

Permalink
Merge pull request #100 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Feb 19, 2024
2 parents abcaa6e + ca97202 commit 5b98daa
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Tests

on:

push:
branches: ["main"]

pull_request:
branches: ["main"]

Expand Down
6 changes: 6 additions & 0 deletions custom_types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,12 @@ node_types:

tosca.nodes.Container.Application.Docker:
derived_from: tosca.nodes.Container.Application
attributes:
endpoints:
type: list
description: List of service endpoints
entry_schema:
type: string
properties:
environment:
type: map
Expand Down
2 changes: 0 additions & 2 deletions templates/ansible_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ metadata:
template_name: Ansible
display_name: Ansible tasks
icon: images/ansible.png
tag: SW
tag_color: blue
tabs:
Ansible Tasks:
- ansible_tasks:
Expand Down
2 changes: 0 additions & 2 deletions templates/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ metadata:
template_name: Docker + Compose
display_name: Install Docker + Docker Compose
icon: images/docker.png
tag: SW
tag_color: blue
tabs:
Docker Data: .*
parents:
Expand Down
2 changes: 0 additions & 2 deletions templates/docker_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ metadata:
template_name: Docker + Compose
display_name: Install Docker + Docker Compose
icon: images/docker.png
tag: SW
tag_color: blue
tabs:
Docker Data: .*
parents:
Expand Down
2 changes: 0 additions & 2 deletions templates/galaxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ metadata:
template_name: Galaxy
display_name: Deploy a Galaxy portal
icon: images/galaxy.png
tag: SW
tabs:
Galaxy Data: .*
tag_color: blue
parents:
- simple-node-disk.yml

Expand Down
98 changes: 98 additions & 0 deletions templates/k8s_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
tosca_definitions_version: tosca_simple_yaml_1_0

imports:
- grycap_custom_types: https://raw.githubusercontent.com/grycap/tosca/devel/custom_types.yaml

description: TOSCA test for K8s

metadata:
template_name: Containerized App
template_version: "0.1.0"
template_author: Miguel Caballer
creation_date: 2024-02-16
display_name: Deploy a Containerized App
icon: images/contapp.png
tag: Container
tag_color: blue
tabs:
Container Data: .*

topology_template:

inputs:
cpu:
type: float
description: Number of virtual cpus for the container
default: 1.0
memory:
type: scalar-unit.size
description: Memory size for the container
default: 512 MB

image:
type: string
description: The image to be used in the container
default: "mysql:5.7"

pvc_size:
type: scalar-unit.size
description: Size of the Persistent Volume Claim
default: 10 GB
pvc_mount_path:
type: string
description: Path to mount the Persistent Volume Claim
default: "/var/lib/mysql"

environment:
type: map
entry_schema:
type: string
description: Environment variables to be set in the container
default:
MYSQL_ROOT_PASSWORD: my-secret

ports:
type: list
entry_schema:
type: PortSpec
description: List of ports to be published in the container (ContarinerPort - PublishedPort)
default:
- target: 3306
source: 33306


node_templates:

container_app:
type: tosca.nodes.Container.Application.Docker
properties:
environment: { get_input: environment }
requirements:
- host: container_runtime
artifacts:
my_image:
file: { get_input: image }
type: tosca.artifacts.Deployment.Image.Container.Docker

# The properties of the runtime to host the container
container_runtime:
type: tosca.nodes.Container.Runtime.Docker
capabilities:
host:
properties:
num_cpus: { get_input: cpu }
mem_size: { get_input: memory }
publish_ports: { get_input: ports }
volumes:
- { concat: [ "container_vol:", { get_input: pvc_mount_path } ] }

container_vol:
type: tosca.nodes.BlockStorage
properties:
size: { get_input: pvc_size }
# Set the PV name in this field
# volume_id: "PV name"

outputs:
mysql_service_url:
value: { get_attribute: [ container_app, endpoints, 0 ] }
4 changes: 2 additions & 2 deletions templates/nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ metadata:
template_name: NVIDIA Drivers
display_name: Install NVIDIA Drivers
icon: images/nvidia.png
tag: SW
tag_color: blue
tag: SYS
tag_color: purple
tabs:
NVIDIA:
- driver_version
Expand Down
3 changes: 1 addition & 2 deletions templates/proxy_host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ imports:
description: Enable to access the VM in an private network trought a Proxy/Bastion host.

metadata:
template_version: "1.0.0"
template_version: "1.0.1"
template_name: Proxy/Bastion host
display_name: Enable to access the VM trought a Proxy/Bastion host.
icon: images/bastion.png
tag: VM
tabs:
Proxy/Bastion host:
- proxy_host
Expand Down

0 comments on commit 5b98daa

Please sign in to comment.