diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f96cd7e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" +} diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 0000000..15b2dba --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -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 "" \ No newline at end of file diff --git a/.devcontainer/postStartCommand.sh b/.devcontainer/postStartCommand.sh new file mode 100755 index 0000000..eaffc59 --- /dev/null +++ b/.devcontainer/postStartCommand.sh @@ -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 "" \ No newline at end of file diff --git a/.gitignore b/.gitignore index b36fdc6..6590be7 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,5 @@ typings/ #Dev docs/test.html -.venv* \ No newline at end of file +.venv* +.school.venv \ No newline at end of file