Skip to content

testing-farm/infrastructure

Repository files navigation

Testing Farm Infrastructure

This repository contains tools, configuration ands test used to maintain and setup Testing Farm’s infrastrucutre.

The repository tries to bundle all required tools and provides an easy way how to set everything up for newcomers.

Setup

The repository is managed via direnv. For setup:

  • Add .vault_pass file with the known secret

    Tip

    Check Bitwarden for the vault password.

    echo "SECRET_PASSWORD" > .vault_pass
  • Install direnv

    $ dnf -y install direnv
  • Hook direnv to your shell, see the official guide for more information.

  • Install required system dependencies

    Warning

    Only Fedora system is supported at this time.

    make install/fedora
  • Allow direnv in this directory

    $ direnv allow
    Tip

    In case of errors, investigate the setup log in .direnv/envrc.log. You can try to reinstall the environment by removing the .direnv directory and running direnv allow.

  • Check if kubectl works and lists all available clusters:

    $ kubectl ctx

Make

We use make to manage common actions. Run the command to see the available targets with descriptions.

Terragrunt and Terraform

We use Terraform to setup the infrastructure. To make the Terraform code DRY we use Terragrunt.

The infrastructure code is located in the terragrunt/ directory.

Development Environment

Development environment is intended for development of infrastructure and testing changes without influencing any other environment. The state of the infrastructure is saved locally, i.e. it uses the local terraform backend.

Currently, the environment contains:

  • AWS EKS kubernetes cluster

  • Artemis instance

The name of the cluster and Artemis API endpoint is generated according to your local username.

For example, for the user mvadkert:

  • the cluster name is testing-farm-dev-mvadkert

  • the Artemis API endpoint is artemis.dev-mvadkert.testing-farm.io

To provision a complete infrastructure on Fedora AWS for development:

  • initialize the dev environment

    make dev/init
  • create development environment with your own AWS EKS cluster and all available services in development mode

    make dev/apply
  • develop & have fun

  • tier down the infrastructure once happy

    make dev/destroy

Staging Environment

The staging environment serves as a preview of our production environment. The state of the infrastructure is saved to Terraform Cloud.

Currently, the environment contains:

  • AWS EKS kubernetes cluster

  • Artemis instance

Other components are not yet maintained here.

Details of the deployment:

  • the cluster name is testing-farm-staging

  • the Artemis API endpoint is artemis.dev-mvadkert.testing-farm.io

Integration Tests

Worker integration tests

We currently support running worker integration tests against the Development Environment or Staging Environment.

Updating composes

To update composes on Public Ranch:

  • run make compose-update-public

  • submit a MR with the changes

  • the changes will be deployed once the MR is merged

Updating podman configuration

To update podman configuration on Red Hat workers (e.g. after container registry authentication update):

ansible-playbook -e environment=production -t update_podman -l testing_farm_redhat_workers ansible/playbooks/testing-farm.yaml