ls1intum / Artemis

Artemis - Interactive Learning with Automated Feedback
https://docs.artemis.cit.tum.de
MIT License
487 stars 288 forks source link

Dynamically create build containers and scripts #7141

Open laurenzfb opened 1 year ago

laurenzfb commented 1 year ago

Dynamically create build containers and scripts

Context

Problem

The current local CI system statically creates a Docker container for a build job and mounts a static build script on it. The container always uses the "ls1/artemis-maven-template" and the build script tests for Java exercises. This way, the local CI setup can only support Java programming exercises. Other features like auxiliary repositories, sequential test runs, static code analysis and testwise coverage are not possible because of the static build script. Being able to dynamically create containers and build scripts based on the programming language, project type and other customizations can fix this problem.

Motivation

The motivation seems quite obvious. We want to support multiple programming languages and project types, as well as the previously mentioned features in the programming exercises in the local CI setup.


Requirements Engineering

Existing (Problematic) Solution / System

Currently, the UI only allows you to create Java Gradle exercises. When a programming exercise is created, the template and solution repositories are created and the respective build plans created and executed. The method runBuildJob in LocalCIBuildJobExecutionService.java mounts the repositories and the static build script to the container, configures it and eventually runs it. It always uses "ls1/artemis-maven-template" for the Docker image and build_and_run_tests.sh as the script.

Proposed System

Before the build container can be configured, we need to know the programming language, the project type and other options of the programming exercise object to be able to determine which Docker image will be used and what commands will be needed for the script. Then we can create the build script, configure the container and run it.

Requirements

  1. FR: Programming language support: Create programming exercises of other programming languages
  2. FR: Project type support: Create programming exercises of other project types
  3. FR: Sequential test runs: Create programming exercises with sequential test runs enabled
  4. FR: Static code analysis: Create programming exercises with static code analysis enabled
  5. FR: Testwise coverage: Create programming exercises with testwise coverage enabled

Analysis

Analysis Object Model

Dynamic Behavior


System Design

Subsystem Decomposition

Persistant Data Management

Access Control / Security Aspects

Other Design Decisions


UI / UX

Strohgelaender commented 1 year ago

I think we should widen this topic a bit and think about not only dynamically selecting a fitting base-buildplan, but also allowing instructors to customize its content.

While not often, Instructors should be able to manually change the build script of creation exercises. Use cases for this include:

Additionally, Instructors should be able to specify at least the version of the used docker image (e.g when you need to stick to an older version or directly need an update before the default changed in Artemis). Maybe even allow to manually select the used image to a completely different one (even though I'm not aware of cases where this is useful or needed right now)

laurenzfb commented 1 year ago

Yes, that is eventually the goal. I'm working towards a solution that provides a way, similar to Bamboo, to view and interact with build plans. This here is basically just a first step to ensure that Artemis is able to create dynamic build scripts. Later on, I will add the functionality for customizing the build plan. Thank you for the remarks, I will definitely take them into consideration!