Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add devcontainer support to ease the setup of the dev workst… #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "SFEIR School LangChain",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"installJupyterlab": true,
"version": "3.12"
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",

// Use 'postCreateCommand' to run commands after the container is started.
"postStartCommand": "./.devcontainer/postStartCommand.sh",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"mhutchie.git-graph",
"anweber.reveal-button",
"ms-python.python",
"ms-python.debugpy",
"ms-toolsai.jupyter"
],
"settings":{
"python.pythonPath": "./.school.venv/bin/python",
"debug.javascript.autoAttachFilter": "onlyWithFlag"
}
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
26 changes: 26 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

# Installing Node Modules
#npm ci

# Installing Ollama

echo "⬇️ Downloading and Installing Ollama Server..."
curl https://ollama.ai/install.sh | sh

# Create the virtual environment (if missing)
if [ ! -f .school.venv/bin/activate ]; then
echo "➕ Creating the virtual environment (.school.venv)..."
virtualenv .school.venv
fi

echo "✅ Setup done"

# Activate the virtual environment for this terminal session
echo ""
echo "Please don't forget to run the following command in your terminal..."
echo "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
echo "source .school.venv/bin/activate"
echo "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
echo "...(to activate the virtual env) before installing Python dependencies!"
echo ""
22 changes: 22 additions & 0 deletions .devcontainer/postStartCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# Starting Ollama Server
echo "🏃🏿‍♂️ Starting Ollama Server..."
ollama serve &

echo "⬇️ Pulling LLMs..."
ollama pull llama2
#ollama pull mistral
#ollama pull codellama

echo "✅ Local LLMs Setup done!"


# Activate the virtual environment for this terminal session
echo ""
echo "Please don't forget to run the following command in your terminal..."
echo "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
echo "source .school.venv/bin/activate"
echo "⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️"
echo "...(to activate the virtual env) before installing Python dependencies!"
echo ""
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ typings/
#Dev
docs/test.html

.venv*
.venv*
.school.venv
2 changes: 1 addition & 1 deletion steps/02-langchain-solution/solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down