tosca_definitions_version: tosca_simple_yaml_1_0 imports: - grycap_custom_types: https://raw.githubusercontent.com/grycap/tosca/main/custom_types.yaml description: > Deploy a compute node getting the IP and SSH credentials to access via ssh with an extra HD disk. metadata: template_name: VM template_version: "1.2.1" template_author: Miguel Caballer creation_date: 2020-09-08 display_name: Deploy a VM icon: images/vm-icon-disk.png tag: VM order: 1 tabs: VM Data: - num_cpus - mem_size - disk_size - swap_size - instance_type - num_instances - storage_size - mount_path - ports - dns_name - private_ip GPU Data: .*gpu.* childs: - docker.yaml - galaxy.yaml - users.yml - ssh_keys.yml - proxy_host.yaml - minio_compose.yaml - nvidia.yml - ansible_tasks.yml - ssh_oidc.yaml - noderedvm.yaml - cernvmfs.yaml - image-service.yaml - ai4eoscvm.yaml - mlflowvm.yaml - mlflow_authvm.yaml - wget.yml - sgde.yaml - flowfuse.yaml - stac_vm.yaml - dataset.yaml - dataset_list.yaml - dataset_dts.yaml - ollama.yaml - juno_compose.yaml - vscode_compose.yaml - haddock_compose.yaml topology_template: inputs: num_cpus: type: integer description: Number of virtual cpus for the VM default: 2 constraints: - valid_values: [ 2, 4, 8, 16, 32, 64, 1 ] mem_size: type: scalar-unit.size description: Amount of memory for the VM default: 4 GB constraints: - valid_values: [ 4 GB, 8 GB, 16 GB, 32 GB, 64 GB, 128 GB, 256 GB, 512 GB, 2 GB ] disk_size: type: scalar-unit.size description: Size of the root disk of the VM (in case of 0 disk will no be resized) default: 20 GiB constraints: - valid_values: [ 20 GiB, 50 GiB, 100 GiB, 200 GiB, 0 GiB ] instance_type: type: string description: Flavor name of the instance default: "" num_instances: type: integer description: Number of VMs to be spawned default: 1 swap_size: type: scalar-unit.size description: Size of the extra HD added to the instance to use as Swap space (Set 0 if it is not needed) default: 0 GiB constraints: - valid_values: [ 0 GiB, 4 GiB, 8 GiB, 16 GiB, 32 GiB, 64 GiB, 128 GiB, 256 GiB, 512 GiB ] storage_size: type: scalar-unit.size description: Size of the extra HD added to the instance (Set 0 if disk is not needed) default: 0 GiB constraints: - valid_values: [ 0 GiB, 10 GiB, 20 GiB, 50 GiB, 100 GiB, 200 GiB, 500 GiB, 1 TiB, 2 TiB, 10 TiB, 20 TiB, 40 TiB, 100 TiB ] mount_path: type: string description: Path to mount the extra disk default: /mnt/disk num_gpus: type: integer description: Number of GPUs to assing to this VM default: 0 constraints: - valid_values: [ 0, 1, 2, 3, 4 ] gpu_vendor: type: string description: GPU Vendor default: '' constraints: - valid_values: [ '', 'NVIDIA', 'AMD' ] gpu_model: type: string description: GPU Model default: '' ports: type: map entry_schema: type: PortSpec description: | List of ports to be Opened in the Cloud site (eg. 22,80,443,2000:2100). You can also include the remote CIDR (eg. 8.8.0.0/24). default: ssh_port: source: 22 protocol: tcp dns_name: type: string description: DNS name to be used for the VM default: "" private_ip: type: boolean description: Assign a private IP to the VM. Change only if you know what you are doing. default: true constraints: - valid_values: [ true, false ] node_templates: simple_node: type: tosca.nodes.indigo.Compute capabilities: endpoint: properties: additional_dns_names: - { get_input: dns_name } network_name: PUBLIC ports: { get_input: ports } private_ip: { get_input: private_ip } scalable: properties: count: { get_input: num_instances } host: properties: disk_size: { get_input: disk_size } num_cpus: { get_input: num_cpus } mem_size: { get_input: mem_size } num_gpus: { get_input: num_gpus } gpu_vendor: { get_input: gpu_vendor } gpu_model: { get_input: gpu_model } instance_type: { get_input: instance_type } os: properties: type: linux # Add dummy task to activate context interfaces: Standard: configure: implementation: https://raw.githubusercontent.com/grycap/tosca/main/artifacts/dummy.yml requirements: - local_storage: node: my_block_storage capability: tosca.capabilities.Attachment relationship: type: tosca.relationships.AttachesTo properties: location: { get_input: mount_path } - local_storage: node: swap_storage capability: tosca.capabilities.Attachment relationship: type: tosca.relationships.indigo.AttachesTo properties: fs_type: swap location: swap my_block_storage: type: tosca.nodes.BlockStorage properties: size: { get_input: storage_size } swap_storage: type: tosca.nodes.BlockStorage properties: size: { get_input: swap_size } outputs: node_ip: value: { get_attribute: [ simple_node, public_address, 0 ] } node_creds: value: { get_attribute: [ simple_node, endpoint, credential, 0 ] }