Giter VIP home page Giter VIP logo

alien4cloud-deep's People

Contributors

asalic avatar caifti avatar dependabot[bot] avatar gmolto avatar mariojmdavid avatar orviz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alien4cloud-deep's Issues

concat TOSCA parsing

The concat method doesn't work in outputs when combined with other methods e.g.

concat: [ "a", get_attribute: [ server, ip ], "c" ]

Obtain Certificate

The procedure to obtain the certificate from orchestrator and INDIGO-IAM (Obtain Certificate secion) is useless if presented and explained before the the Plugin Parameters secion. Obtain Certificate secion should be a subsection of the Plugin Parameter.

Reported by @alexcos78

[A4C] Convert import

The imports in A4C use the format:

import_name: version
In indigo and other projects the imports are written as:

import_name: link_to_TOSCA

A4C should convert the link_to_TOSCA path to a version of the import_name that already exists in the A4C local repo.

[A4C] CSARs should contain the import path in their version

Instead of having a version for the CSARs containing the normative types, we should store the path that is used by the topologies that make use of that CSAR.
instead of:

metadata:
  template_name: tosca-normative-types
  template_author: TOSCA TC
  template_version: 1.0.0-ALIEN20

we should have

metadata:
  template_name: tosca-normative-types
  template_author: TOSCA TC
  template_version: https://raw.githubusercontent.com/alien4cloud/tosca-normative-types/master/normative-types.yml

get_attribute is not supported by Alien4Cloud

For now, we advise the users to set the value of the attributes that should get the values through get_attribute as strings containing the actual method call. Using the text editor is highly advisable. Example (normal TOSCA to Alien4Cloud version_): dns: { get_attribute: [ HOST, dns ] } becomes dns: "{ get_attribute: [ HOST, dns ] }" and IP_list:\n - { get_attribute: [ HOST, ip ] } becomes IP_list:\n - "{ get_attribute: [ HOST, ip ] }"

[Plugin] User per deployment

Try to get user per stored deployment instead of the logged in. Otherwise there is no way to get status of deployed apps when A4C starts up.

[settings-manager] Specify first run attributes

Some attributes are ignored by A4C after the first launch. Basically the values are already in the runtime cache like the admin username/password. Others like the certificates and the location of the runtime are taken into consideration each time A4C starts.

[A4C] Converts get_input when loading topology

A4C converts the get_input function from the topologies you upload to scalar types (as defined by the node template).

`topology_template:

node_templates:
marathon:
force_pull_image: { get_input: rclone_conf }`

becomes

`topology_template:

node_templates:
marathon:
force_pull_image: true`

A4C settings mananger cannot load certificate

Attaching to a4c
a4c | 2018-10-24 11:02:29 INFO Main:53 - Creating A4C_RUNTIME_DIR dir on /mnt/a4c_runtime_data
a4c | 2018-10-24 11:02:29 INFO Main:66 - Write a4c conf at /opt/a4c/config/alien4cloud-config.yml
a4c | Exception in thread "main" java.lang.ClassCastException: org.bouncycastle.asn1.pkcs.PrivateKeyInfo cannot be cast to org.bouncycastle.openssl.PEMEncryptedKeyPair
a4c | at es.upv.alien4cloud.settingsmanager.ConfigManager.getKey(ConfigManager.java:192)
a4c | at es.upv.alien4cloud.settingsmanager.ConfigManager.createJavaKeystore(ConfigManager.java:161)
a4c | at es.upv.alien4cloud.settingsmanager.ConfigManager.enableSsl(ConfigManager.java:114)
a4c | at es.upv.alien4cloud.settingsmanager.Main.main(Main.java:72)
a4c | 2018-10-24 11:02:35 INFO Main:66 - Write a4c conf at /opt/a4c/config/alien4cloud-config.yml
a4c | Exception in thread "main" java.lang.ClassCastException: org.bouncycastle.asn1.pkcs.PrivateKeyInfo cannot be cast to org.bouncycastle.openssl.PEMEncryptedKeyPair

Add support for orchestrator instance confi

Right now we support one config for all orchestrator instances. For testing purposes and greater flexibility, we should add support for instances. This way each instance has its own configuration (like a different orchestrator location).

Missing Properties in the Configuration of the Orchestrator Plugin

The README refers to a set of properties: tokenEndpointCert, orchestratorEndpointCert, iamHostCert that are not present when configuring the Orchestrator plugin. If these properties are no longer required to be defined by the user they should be omitted from the documentation.

Repository in the indigo tosca types not handled by A4C

  • add repositories section to the custom_types.yaml file, and update each entry in those nodes having an artifacts section using indigodc-2-a4c.py
  • resulting file works with a4c when uploading it (web UI), but it fails when stored in the init/archives (to be loaded at startup)

Relevant files a4c:

  1. org.alien4cloud.tosca.catalog.AbstractArchivePostProcessor.java (alien4cloud-core subproject)
    private void processArtifact(ArchivePathChecker archivePathResolver, AbstractArtifact artifact, ParsingResult parsedArchive)
  2. alien4cloud.repository.services.RepositoryService.java (alien4cloud-core subproject)
    public boolean canResolveArtifact(String artifactReference, String repositoryURL, String repositoryType, Map<String, Object> credentials)
  3. org.alien4cloud.tosca.catalog.ArchiveUploadService.java (alien4cloud-core subproject)
    public ParsingResult upload(Path path, CSARSource csarSource, String workspace)

Rm non-required props with null

If a property of a node is not required it shouldn't appear at all, especially if it has a default value in the TOSCA types.

Indigo Tosca Error simple compute node

Internal error - 500
Unknown error
Artifact could not be accessed DeploymentArtifact{artifactName='indigo-dc.zabbix-agent'} AbstractArtifact{artifactType='tosca.artifacts.AnsibleGalaxy.role', artifactRef='indigo-dc.zabbix-agent', artifactRepository='null', archiveName='indigo-types', archiveVersion='1.0.0', repositoryURL='null', repositoryName='null', artifactPath=null}

with the tosca from a4c

tosca_definitions_version: alien_dsl_1_4_0

metadata:
template_name: TestApp
template_version: 0.1.0-SNAPSHOT
template_author: admin

description: ""

imports:

  • indigo-types:1.0.0
  • tosca-normative-types:1.0.0-ALIEN14

topology_template:
node_templates:
Compute:
type: tosca.nodes.indigo.Compute
properties:
zabbix_server: "orchestrator.cloud.cnaf.infn.it"
zabbix_server_port: 10051
zabbix_server_metadata: "Linux 668c875e-9a39-4dc0-a710-17c41376c1e0"
capabilities:
scalable:
properties:
min_instances: 1
max_instances: 1
count: 1
default_instances: 1
endpoint:
properties:
private_ip: true
protocol: tcp
secure: false
network_name: PRIVATE
initiator: source
workflows:
install:
steps:
Compute_install:
node: Compute
activity:
delegate: install
uninstall:
steps:
Compute_uninstall:
node: Compute
activity:
delegate: uninstall
start:
steps:
Compute_start:
node: Compute
activity:
delegate: start
stop:
steps:
Compute_stop:
node: Compute
activity:
delegate: stop

Missing outputs

A4C doesn't generate the list of outputs when deployment has been completed.

Settings manager

Create an utility that manages the settings for the Alien4Cloud instance running in the docker container.

  • it has to be executed before launching A4C
  • it gets its values from the ENV
  • it doesn't require additional langs support (use Java)
  • it manages the files from the config folder:
    • alien4cloud-config.yml
    • elasticsearch.yml
    • log4j2.xml

[A4C] TOSCA methods in Complex properties

methods are not supported in complex mappings. For example tosca.nodes.indigo.Container.Application.Docker.Marathon inherits properties->environment_variables. If you try to set an variable as get_input eg:
properties: environment_variables: RCLONE_CONFIG: { get_input: rclone_conf }
the parser fails because it tries to convert the method to a map.

User integration plugin

Right now the user integration for the plugin is non-existent. It saves the the user credentials (user name + password) in the general configuration of a plugin instance. We would like to do the following:

  1. Remove the user name and password from the general settings of the plugin.
  2. Get these on the fly when asking for the token using AuthorizationUtil.getCurrentUser method.
  3. Maintain the clientID and clientSecret in the plugin instance's general conf. These are created for each new instance of A4C, that is each site where A4C is deployed. This way, if one site is compromised, we can safely disable those two secrets for the targeted site, without taking out other sites.

Caveats:

  1. The user name and password of a4c MUST be the same with those used in the IAM. As a result, you must create an additional user.

Outputs lost

Outputs created using the text TOSCA editor (even when saved in the text view) are deleted/replaced when switching to the GUI editor and saving from that view

EDIT 1: Iif an output is created using the GUI and then its name is modified in the text view, once a user saves the file again from the GUI the custom name is gone.

All TOSCA methods should be strings

Due to the fact that we need to parse the TOSCA text obtained from the TOSCA editor, the TOSCA methods are transformed into nodes, therefore the whole syntax is changed.

We add a pre-processing step in which all TOSCA methods found in a document are transformed intro string values. At the end of the pre-processing, when the whole structure is transformed into string again, we de-comment all methods.

Dockerfile custom config

As per @mariojmdavid recommendations:

  1. Add an ENV specifying the port. Will do for both HTTPS and HTTP
  2. Add an ENV to set the admin username
  3. Add an ENV to set the admin passw

Unify status update

Use the EventService class to manage status retrieval for all A4C methods querying the status.

Requirements conversion handling intervals

Using indigodc-2-a4c.py with the custom_types.yaml converts


 tosca.nodes.indigo.Container.Runtime.Docker:
    derived_from: tosca.nodes.SoftwareComponent
    capabilities:
      host:
        type: tosca.capabilities.indigo.Container.Docker
      scalable:
        type: tosca.capabilities.Scalable
  requirements:
    - host:
        capability: tosca.capabilities.Container
        node: tosca.nodes.Compute
        relationship: tosca.relationships.HostedOn
occurrences: [0, 1]

to

  tosca.nodes.indigo.Container.Runtime.Docker:
    derived_from: tosca.nodes.SoftwareComponent
    capabilities:
      host:
        type: tosca.capabilities.indigo.Container.Docker
      scalable:
        type: tosca.capabilities.Scalable
  requirements:
  - host:
      capability: tosca.capabilities.Container
      node: tosca.nodes.Compute
      relationship: tosca.relationships.HostedOn
      occurrences:
      - 0
      - 1

occurrences: should be [0,1]

Change IDs used to identify deployment

A4C uses different types of IDs. The DeploymentPaasId identifies the actual application and should be the same between different cycles of deployment/undeployment. The DeploymentId is unique to a specific deploy/undeploy cycle. Switch to the former to allow implementation of the history and loading when a4c instance is restarted.

Changelog

Add a general, GNU style, CHANGELOG for quick summary of changes

expose the imports section indigo types

The link to the file containing the TOSCA types used by the IndigoDC Orchestrator is included internally. It pointed towards the master branch in Github.

https://raw.githubusercontent.com/indigo-dc/tosca-types/devel-deep/custom_types.yaml

Due to the fact that the plugin may be tested with types that are not included in the master (i. temporary, certain release only, bugs etc.) we decided to expose the imports in the plugin instance configuration section.l

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.