Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dataset types #177

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions artifacts/download_dataset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Install datahugger and download dataset
hosts: localhost
vars:
ansible_python_interpreter: /usr/bin/python3
tasks:
- name: Ensure python3-pip is installed
ansible.builtin.package:
name: python3-pip
state: present

- name: Install datahugger Python module
ansible.builtin.pip:
name: datahugger
state: present
executable: pip3

- name: Download the dataset
grycap.dataset.download_dataset:
dataset_url: "{{ dataset_url }}"
output_dir: "{{ output_dir }}"
65 changes: 65 additions & 0 deletions custom_types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,39 @@ data_types:
type: string
required: no

tosca.datatypes.Dataset:
derived_from: tosca.datatypes.Root
description: A data type that represents a dataset, including its DOI and other metadata.
properties:
identifier:
type: string
description: The Digital Object Identifier of the dataset.
required: true
title:
type: string
description: The title of the dataset.
required: false
description:
type: string
description: A description of the dataset.
required: false
creator:
type: string
description: The creator of the dataset.
required: false
release_date:
type: string
description: The publication date of the dataset.
required: false
downloadURL:
type: string
description: The URL to download the dataset.
required: false
license:
type: string
description: A legal document under which the resource is made available.
required: false

capability_types:

tosca.capabilities.indigo.OperatingSystem:
Expand Down Expand Up @@ -1894,6 +1927,38 @@ node_types:
valid_source_types: [tosca.nodes.Container.Application.Docker]
relationship: tosca.relationships.HostedOn

tosca.nodes.eosc.Dataset:
derived_from: tosca.nodes.Root
properties:
dataset:
type: tosca.datatypes.Dataset
description: The dataset associated with this node.
required: true
filter:
type: string
description: Regex to express the set of files to get from the Dataset.
required: false
dest:
type: string
description: Path to download the set of files from the Dataset.
required: false
requirements:
- host:
capability: tosca.capabilities.Compute
node: tosca.nodes.Compute
relationship: tosca.relationships.HostedOn
artifacts:
datase_collection:
file: git+https://github.com/grycap/ansible-collection-dataset
type: tosca.artifacts.AnsibleGalaxy.collection
interfaces:
Standard:
configure:
implementation: https://raw.githubusercontent.com/grycap/tosca/datasets/artifacts/lrms/download_dataset.yaml
inputs:
dataset_url: { get_property: [ SELF, dataset, identifier ] }
output_dir: { get_property: [ SELF, dest ] }

policy_types:

tosca.policies.indigo.Placement:
Expand Down
3 changes: 3 additions & 0 deletions tests/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ roles:

collections:
- name: community.crypto
- name: grycap.dataset
source: https://github.com/grycap/ansible-collection-dataset
type: git
- name: community.docker
version: 3.12.2
Loading