Feat: Dev Container for GitHub Codespaces (#2689)

* Workaround for GitHub Codespaces

* Add devcontainer config

* rename devcontainer folder

* install netcat

* add VS Code Python extension

* apt update

* give executable path to avoid bugs

* configure poetry env

* fix postCreateCommand

* revert executable path

* add postStartCommand

* run in background

* Add Codespaces badge

* add default config

* Add Codespaces badge to doc

* update comment

* apply workaround 2

* refactor

* fix lib path

* Update on_create.sh

* pass env directly to cmd

* resolve unexpected merge conflicts

* Separated to #2850

* Update README.md

Co-authored-by: Graham Neubig <neubig@gmail.com>

* Update codespaces link

* Update README.md

* Separated to #2975

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Graham Neubig <neubig@gmail.com>
This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி 2024-07-28 17:14:18 +05:30 committed by GitHub
parent b1ea204c5b
commit eb182f492e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 0 deletions

1
.devcontainer/README.MD Normal file
View File

@ -0,0 +1 @@
The files in this directory configure a development container for GitHub Codespaces.

View File

@ -0,0 +1,15 @@
{
"name": "OpenDevin Codespaces",
"image": "mcr.microsoft.com/devcontainers/universal",
"customizations":{
"vscode":{
"extensions": [
"ms-python.python"
]
}
},
"onCreateCommand": "sh ./.devcontainer/on_create.sh",
"postCreateCommand": "make build",
"postStartCommand": "USE_HOST_NETWORK=True nohup bash -c 'make run &'"
}

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
sudo apt update
sudo apt install -y netcat
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt install -y python3.11
curl -sSL https://install.python-poetry.org | python3.11 -
# chromadb requires SQLite > 3.35 but SQLite in Python3.11.9 comes with 3.31.1
sudo cp /opt/conda/lib/libsqlite3.so.0 /lib/x86_64-linux-gnu/libsqlite3.so.0