From c1af394f9dcea003f3e44355a1d5256e5e13ccfb Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 12 Apr 2023 02:31:02 +0000 Subject: automatic import of python-crc-bonfire --- python-crc-bonfire.spec | 975 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 975 insertions(+) create mode 100644 python-crc-bonfire.spec (limited to 'python-crc-bonfire.spec') diff --git a/python-crc-bonfire.spec b/python-crc-bonfire.spec new file mode 100644 index 0000000..0ee5b44 --- /dev/null +++ b/python-crc-bonfire.spec @@ -0,0 +1,975 @@ +%global _empty_manifest_terminate_build 0 +Name: python-crc-bonfire +Version: 4.12.1 +Release: 1 +Summary: A CLI tool used to deploy ephemeral environments for testing cloud.redhat.com applications +License: MIT +URL: https://www.github.com/RedHatInsights/bonfire +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d8/34/c839b0e43c6b11d900d339b22e7b56673140bffed7e7e9bb623a14f8a2e7/crc-bonfire-4.12.1.tar.gz +BuildArch: noarch + +Requires: python3-cached-property +Requires: python3-chardet +Requires: python3-multidict +Requires: python3-click +Requires: python3-gql +Requires: python3-PyYAML +Requires: python3-requests +Requires: python3-sh +Requires: python3-wait-for +Requires: python3-tabulate +Requires: python3-dotenv +Requires: python3-ocviapy +Requires: python3-app-common-python +Requires: python3-junitparser +Requires: python3-importlib-metadata +Requires: python3-mock +Requires: python3-pytest +Requires: python3-pytest-mock + +%description +# bonfire + +A CLI tool used by Red Hat engineers to deploy console.redhat.com applications into kubernetes/OpenShift. This tool is mainly used for the purpose of creating ephemeral test environments. + +As an example, typing `bonfire deploy host-inventory` leads to the host-inventory application and all its dependencies being deployed and ready to run in under 4 minutes: + +![Demo gif](demo.gif) + + +# Table of Contents + +- [About](#about) +- [Installation](#installation) +- [Quick Start](#quick-start) + - [Deploying](#deploying) + - [Namespace Management](#namespace-management) + - [Namespace Context](#namespace-context) +- [Examples for Common Use Cases](#examples-for-common-use-cases) +- [Commonly Used CLI Options](#commonly-used-cli-options) + - [Deploying/Processing](#deployingprocessing) +- [Interactions with Ephemeral Namespace Operator](#interactions-with-ephemeral-namespace-operator) +- [Interactions with Clowder Operator](#interactions-with-clowder-operator) + - [ClowdEnvironments](#clowdenvironments) + - [Dependency Processing](#dependency-processing) +- [Configuration Details](#configuration-details) + - [Using a local config](#using-a-local-config) + - [Local config examples](#local-config-examples) + - [Deploying local repo changes](#deploying-local-repo-changes) + - [Deploying changes changes in a remote git branch](#deploying-changes-changes-in-a-remote-git-branch) + - [Advanced](#advanced) + - [Running a local qontract-server](#running-a-local-qontract-server) + +# About + +`bonfire` interacts with a running instance of [qontract-server](https://github.com/app-sre/qontract-server) (the component that powers the [AppSRE team](https://github.com/app-sre/)'s internal `app-interface` graphql API) to obtain applications' OpenShift templates, process them, and deploy them. A local configuration file can be defined that allows you to override an application config if you wish. + +It also interacts with the [ephemeral namespace operator](https://github.com/RedHatInsights/ephemeral-namespace-operator) to manage the reservation of ephemeral namespaces for testing. + +It has special functionality related to the [Clowder operator](https://github.com/RedHatInsights/clowder) and [Frontend operator](https://github.com/RedHatInsights/frontend-operator/) such as auto-deploying ClowdApp dependencies. + +A wide range of CLI options allow you to customize exactly what combination of components get deployed into a namespace. + +> NOTE: for information related to app-interface configurations, see the internal [ConsoleDot Docs](https://consoledot.pages.redhat.com/) + +# Installation + +We'd recommend setting up a virtual environment for bonfire: + +```bash +VENV_DIR=~/bonfire_venv +mkdir -p $VENV_DIR +python3 -m venv $VENV_DIR +. $VENV_DIR/bin/activate +pip install crc-bonfire +``` + +To prevent GitHub rate limiting issues when bonfire reaches out to GitHub APIs, [create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) on your GitHub account which grants bonfire read access to your repos. Configure bonfire to use the token with: +``` +echo 'GITHUB_TOKEN=' >> ~/.config/bonfire/env +``` + + +# Quick Start + +Start with `bonfire --help` to familiarize yourself with the basic command groups. Don't forget to use the `--help` flag on sub-commmands as well if you are curious to learn more about different CLI commands, options, and arguments. + +## Deploying + +The command you are most likely to use is `bonfire deploy`. + +If you are on the Red Hat VPN, `bonfire` will communicate with an internal instance of the App-SRE team's `qontract-server` API. You need to use `oc login` to log in to the ephemeral cluster. + +Once logged in, you should be able to type `bonfire deploy advisor` + +This will cause `bonfire` to do the following: +1. reserve a namespace +2. fetch the templates for all components in the 'advisor' app and process them. By default, bonfire will look up the template and commit hash using the 'main'/'master' branch of each component defined in the app. It will look up the git commit hash for this branch and automatically set the `IMAGE_TAG` parameter passed to the templates. +3. if ClowdApp resources are found, figure out which additional ClowdApps to fetch and process +4. apply all the processed template resources into your reserved namespace +5. wait for all the resources to reach a 'ready' state + +Run `bonfire namespace list --mine` and you will see your namespace. + +Switch into that namespace with `oc project ` + +Run `oc get clowdapp` in your namespace and you should see several ClowdApps have been deployed. + +If you want to to extend the time you have to work with your namespace, use `bonfire namespace extend ` + +When you are done working with your namespace, type `bonfire namespace release ` to instruct the ephemeral namespace operator to delete your reservation. + +The deploy command is an 'all-in-one' command that ties together 4 steps: +1. `bonfire namespace reserve` to reserve a namespace +2. `bonfire process` to fetch and process app templates +3. `oc apply` to apply the processed app templates into the namespace +4. `bonfire namespace wait-on-resources ` to wait on all resources in the namespace to reach 'ready' state + +## Namespace Management + +* Reserve a namespace with: `bonfire namespace reserve` + * By default, the duration is 1 hour. Increase it with `-d/--duration