DevOpsGPT Documentation

repository·master·Indexed 27 days ago

https://github.com/kuafuai/devopsgpt

An AI-driven software development automation solution that combines Large Language Models (LLMs) with DevOps tools to transform natural language requirements into deployable software. It includes an AI code analyzer browser extension for repository analysis and provides APIs for application management, service analysis, and integration with Git, CI tools, and cloud deployment services.

Tokens
5.4K
Snippets
13
Records
33
Agent score
88%

What's inside DevOpsGPT

  1. Overview of AI code analyzer

    master

    The AI code analyzer is a browser extension designed to provide professional, comprehensive, and intuitive code analysis with one-click operation. It helps developers of all levels improve efficiency and code understanding by analyzing repository structures directly in the browser (e.g., on GitHub).

    Key Features:

    • Multi-language Analysis: Supports various languages including Python, Java, and JavaScript.
    • Framework Identification: Automatically identifies frameworks such as React, Vue, Springboot, or Flask.
    • Module Purpose Mapping: Provides a functional map of libraries and modules used in a project.
    • Real-time Feedback: Offers immediate analysis while browsing GitHub to help identify best practices and common patterns.
    • Deep Code Analysis: Analyzes complex project structures to help users quickly locate important components.
  2. DevOpsGPT Workflow Overview

    master

    DevOpsGPT automates the software development lifecycle by combining LLMs with DevOps tools. The typical workflow includes:

    • Requirement Clarification: Interacting with developers to confirm details in requirement documents.
    • Interface Documentation Generation: Generating API/interface docs based on requirements.
    • Pseudo-code Generation: Analyzing existing projects to generate reference pseudo-code.
    • Code Refinement: Developers refine and optimize the generated code.
    • Continuous Integration: Using DevOps tools to automate integration and testing.
    • Software Release: Deploying software versions to target environments via DevOpsGPT and DevOps tools.
  3. Quick Start: Run DevOpsGPT from source code

    master

    To run DevOpsGPT locally using the source code, follow these steps:

    1. Prerequisites: Ensure you have SQLite and Python 3.7 or later installed.
    2. Download: Download a released version or clone the repository.
    3. Configure:
      • Copy env.yaml.tpl to env.yaml.
      • Edit env.yaml to include your required information, such as your GPT Token.
    4. Execute:
      • Linux/Mac: Run sh run.sh.
      • Windows: Double-click run.bat.
    5. Access: Open your browser and navigate to the address shown in the startup logs (default is http://127.0.0.1:8080).
    6. Usage: Follow the on-screen instructions to develop requirements. Generated code will be saved in the ./workspace directory.
    sh run.sh
  4. Quick Start: Run DevOpsGPT via Docker

    master

    To run DevOpsGPT using Docker, follow these steps:

    1. Prepare Workspace: Create a local directory for the workspace: mkdir -p workspace.
    2. Prepare Configuration:
      • Copy env.yaml.tpl from the repository to your current directory and rename it to env.yaml.
      • Edit env.yaml to add necessary information like your GPT Token.
    3. Run Container: Execute the following command to start the service, mounting your local workspace and configuration files:
      docker run -it \
      -v$PWD/workspace:/app/workspace \
      -v$PWD/env.yaml:/app/env.yaml \
      -p8080:8080 -p8081:8081 kuafuai/devopsgpt:latest
    4. Access the UI: Navigate to the address shown in the logs (default is http://127.0.0.1:8080).
    5. Develop: Follow the UI guidance. Generated code will appear in your local ./workspace directory.
    docker run -it \
    -v$PWD/workspace:/app/workspace \
    -v$PWD/env.yaml:/app/env.yaml \
    -p8080:8080 -p8081:8081 kuafuai/devopsgpt:latest
  5. Quick Start: Run DevOpsGPT from Source

    master

    To run DevOpsGPT locally from the source code, follow these steps:

    1. Prerequisites: Ensure you have SQLite and Python 3.7 or higher installed.
    2. Prepare Configuration:
      • Copy env.yaml.tpl to env.yaml.
      • Edit env.yaml to include your required credentials, such as your GPT Token.
    3. Run the Service:
      • On Linux or Mac: Execute sh run.sh.
      • On Windows: Double-click run.bat.
    4. Access the UI: Open your browser and navigate to the address provided in the startup logs (default is http://127.0.0.1:8080).
    5. Develop: Follow the on-screen guidance to complete requirement development. Generated code will be located in the ./workspace directory.
    sh run.sh
  6. Quick Start DevOpsGPT

    master

    Follow these steps to set up and run DevOpsGPT locally:

    1. Prerequisites: Ensure you have Python 3.7 or higher installed.
    2. Clone/Download: Clone the latest code or select a released version.
    3. Generate Config: Copy env.yaml.tpl and rename it to env.yaml.
    4. Configure: Edit env.yaml to add necessary information, such as your GPT Token.
    5. Run Service:
      • Linux/Mac: Execute sh run.sh.
      • Windows: Double-click run.bat.
    6. Access: Open your browser to the address provided in the startup logs (default is http://127.0.0.1:8080).
    7. Development: Follow the UI prompts to develop requirements. Generated code will be located in the ./workspace directory.
  7. Configure CD Tool for Cloud Deployment (Alibaba Cloud Example)

    master

    Automate deployment to cloud services using the following configuration (example uses Alibaba Cloud):

    1. Credentials: Create an AccessKey on your cloud platform and set CD_ACCESS_KEY and CD_SECRET_KEY in the config.
    2. Region: Set CD_REGION to your deployment area (e.g., cn-hongkong).
    3. Networking:
      • CD_EIP: A public IP address in the same region as CD_REGION.
      • CD_SECURITY: A security group configured to allow external ports for the service.
    4. Infrastructure: Set CD_SWITCH to create the necessary network switch.
  8. Configure Automated Deployment (Cloud Services)

    master

    Automated deployment allows one-click deployment of developed applications to cloud services. Using Alibaba Cloud as an example, configure the following in env.yaml:

    1. Credentials: Create an AccessKey in your cloud console and set CD_ACCESS_KEY and CD_SECRET_KEY.
    2. Region: Set CD_REGION to your target deployment region (e.g., cn-hongkong).
    3. Network:
      • CD_EIP: Set the Public IP used for external access (must match the CD_REGION).
      • CD_SECURITY: Set the Security Group to open necessary external ports.
      • CD_SWITCH: Set the Switch/VPC configuration.
    4. Toggle: Use CD_SWITCH to enable/disable deployment functionality.
  9. Install AI code analyzer via Chrome Web Store

    master

    To install the extension using the official marketplace:

    1. Click the Extensions icon in the top right corner of your Chrome browser.
    2. Select Visit Chrome Web Store.
    3. In the search box, type AI code analyzer and press enter.
    4. Click on the correct extension from the results to open its details page.
    5. Click Add to Chrome to complete the installation.
  10. Install AI code analyzer from source

    master

    To install the extension manually using the source code:

    1. Click the Extensions icon in the top right corner of your Chrome browser and select Manage Extensions.
    2. Enable Developer mode using the toggle switch in the top right.
    3. Click the Load unpacked button.
    4. Select the root directory of the source code and click Confirm to complete the installation.
  11. Quick Start: Run DevOpsGPT with Docker

    master

    To run DevOpsGPT using Docker, follow these steps:

    1. Prepare Workspace: Create a local directory for the workspace: mkdir -p workspace.
    2. Configure:
      • Copy env.yaml.tpl from the repository to your current directory and rename it to env.yaml.
      • Edit env.yaml to add necessary information like your GPT Token.
    3. Run Container: Execute the following command to start the service, mounting your local workspace and configuration files:
    docker run -it \
    -v$PWD/workspace:/app/workspace \
    -v$PWD/env.yaml:/app/env.yaml \
    -p8080:8080 -p8081:8081 kuafuai/devopsgpt:latest
    1. Access: Navigate to the address provided in the startup logs (default is http://127.0.0.1:8080) in your browser.
    2. Usage: Complete the requirement development via the web interface. Generated code will appear in your local ./workspace directory.
    docker run -it \
    -v$PWD/workspace:/app/workspace \
    -v$PWD/env.yaml:/app/env.yaml \
    -p8080:8080 -p8081:8081 kuafuai/devopsgpt:latest
  12. Configure CI Tool Integration (GitlabCI/GithubActions)

    master

    To trigger pipelines automatically upon code submission, configure the following:

    1. Git Configuration: Ensure the Git settings mentioned in the Git Configuration section are complete.
    2. GIT_API: Set the Git API endpoint (e.g., https://api.github.com).
    3. Pipeline Setup:
      • Gitlab: Set up a .gitlab-ci.yml file and configure a Gitlab runner.
      • Github: Set up a workflow file (e.g., .github/workflows/default.yaml) using Github Actions.