|
| 1 | + |
1 | 2 | # DevOps-GPT |
2 | | -Use a brilliant assistant as your friend in your DevOps Journey. |
3 | 3 |
|
4 | | -## What does this project offer? |
5 | | -This project helps you to balance your daily work as a DevOps engineer, from simple bug fixes to project template generation.<br /> |
6 | | -you don't need to search on Google for some routine jobs and it helps you with a robust prompt to simplify your career. |
| 4 | +This project helps you to balance your daily work as a DevOps engineer, from simple bug fixes to project template generation. you don't need to search on Google for some routine jobs and it helps you with a robust prompt to simplify your career. |
7 | 5 |
|
8 | | -## How it works? |
9 | | -This is a wrapper between DevOps engineers and large language models like GPT-4-mini. The main strength of it is prompt engineering.<br /> |
10 | 6 |
|
11 | | -We have developed some (Extendable) prompt-driven solutions with a simplified interface for the DevOps process cost reduction.<br /> |
| 7 | +## Run Locally |
12 | 8 |
|
13 | | -### Docker services |
14 | | -We run our services using docker-compose (the main Fast-API-based backend and MongoDB), so we package all dependencies and don't use any external service.<br /> |
15 | | -The second one is Mongodb. we need to save the prompt and GPT-4_mini response in the Mongo document for future use. (for example, fine-tuning the other model with our data) <br /> |
| 9 | +Clone the project |
16 | 10 |
|
17 | | -### Media directory |
18 | | -The third one is in the media directory. for now, We save a project called (MyTerraform) which is a Terraform template generated based on user requirements. so users can download it and use it.<be /> |
19 | | -surely we can save any static data in the `/media`. |
| 11 | +``` |
| 12 | +git clone https://github.com/devopshobbies/devops-gpt.git |
| 13 | +``` |
20 | 14 |
|
21 | | - |
| 15 | +Go to the project directory |
22 | 16 |
|
23 | | -This is an example of a template generated in the `/media` |
| 17 | +``` |
| 18 | +cd devops-gpt |
| 19 | +``` |
24 | 20 |
|
25 | | -and the input is something like that |
| 21 | +Run the project by its docker-compose |
26 | 22 |
|
27 | | - |
| 23 | +``` |
| 24 | +sh run.sh |
| 25 | +``` |
28 | 26 |
|
29 | 27 |
|
30 | 28 |
|
31 | | -### directory_generators |
32 | | -This directory becomes updated when we trigger the template generation API. finally, It generates the MyTerraform directory based on user input which is a template. |
33 | 29 |
|
| 30 | +## Deployment |
34 | 31 |
|
35 | | -## ToolChain |
36 | | -1. Python |
37 | | -2. Docker |
38 | | -3. GPT-4o-mini |
39 | | -4. FastAPI |
40 | | -5. Helm |
| 32 | +If you want to run and use this chatbot app within your Kubernetes cluster, you can easily install it using the Helm chart provided in this repository |
| 33 | + |
| 34 | +``` |
| 35 | +helm install [RELEASE_NAME] helm/ -f helm/values.yaml |
| 36 | +``` |
41 | 37 |
|
42 | | -## Pre-requisites |
43 | | -1. Python |
44 | | -2. Docker |
45 | 38 |
|
46 | | -## How to use? |
47 | | -execute `sh run.sh` in your terminal |
48 | 39 |
|
49 | | -> [!WARNING] |
50 | | -> Do Not change the GPT model! Prompts have been developed for the GPT-4-mini model and they can't be integrated with other GPT models. it can cause horrible incompatibility. |
51 | 40 |
|
52 | | -## Run it local on kubernetes |
53 | | -If you want to run and use this chatbot app within your Kubernetes cluster, you can easily install it using the Helm chart provided in this repository |
| 41 | +## Running Tests |
| 42 | + |
| 43 | +To run tests, run the following command |
| 44 | + |
| 45 | +``` |
| 46 | +cd app && pytest tests/ |
| 47 | +``` |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +## Environment Variables |
| 53 | + |
| 54 | +To run this project, you will need to add the following environment variables to your .env file |
| 55 | + |
| 56 | +`KEY` (OpenAI API Key) |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +## API Reference |
| 62 | + |
| 63 | +#### Get helm items |
| 64 | + |
| 65 | +``` |
| 66 | +GET /download-helm/{filename} |
| 67 | +``` |
| 68 | + |
| 69 | +| Parameter | Type | Description | |
| 70 | +| :-------- | :------- | :------------------------- | |
| 71 | +| `filename` | `string` | **Required** | |
| 72 | + |
| 73 | +#### Get terraform items |
| 74 | + |
| 75 | +``` |
| 76 | +GET /download-terraform/{filename} |
| 77 | +``` |
| 78 | + |
| 79 | +| Parameter | Type | Description | |
| 80 | +| :-------- | :------- | :-------------------------------- | |
| 81 | +| `filename` | `string` | **Required** | |
| 82 | + |
| 83 | +#### Get list dirs |
| 84 | + |
| 85 | +``` |
| 86 | +GET /list-directory |
| 87 | +``` |
| 88 | + |
| 89 | +| Request Body | Type | Description | |
| 90 | +| :-------- | :------- | :-------------------------------- | |
| 91 | +| `folder` | `string` | **Required** | |
| 92 | + |
| 93 | + |
| 94 | +#### Post terraform basic questions |
| 95 | + |
| 96 | +``` |
| 97 | +POST /IaC-basic/ |
| 98 | +``` |
| 99 | + |
| 100 | +| Request Body | Type | Description | |
| 101 | +| :-------- | :------- | :-------------------------------- | |
| 102 | +| `max_tokens` | `int` | **Required** | |
| 103 | +| `min_tokens` | `int` | **Required** | |
| 104 | +| `service` | `string` | **Required** | |
| 105 | +| `input` | `string` | **Required** | |
| 106 | + |
| 107 | + |
| 108 | +#### Post terraform bugfix |
| 109 | + |
| 110 | +``` |
| 111 | +POST /IaC-bugfix/ |
| 112 | +``` |
| 113 | + |
| 114 | +| Request Body | Type | Description | |
| 115 | +| :-------- | :------- | :-------------------------------- | |
| 116 | +| `max_tokens` | `int` | **Required** | |
| 117 | +| `min_tokens` | `int` | **Required** | |
| 118 | +| `service` | `string` | **Required** | |
| 119 | +| `bug_description` | `string` | **Required** | |
| 120 | +| `version` | `string` | **Required** | |
54 | 121 |
|
55 | | - helm install [RELEASE_NAME] helm/ -f helm/values.yaml |
56 | | -# Test |
57 | 122 |
|
58 | | -Run tests: |
| 123 | + |
| 124 | +#### Post terraform installation |
| 125 | + |
59 | 126 | ``` |
60 | | -cd app |
61 | | -pytest tests/ |
| 127 | +POST /IaC-install/ |
62 | 128 | ``` |
63 | | -# Contributing |
64 | | -please read the [Contribution guide](https://github.com/abolfazl8131/devops-gpt/blob/master/CONTRIBUTING.md) |
| 129 | + |
| 130 | +| Request Body | Type | Description | |
| 131 | +| :-------- | :------- | :-------------------------------- | |
| 132 | +| `os` | `string` | **Required** | |
| 133 | +| `service` | `string` | **Required** | |
| 134 | + |
| 135 | + |
| 136 | +#### Post terraform template generation of docker resources |
| 137 | + |
| 138 | +``` |
| 139 | +POST /IaC-template/docker |
| 140 | +``` |
| 141 | + |
| 142 | +| Request Body | Type | Description | |
| 143 | +| :-------- | :------- | :-------------------------------- | |
| 144 | +| `docker_image` | `boolean` | **Required** | |
| 145 | +| `docker_container` | `boolean` | **Required** | |
| 146 | + |
| 147 | + |
| 148 | +#### Post terraform template generation of Ec2 resources |
| 149 | + |
| 150 | +``` |
| 151 | +POST /IaC-template/aws/ec2 |
| 152 | +``` |
| 153 | + |
| 154 | +| Request Body | Type | Description | |
| 155 | +| :-------- | :------- | :-------------------------------- | |
| 156 | +| `key_pair` | `boolean` | **Required** | |
| 157 | +| `security_group` | `boolean` | **Required** | |
| 158 | +| `aws_instance` | `boolean` | **Required** | |
| 159 | +| `ami_from_instance` | `boolean` | **Required** | |
| 160 | + |
| 161 | +#### Post terraform template generation of S3 resources |
| 162 | + |
| 163 | +``` |
| 164 | +POST /IaC-template/aws/s3 |
| 165 | +``` |
| 166 | + |
| 167 | +| Request Body | Type | Description | |
| 168 | +| :-------- | :------- | :-------------------------------- | |
| 169 | +| `s3_bucket` | `boolean` | **Required** | |
| 170 | +| `s3_bucket_versioning` | `boolean` | **Required** | |
| 171 | + |
| 172 | + |
| 173 | +#### Post terraform template generation of IAM resources |
| 174 | + |
| 175 | +``` |
| 176 | +POST /IaC-template/aws/iam |
| 177 | +``` |
| 178 | + |
| 179 | +| Request Body | Type | Description | |
| 180 | +| :-------- | :------- | :-------------------------------- | |
| 181 | +| `iam_user` | `boolean` | **Required** | |
| 182 | +| `iam_group` | `boolean` | **Required** | |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | +## Tech Stack |
| 187 | + |
| 188 | +**Client:** React + TypeScript + Vite |
| 189 | + |
| 190 | +**Server:** Python + FastAPI |
| 191 | + |
| 192 | +**Containerization:** Docker + Kubernetes |
| 193 | + |
| 194 | +**CI/CD**: Github Actions |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | +## Contributing |
| 200 | + |
| 201 | +Contributions are always welcome! |
| 202 | + |
| 203 | +See `CONTRIBUTING.md` for ways to get started. |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
65 | 208 | # Maintenance |
66 | | -** [Abolfazl Andalib](https://github.com/abolfazl8131) - abolfazlandalib@gmail.com **<br /> |
| 209 | + |
| 210 | +** [Abolfazl Andalib](https://github.com/abolfazl8131) - abolfazlandalib@gmail.com ** |
| 211 | + |
67 | 212 | ** [Mohammad Madanipour](https://github.com/mohammadll) - m.madanipourr@gmail.com ** |
0 commit comments