Devcontainer backend dev (#608)

add backend-dev devcontainer and extract openapi.json to docs/
This commit is contained in:
Andrew Maguire
2023-01-11 16:09:02 +00:00
committed by GitHub
parent 991ff68d0a
commit b1fbd0fa96
7 changed files with 1984 additions and 2 deletions
@@ -0,0 +1,15 @@
{
"name": "Open-Assistant",
"image": "mcr.microsoft.com/vscode/devcontainers/universal",
"features": {
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {
"version": "latest"
}
},
"postCreateCommand": "bash .devcontainer/backend-dev/post_create_command.sh",
"customizations": {
"vscode": {
"extensions": ["GitHub.copilot"]
}
}
}
@@ -0,0 +1,23 @@
# ensure pre-commit is installed
pre-commit install
# create python virtual environment
python3 -m venv .venv
# install python dependencies in /backend
cd backend
pip install -r requirements.txt
cd ..
# install code in editable mode in /oasst-shared
cd oasst-shared
pip install -e .
cd ..
# docker compose up for backend-dev
docker compose up backend-dev --build --attach-dependencies -d
# note: commented out for now, you probably want to manually run this part once in the devcontainer
# run run-local.sh script
# cd scripts/backend-development/
# bash run-local.sh