Giter Club home page Giter Club logo

test-infra's Introduction

Test-Infra

This project deploys the OpenShift Assisted Installer in Minikube and spawns libvirt VMs that represent bare metal hosts.

Prerequisites

  • CentOS 8 or RHEL 8 host
  • File system that supports d_type
  • Ideally on a bare metal host with at least 64G of RAM.
  • Run as a user with passwordless sudo access or be ready to enter sudo password for prepare phase.
  • Get a valid pull secret (json string) from redhat.com if you want to test the installation (not needed for testing only the discovery flow). Export it as
export PULL_SECRET='<pull secret json>'

Instructions

Host preparation

Beaker node:

dnf install -y git make
cd /home/test # don't do it on /root it will breaks build image mounts and fail to run
git clone https://github.com/tsorya/test-infra.git

When using this infra for the first time on a host, run:

make create_full_environment

This will install required packages, configure libvirt, pull relevant docker images, and start Minikube.

Usage

There are different options to use test-infra, which can be found in the Makefile.

Full flow cases

The following is a list of stages that will be run:

  1. Start Minikube if not started yet
  2. Deploy services for assisted deployment on Minikube
  3. Create cluster in bm-inventory service
  4. Download ISO image
  5. Spawn required number of VMs from downloaded ISO with params that can be configured by os env (check makefile)
  6. Wait until nodes are up and registered in bm-inventory
  7. Set nodes roles in bm-inventory by matching VM names (worker/master)
  8. Verify all nodes have required hardware to start installation
  9. Install nodes
  10. Download kubeconfig-noingress to build/kubeconfig
  11. Waiting till nodes are in "installed" state, while verifying that they don't move to "error" state
  12. Verifying cluster is in state "installed"
  13. Download kubeconfig to build/kubeconfig

Note: Please make sure no previous cluster is running before running a new one (it will rewrite its build files).

Run full flow with install

To run the full flow, including installation:

make run_full_flow_with_install

Or to run it together with create_full_environment (requires sudo password):

make all

Run full flow without install

To run the flow without the installation stage:

make run_full_flow

Run only deploy nodes (without pre deploy of all assisted service)

make deploy_nodes or make deploy_nodes_with_install

Redeploy nodes

make redeploy_nodes or make redeploy_nodes_with_install

Redeploy with assisted services

make redeploy_all or make redeploy_all_with_install

Cleaning

Cleaning test-infra environment.

Clean all include minikube

make destroy

Clean nodes only

make destroy_nodes

Delete all virsh resources

Sometimes you may need to delete all libvirt resources

make delete_all_virsh_resources

Install cluster

Install cluster after nodes were deployed. Can take ClusterId as os env

make install_cluster 

Create cluster and download iso

make download_iso

deploy_bm_inventory and Create cluster and download iso

make download_iso_for_remote_use

start_minikube and Deploy ui and and open port forwarding on port 6008, allows to connect to it from browser

make deploy_ui

Kill all open port forwarding commands, will be part of destroy target

make kill_all_port_forwardings

OS params used for configurations

BMI_BRANCH          bm-inventory branch to use, default is master
IMAGE               path to iso to spawn vm with, if set vms will be spawn with this iso without creating cluster
NUM_MASTERS         number of vms to spawn as masters, default is 3 
WORKER_MEMORY       memory for worker vm, default 8892mb
MASTER_MEMORY       memory for master vm 16984
NUM_WORKERS         number of vms to spawn as workerm default 0
SSH_PUB_KEY         ssh public key to use for image generation, gives option to ssh to vms, default is in ssh_key/key_pub
PULL_SECRET         pull secret to use for cluster installation command, no option to install cluster without it.
CLUSTER_NAME        cluster name, used as prefix for virsh resources, default test-infra-cluster)
BASE_DOMAIN         base domain, needed for dns name, default redhat.com
NETWORK_CIDR        network cidr to use for virsh vm network, default "192.168.126.0/24"
CLUSTER_ID          cluster id , used for install_cluster command, default will be the last spawned cluster
NETWORK_NAME        virsh network name for vms creation, default test-infra-net
NETWORK_BRIDGE      network bridge to use while creating virsh network, default tt0
OPENSHIFT_VERSION   openshift version to install, default "4.4"
PROXY_URL:          proxy url that will be pass to live cd image
INVENTORY_URL:      update bm-inventory config map INVENTORY_URL param with given url
INVENTORY_PORT:     update bm-inventory config map INVENTORY_PORT with given port
AGENT_DOCKER_IMAGE: agent docker image to use, will update bm-inventory config map with given value
INSTALLER_IMAGE:    assisted-installer image to use, will update bm-inventory config map with given value
SERVICE:            bm-inventory image to use
DEPLOY_TAG:         the tag to be used for all images (bm-inventory, assisted-installer, agent, etc) this will override any other os params

Test bm-inventory image

make redeploy_all SERVICE=<image to test>
or 
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install SERVICE=<image to test>

Test agent image

make redeploy_all AGENT_DOCKER_IMAGE=<image to test> 
or
make redeploy_all_with_install AGENT_DOCKER_IMAGE=<image to test>

Test installer image

make redeploy_all INSTALLER_IMAGE=<image to test> 
or
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install INSTALLER_IMAGE=<image to test>

Test installer, bm-inventory and agent images in the same flow

make redeploy_all INSTALLER_IMAGE=<image to test> AGENT_DOCKER_IMAGE=<image to test> SERVICE=<image to test>
or 
export PULL_SECRET='<pull secret json>'; make redeploy_all_with_install INSTALLER_IMAGE=<image to test> AGENT_DOCKER_IMAGE=<image to test>  SERVICE=<image to test>

Test infra image

Create and push new image will create new bm-inventory client, build new image and push image

make build_and_push_image IMAGE_NAME=<your full image path> IMAGE_TAG=<default is latest>

Use new image, will pull image from hub, check that image is public, if tag is not latest update skipper yaml

make image_build IMAGE_NAME=<your image> IMAGE_TAG=<default is latest>

test-infra's People

Contributors

tsorya avatar eranco74 avatar yuvigold avatar yevgeny-shnaidman avatar avishayt avatar rollandf avatar gamli75 avatar ori-amizur avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.