Skip to content

Commit

Permalink
Create Vitepress documentation, workflows, issue templates for GitHub…
Browse files Browse the repository at this point in the history
…, Black pre-commit hook
  • Loading branch information
Stax124 committed Feb 14, 2023
1 parent f111508 commit c6e4c75
Show file tree
Hide file tree
Showing 25 changed files with 1,220 additions and 12 deletions.
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "\U0001F41E Bug report"
description: Create a report to help us improve
body:
- type: markdown
attributes:
value: |
"Thanks for taking the time to fill out this bug report!"
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Bug description
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Steps to reproduce the behavior
placeholder: Reproduction
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
placeholder: Expected behavior
validations:
required: true
- type: textarea
id: system-info
attributes:
label: System Info
description: Python Version, Operating System, Currently installed version of this project, etc.
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context or screenshots about the bug report here.
- type: checkboxes
id: checkboxes
attributes:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Read the [docs](https://ddPn08.github.io/Lsmith/).
required: true
- label: Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
required: true
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "\U0001F680 New feature proposal"
description: Suggest an idea for this project
body:
- type: markdown
attributes:
value: |
Thanks for your interest in the project and taking the time to fill out this feature report!
- type: textarea
id: feature-description
attributes:
label: Is your feature request related to a problem? Please describe.
description: "A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]"
validations:
required: true
- type: textarea
id: suggested-solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternative
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
- type: checkboxes
id: checkboxes
attributes:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Read the [docs](https://ddPn08.github.io/Lsmith/).
required: true
- label: Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.
required: true
10 changes: 10 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Black

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
75 changes: 75 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: ["experimental", "main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["experimental", "main"]
schedule:
- cron: "25 23 * * 3"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["python", "javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Documentation

on:
push:
branches:
- experimental

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- run: yarn install

- name: Build
run: yarn docs:build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Python
__pycache__
/venv
/tmp
dist

# Project specific
/config.json
/outputs
/models
/docker-data
/docker-data
/tmp

# Docs
/docs/.vitepress/dist
/docs/.vitepress/cache
node_modules
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3.10
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ services:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
capabilities: [gpu]
72 changes: 72 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { defineConfig } from "vitepress";

export default defineConfig({
title: "Lsmith documentation",
description:
"StableDiffusionWebUI using high-speed inference technology with TensorRT",
lang: "en-US",
appearance: "dark",
lastUpdated: true,
base: "/Lsmith/",
themeConfig: {
editLink: {
pattern: "https://github.com/ddPn08/Lsmith/edit/main/docs/:path",
},
socialLinks: [
{
icon: "github",
link: "https://github.com/ddPn08/Lsmith",
},
],
sidebar: [
{
text: "Introduction",
items: [{ text: "Introduction", link: "/" }],
},
{
text: "Installation",
items: [
{ text: "Docker", link: "/installation/docker" },
{ text: "Windows", link: "/installation/windows" },
{ text: "Linux", link: "/installation/linux" },
],
},
{
text: "WebUI",
items: [{ text: "WebUI", link: "/webui/" }],
},
{
text: "API",
items: [{ text: "API", link: "/api/" }],
},
{
text: "Developers",
items: [
{ text: "TensorRT", link: "/developers/tensorrt" },
{
text: "Frontend",
link: "/developers/frontend",
},
{
text: "Documentation",
link: "/developers/documentation",
},
],
},
{
text: "Troubleshooting",
items: [
{ text: "Linux", link: "/troubleshooting/linux" },
{
text: "Windows",
link: "/troubleshooting/windows",
},
{
text: "Docker",
link: "/troubleshooting/docker",
},
],
},
],
},
});
11 changes: 11 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# API

## How to access the API documentation (and Web Interface)

1. Start the application.

2. Access `<ip address>:<port number>/api/docs` (ex `http://localhost:8000/api/docs`) to open the API documentation.

::: danger TODO
Add more details about how to use the API. Insert images, etc.
:::
49 changes: 49 additions & 0 deletions docs/developers/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Documentation

This is will show you how to edit our documentation and how to properly contribute while outlining some rules for us.

## Rules

::: warning
Please read the rules before you start editing the documentation.
:::

- All new images will be in WEBP or JPEG format with maximum of 90% image quality
- Images will be of sensible resolution (no 4k or higher resolution images)
- English only
- Grammarly correct when possible
- Keep it simple

## How to edit

All documentation is written in Markdown and is located in the `docs` folder. You can edit it directly on GitHub or you can clone the repository and edit it locally.

Edits on GitHub will create a Pull Request with the changes and they will be waiting for review.

Once the change is reviewed and approved it will be merged into the branch and will be deployed by our CI/CD pipeline.

## Running documentation locally

::: info
`yarn` can be installed using `npm install -g yarn`
:::

Clone the repository

```bash
git clone https://github.com/VoltaML/voltaML-fast-stable-diffusion.git
```

Install dependencies

```bash
yarn install
```

Run the documentation

```bash
yarn docs:dev
```

You should now be able to access the documentation on `http://localhost:5173/voltaML-fast-stable-diffusion/`
3 changes: 3 additions & 0 deletions docs/developers/frontend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
::: danger TODO
Fill in the missing information
:::
3 changes: 3 additions & 0 deletions docs/developers/tensorrt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
::: danger TODO
Fill in the missing information
:::
Loading

0 comments on commit c6e4c75

Please sign in to comment.