Language Server for OASIS TOSCA Version 2

Report for OASIS TOSCA Version 2 Language Server

Language Server for OASIS TOSCA Version 2

This project was done in the context of Google Summer of Code 2024.

Project Information

Field Details
Student Omar Awad
Organization Eclipse Foundation
Primary repository org.eclipse.winery.lsp
Project name TOSCA LSP Server
Project mentor Dr. Oliver Kopp
Project page Google Summer of Code 2024 Project Page
TOSCA Version 2.0 TOSCA Version 2.0 Committee Specification Draft

Project Summary

This project is an enhancement for Eclipse Winery. Eclipse Winery is a web-based environment for modeling OASIS TOSCA topologies. Currently, Winery focuses on providing a graphical editing environment for application topologies. It also covers many research prototype implementations.

This project implements a Language Server Protocol (LSP) provider for OASIS TOSCA YAML files. This make Eclipse Winery also a component for more text-based people and would lays a groundwork for integrating with other research. As a result, it provides users with assistance in editing TOSCA YAML files, making the creation and editing process more efficient and less error-prone.

Background

Applications today are often made up of multiple components, which may be distributed across various microservices. OASIS TOSCA (Topology and Orchestration Specification for Cloud Applications) is a standard designed to describe and manage these topologies. The core TOSCA specification defines a language for describing service components and their relationships using a service topology. It also includes lifecycle management procedures that enable the orchestration of services—covering creation, modification, and scaling—throughout the complete service lifecycle (e.g., deployment, scaling, patching, and monitoring). Currently, crafting TOSCA YAML files manually is complex and prone to errors due to the lack of tooling support. This project aimed to develop a Language Server for TOSCA v2 that integrates with Visual Studio Code.

Outcome

The outcomes of the project include:

  1. LSP server supports the latest OASIS TOSCA 2.0 standard.
  2. Awareness of the newly introduced types and definitions and makes them available in the service template.
  3. Importing from multiple files TOSCA files within a repository or directory.
  4. Context-dependent auto-completion for the TOSCA keywords and types.
  5. Validation for the TOSCA types: artifact type, capability type, node type, and relationship type.
  6. Validation for the definitions: imports definition, property definition, requirements definition, schema definition, and capability definition.
  7. Validation for the templates: service template and node templates.
  8. Enhanced key identification mechanism for the TOSCA files by prefixing keys with their parent elements and list indices, providing better clarity and traceability in nested YAML structures.
  9. Demonstrating the functionality of the LSP server using compatible Visual Studio Code.

LSP Features

Context dependent auto-completion for TOSCA keywords.

ContextDependentKeywordsCompletion

Context dependent auto-completion for the types keyword value.

Node Templates

Capability Definitions

Context dependent auto-completion for the drived_from keyword value

Aritfact Type

Capability Type

Node Type

Relationship Type

YAML syntax validation with error reporting

Improved parsing of imports definitions for nested TOSCA files.

image

Support for multi-file TOSCA projects

Support__multi_file_TOSCA_projects (1)

The LSP is aware of the newly introduced types and definitions

awarness_of_newly_introduced_types_and_definitions

Validation with error reporting for service, and node templates

Node Templates

image

Service Template

image

Validation with error reporting for schema, requirement, property, and capability definitions.

Schema Definition

image

Requirement Definition

image

Property Definition

image

Capability Definition

image

Validation with error reporting for node, relationship, capability, and artifact types.

Node Type

image

Relationship Type

image

Capability Type

image

Artifact Type

image

Validation with error reporting for the TOSCA boolean functions in the properties.

TOSCA_boolean_functions_test

Future Work

Benefits

Key Learnings and Challenges

These areas, although challenging at times, have contributed greatly to my growth as a developer and my understanding of the TOSCA ecosystem.

Technologies and Tools

Statistics

Total commits 93
Changes 18078
Additions 18036
Deletions 42