From f0fb08a0183b335970e4423adbec275508d2851c Mon Sep 17 00:00:00 2001 From: Yusuf Can Bayrak Date: Mon, 12 Jun 2023 14:11:10 +0200 Subject: [PATCH] README.md updated --- README.md | 89 +++++++++++++++++++++++++++++++---------------------- cmd/exec.go | 11 ++++--- 2 files changed, 60 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index e38eaac..2534419 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,71 @@ -# kubot +# Kubot - Parallelizing Robot Scripts over Kubernetes Workloads -Parallel robot execution on Kubernetes workloads +Kubot is a command-line interface (CLI) program designed to parallelize and distribute the execution of Robot Framework +scripts over Kubernetes workloads. It enables efficient and scalable execution of robot scripts using the power of +Kubernetes. -## Table of Contents +## Features -- [Introduction](#introduction) -- [Getting Started](#getting-started) -- [Prerequisites](#prerequisites) -- [Installation](#installation) -- [Usage](#usage) -- [Contributing](#contributing) - -## Introduction - -This project provides a method for parallelizing the executions of robot scripts over Kubernetes workloads. - -## Getting Started - -To get started with this project, you will need to have access to a Kubernetes cluster as well as the following -prerequisites: - -### Prerequisites - -- kubectl +- **Parallel Execution**: Kubot utilizes Kubernetes workloads to parallelize the execution of Robot Framework scripts, + significantly reducing the overall execution time. +- **Flexible Workspace**: You can specify the workspace path where your robot scripts are located, allowing you to + easily manage and organize your test suites. +- **Batch Execution**: Define the batch size for parallel execution, controlling the number of scripts executed + concurrently. ## Installation -``` -TODO implement here +To install Kubot, you need to have Go programming language and Docker installed on your machine. Then, run the following +command: + +```bash +go get github.com/yusufcanb/kubot ``` ## Usage +```bash +kubot exec --workspace=/path/to/scripts \ + --name="Daily UI Scan" \ + --batchsize=15 \ + --namespace=kubot \ + --image=docker.io/marketsquare/robotframework-browser:latest ``` -kubot --workspace . \ - --image docker.io/kubot:basic \ - --namespace [your-namespace] \ - --selector [robot-selector] - --output [output-directory] -``` -## Configuration +Here are the environment variables you can configure the advanced Pod spec; + +## Flags + +- **--workspace (-w)**: Specifies the path to the workspace containing your robot scripts. +- **--name (-n)**: Sets the top-level suite name for logs and reports generated by the execution. +- **--batchsize (-b)**: Defines the execution batch size, controlling the number of scripts executed concurrently. The +- default value is 25. +- **--namespace**: Specifies the Kubernetes namespace where the workloads will be created. +- **--image (-i)**: Sets the Docker image to be used for the execution of robot scripts. +- **--selector (-s)**: Allows you to specify a script selector, such as tasks/*, to execute specific scripts or groups + of + scripts within your workspace. + +## Workload Configuration Here is the configuration parameters you can use; -| Name | Description | Default | -|---------------|----------------------|---------| -| POD_CPU_LIMIT | CPU limit per pod | 10 | -| POD_MEM_LIMIT | Memory limit per Pod | 128 Mb | +| Name | Description | Default | +|--------------------------|------------------------|---------| +| KUBOT_POD_CPU_REQUEST | CPU request per pod | 250m | +| KUBOT_POD_MEMORY_REQUEST | Memory request per Pod | 128Mi | +| KUBOT_POD_CPU_LIMIT | Memory limit per Pod | 250m | +| KUBOT_POD_MEMORY_LIMIT | Memory limit per Pod | 256Mi | ## Contributing -To contribute to this project, please fork the repository and submit a pull request. All contributions are welcome! +Contributions to Kubot are welcome! If you encounter any issues or have suggestions for improvements, please submit an +issue or a pull request to the GitHub repository. + +Before contributing, please familiarize yourself with the general contribution guidelines. + +## Acknowledgments + +Kubot was inspired by the need for efficient execution of Robot Framework scripts in parallel over Kubernetes workloads. +I would like to thank the open-source community for their valuable contributions and the Robot Framework project for +providing a powerful automation framework. \ No newline at end of file diff --git a/cmd/exec.go b/cmd/exec.go index 8d46bb4..fd5881c 100644 --- a/cmd/exec.go +++ b/cmd/exec.go @@ -55,7 +55,10 @@ var execCmd = &cobra.Command{ log.Fatal(err) } - k.Run() + err = k.Run() + if err != nil { + log.Fatal(err) + } defer k.Clean() }, @@ -68,9 +71,9 @@ func init() { } execCmd.Flags().StringP("workspace", "w", filepath.Dir(ex), "workspace path") - execCmd.Flags().StringP("name", "n", "Kubot Results", "workspace path") - execCmd.Flags().StringP("namespace", "", "", "kubernetes namespace") - execCmd.Flags().StringP("image", "i", "", "docker image for execution") + execCmd.Flags().StringP("name", "n", "Kubot Results", "top level suite name for logs and reports") + execCmd.Flags().StringP("namespace", "", "", "kubernetes namespace to create workloads in it") + execCmd.Flags().StringP("image", "i", "", "docker image for execution for pods and jobs") execCmd.Flags().IntP("batchsize", "b", 25, "execution batch size") execCmd.Flags().StringP("selector", "s", "", "script selector. e.g. tasks/*")