How nesi/training-environment works
Project Type and Purpose
• This is an infrastructure and configuration management project that deploys a full training environment.
• It uses Terraform to provision infrastructure resources (e.g., VMs, Kubernetes clusters, network/DNS setups) in a cloud environment (NeSI RDC and OpenStack) and Ansible for post-provisioning configuration (setting up Open OnDemand, key services like LDAP and Keycloak, user management, and supporting components).
• The README makes it clear that the environment supports training scenarios with pre-created user accounts and specialized trainer accounts, and that the end-user accesses the environment via a web interface (e.g., https://ood.flexi.nesi).
Analyzing the File Structure
• Top-level files include README.md, deployment scripts (deployment.sh), and configuration files (e.g., configure-route53.yml, setup files).
• There is a dedicated Terraform directory containing main.tf, provider.tf, templates, and variables files. This block represents the Infrastructure-as-Code part.
• A major “roles” directory contains many subdirectories. Each subdirectory is an Ansible role corresponding to various components (e.g., keycloak, cluster-ctl, container-apps, monitoring, pre-checks). These roles modularize the configuration for different services and system components.
• Supporting directories like “docs” (with tutorials, images, stylesheets), “pubkeys”, “host_vars”, and “vars” provide additional data and documentation that guide setup.
• Presence of GitHub workflows and CI/CD related files also suggests deployment automation that ties into real infrastructure updates and management.
Key Architectural Components
a. Infrastructure Provisioning (Terraform):
• Responsible for setting up cloud resources (VMs, network, and Kubernetes clusters).
• Uses external authentication (clouds.yaml, environment variables for EC2 and Route 53) to manage platforms like OpenStack and AWS.
b. Configuration Management (Ansible):
• Leverages a rich “roles” directory to configure and install numerous services: Open OnDemand, Keycloak (for OIDC), LDAP services, monitoring (Grafana, Prometheus, node exporters), NFS servers, and additional container-related functionalities.
• The host_vars, users, and vars directories indicate that dynamic inventory and user-meta configurations are managed here.
c. Deployment Orchestration:
• Scripts such as deployment.sh, along with several GitHub workflow files, orchestrate the creation and destruction of environments.
• Role-specific scripts (e.g., tasks for pre-checks, kubectl management, etc.) ensure a layered approach in applying infrastructure and then configuring the software environment.