Git Product home page Git Product logo

stupro_toscana_vorprojekt's Introduction

StuPro TOSCAna preliminary design study

Build Status Codacy Badge codecov

Table of Contents

Introduction

Open repository for the preliminary design study for TOSCAna.

This is the repository for the preliminary design study for the study project TOSCAna. The project consists of the following two subprojects:

TOSCA2vSphere

TOSCA2vSphere is a command line tool developed in the preliminary design study for the study project TOSCAna. The purpose of this tool is to deploy a TOSCAlite model as it is definend in the corresponding archive.

TOSCAlite

TOSCAlite is a very lightweight version of the OASIS TOSCA standard. It can be used to model a deployment based on Linux systems (mostly Ubuntu 16.04 LTS). You can read more about TOSCAlite in its documentation here.

Project structure

Obtaining TOSCA2vSphere

Prebuilt package

Download a prebuilt package here.

Build from source

Steps to build TOSCA2vSphere from sources:

  1. Clone the project.

    git clone https://github.com/nfode/stupro_toscana_vorprojekt.git

  2. Enter the project root directory.

    cd stupro_toscana_vorprojekt

  3. Build the project with:

    mvn package

  4. You can find the generated jar file in the target folder.

Usage

How to use TOSCA2vSphere:

  1. Start TOSCA2vSphere with:

    java -jar de.toscana.transformator-1.0-SNAPSHOT.jar model.zip

    Replace model.zip with the file you want to open.

    IMPORTANT: The topology described in the model.xml of the .zip archive has to match the requirements described in the TOSCAlite specification.

  2. If parsing the file was successful you can now use the CLI:

    1. You can create everything needed to run your model if you enter:

      create

    2. if the model was created you can start it with:

      start

    3. and finally there is the possibility to stop it with:

      stop

    It is mandatory that create has to be called before start and start has to be called before stop. If not, there will be an error.

Debugging

For more verbose output of the target machines, it is possible to change the log level from INFO to DEBUG.

Therefore, open file src/main/resources/log4j.properties and change the line 'log4j.rootLogger=INFO, A1' to 'log4j.rootLogger=DEBUG, A1'

Tools

Tools that are used in this project.

Util scripts

In the folder util you can find util scripts for operating systems with bash.

  • utils/build_with_test - builds with tests
  • utils/build_without_test - builds without tests for test purposes
  • utils/run_with_example_phpapp - starts the CLI with the example php app

IntelliJ

In the folder doc/config/IntelliJ you can find a class template named Class.java. This template adds automatically everything you need for logging to the header when you create a new class. If you want to use this file, copy it to the folder .idea/fileTemplates/internal/Class.java.

stupro_toscana_vorprojekt's People

Contributors

c-mueller avatar jensmueller2709 avatar mklopp avatar mmunozba avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

stupro_toscana_vorprojekt's Issues

Testing the functionality of the Engine and Creator classes

To ensure the correct functionality of the Engine classes, all methods should be tested with an example topology.

Progress:

  • creating an example topology (as a data model)
  • create() method
    • sorting methods in the Creator class
  • start() method
  • stop() method

PHP - App

Create a simple PHP - App for test and demonstration purposes.

Implement model interpreter

The engine needs to be able to interpret the data model created by the XML parser in order to generate the sequence of deployment operations. This is done by iterating through the nodes and relationships in the data model and determining the dependencies.

  • enable interpretation of TOSCAlite models
  • create a method to sort Nodes based on parent-child relationships
  • integrate the sorted Node list into the create(), start() and stop() methods

Remove all .iml files and the .idea folder from git

The .iml files and the .idea folder are not necessary to configure IntelliJ, the IDE generates these files out of the pom.xml. So theres no need for them to be in the repo.
To remove these files from git do the following steps.

  1. Get the new .gitignore from master:
    you can run git checkout --patch master .gitignore to get the new file, or just copy and paste to your branch
  2. remove the files from git:
    git rm -r --cached .idea
    git rm -r --cached *.iml
    this wont remove them from you hard drive only from git
  3. stage,commit and push to your branch

thx!

Orchestrate deployment and management through executor interface

The engine needs to provide methods to create, start and stop the application through a ssh connection.
To establish this connection and send the SSH commands it should use the methods provided by the executor interface.

Progress:

  • extraction of properties from the topology
  • establishing an SSH connection
  • sending SSH commands to the VM(s)
    • create()
    • start()
    • stop()

Get a profile picture

Get a profile picture on GitHub and Slack in order to ease communcation

Nice to have: make sure GitHub and Slack avatars are the same

Implementing a parser for the model.xml

In order to be able to deploy a TOSCAlite model on Ubuntu Machines, the model.xml contained in the deployment archive has to be parsed.
This issue is divided into the following subtasks:

  • Develop object-oriented class model for the TOSCAlite model.xml specification. (class diagram)
  • Create Java-classes for the specified class diagram.
  • Implement the parser itself.
  • Document Java code.
  • Optional: Implement unit-tests for edge cases.

Executor must transfer util scripts to ssh machine and add them to PATH

A static folder (basically its content, bunch of shell scripts) must be transfered to every machine right after establishing initial connection. They need to be available within implementation artifacts.

export PATH="$PATH:/path/to/folder/with/scripts" <-- put this into $HOME/.profile

problem: when using sudo (ubuntu only) you cant access youre old path, but the definde 'secure path' (some scripts need to be performed as root)
solution: Additionally to above PATH extension, this 'secure path' must be modified in /etc/sudoers.

No parsing error (missing deployments element)

Feeding below model to the parser, no parsing error is thrown. The <DeploymentArtifacts> Element is missing.

Model:

<Node>
            <Name>database</Name>
            <Type>service</Type>
            <ImplementationArtifacts>
                <Create>create</Create>
            </ImplementationArtifacts>
            <DeploymentArtifact key="databaseschema">createdb.sql</DeploymentArtifact>
            <Properties>
                <Property key="user">simpleuser</Property>
                <Property key="password">pass</Property>
                <Property key="databasename">awesomedatabase</Property>
            </Properties>
        </Node>

Log Output:

2017-07-03 20:10:33,365  DEBUG - model.ServiceNode         > Parsed 1 implementation artifacts for node database.
2017-07-03 20:10:33,366  DEBUG - model.ServiceNode         > Parsed 0 deployment artifacts for node database.
2017-07-03 20:10:33,366  DEBUG - model.TOSCAliteModel      > Added service database

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.