Skip to content

Commit bd762e8

Browse files
committed
Merge branch 'master' of github.com:abolfazl8131/devops_gpt
2 parents 3d62c1e + d6b2b38 commit bd762e8

6 files changed

Lines changed: 105 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
"template": "#{{CHANGELOG}}",
3838
"categories": [
3939
{
40-
"title": "## Feature",
40+
"title": "## 🚀 Features",
4141
"labels": ["feat", "feature"]
4242
},
4343
{
44-
"title": "## Fix",
44+
"title": "## 🐛 Fixes",
4545
"labels": ["fix", "bug"]
4646
},
4747
{

.github/workflows/docker.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docker Health Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
docker_health_check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- uses: actions/checkout@v4
14+
- name: install requirements
15+
run: pip install -r requirements.txt
16+
17+
- name: docker login
18+
uses: docker/login-action@v3
19+
with:
20+
username: 81318131
21+
password: ${{ secrets.DOCKER_PASSWORD }}
22+
23+
- name: build services
24+
run: docker compose build
25+
26+
- name: run services
27+
run: docker compose up --build -d
28+
29+
- name: stop containers
30+
run: docker compose down

.github/workflows/pylint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Pylint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.11"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install pylint
24+
pip install -r requirements.txt
25+
- name: Analysing the code with pylint
26+
run: |
27+
pylint $(git ls-files 'app/main.py') --disable=R,C,W

Dockerfile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
FROM python:3.11-alpine
2-
32
RUN apk add --no-cache shadow
4-
53
RUN useradd -ms /bin/bash admin
6-
74
WORKDIR /code
8-
9-
105
COPY ./requirements.txt /code/requirements.txt
11-
12-
136
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
14-
15-
167
COPY ./app /code/app
17-
18-
198
RUN chown -R admin /code/app/*
20-
21-
USER admin
9+
USER admin

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,55 @@
11
# DevOps-GPT
2-
Use a brilliant assistant as your friend on your DevOps journey.
2+
Use a brilliant assistant as your friend in your DevOps journey.
33

44
## What does this project offer?
55
This project helps you to balance your daily work as a DevOps engineer, from simple bug fixes to project template generation.<br />
66
you don't need to search on Google for some routine jobs and it helps you with a robust prompt to simplify your career.
77

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+
11+
We have developed some (Extendable) prompt-driven solutions with a simplified interface for the DevOps process cost reduction.<br />
12+
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 />
16+
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`.
20+
21+
![teramedia](https://github.com/user-attachments/assets/b8e10d83-68ac-4efc-b064-45f1d1a870dc)
22+
23+
This is an example of a template generated in the `/media`
24+
25+
and the input is something like that
26+
27+
![Screenshot from 2024-10-27 10-56-54](https://github.com/user-attachments/assets/63d1db07-2c25-4c10-a841-69a2c1235d9d)
28+
29+
30+
31+
### directory_generator.py
32+
This file becomes updated when we trigger the template generation API. finally, It generates the MyTerraform directory based on user input which is a template.
33+
34+
835
## ToolChain
936
1. Python
1037
2. Docker
1138
3. GPT-4-mini
1239
4. FastAPI
40+
41+
## Pre-requisites
42+
1. Python
43+
2. Docker
44+
45+
## How to use?
46+
execute `sh run.sh` in your terminal
47+
48+
> [!WARNING]
49+
> 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.
50+
51+
52+
>
53+
# Maintenance
54+
** [Abolfazl Andalib](https://github.com/abolfazl8131) - abolfazlandalib@gmail.com **<br />
55+
** [Mohammad Madanipour](https://github.com/mohammadll) - m.madanipourr@gmail.com **

app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ def list_directory(folder: str):
7474

7575
# List the contents of the directory
7676
contents = os.listdir(folder)
77-
return {"folder": folder, "contents": contents}
77+
return {"folder": folder, "contents": contents}

0 commit comments

Comments
 (0)