dkolovos.6: Semantic Analysis of Docker Compose configurations

Description

Compose [1] is a configuration language that enables the definition of multi-container Docker applications. Using Compose, engineers can define the operation environment of distributed applications at a high level of abstraction. For example, the following Compose specification will start one container for a MySQL database and one for a Wordpress installation. As seen below, the Wordpress container depends on the MySQL container (db) and will not be able to function correctly without it. As Compose lacks support for static analysis, errors (e.g. a typo in the value of depends_on of the Wordpress container) only manifest at runtime where they are challenging to trace and repair. The aim of the project is to investigate the degree to which static analysis of Compose configurations is feasible, and the types of errors that can be detected statically. To achieve this, the student will define a grammar of the Compose language using a framework such as Xtext/EMFText [2] and then use model analysis and validation techniques and tools (e.g. Epsilon's Validation Language [3]) to define constraints that can identify such issues.

version: '2'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: wordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_PASSWORD: wordpress
volumes:
    db_data:

Prerequisites

Suitable candidates for this project should have good knowledge of Java and strong object-oriented design skills.

Eligibility

This project meets the project specifications of the following courses:
BSc

Resources

  1. Docker Compose file reference
  2. Eclipse Xtext
  3. Epsilon Validation Language

 Printer-friendly version