diff --git a/deepnote/README.md b/deepnote/README.md new file mode 100644 index 0000000..48d32ac --- /dev/null +++ b/deepnote/README.md @@ -0,0 +1,7 @@ +- syncthing. Easily sync files between workstations and containers +- bun. build & run javascript/typescript projects +- basic sys utils. mtr, lsof, nc, screen, etc. + +## IN CONSIDERATION +- a separate image with python 3.12 + llamaindex + other LLM dev stuff, of course, with utils. +- image with caddy for more hosting options \ No newline at end of file diff --git a/deepnote/data/Dockerfile b/deepnote/data/Dockerfile new file mode 100644 index 0000000..6a190ec --- /dev/null +++ b/deepnote/data/Dockerfile @@ -0,0 +1,53 @@ +FROM bitnami/python:3.11-debian-12 + +# Switch to root user +USER root + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + vim \ + screen \ + lsof \ + netcat-openbsd \ + mtr-tiny \ + zsh \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create necessary directories +RUN mkdir -p /root/work/bin + +# Download and install Syncthing +RUN SYNCTHING_VERSION=$(curl -s https://api.github.com/repos/syncthing/syncthing/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') && \ + wget https://github.com/syncthing/syncthing/releases/download/${SYNCTHING_VERSION}/syncthing-linux-amd64-${SYNCTHING_VERSION}.tar.gz -O syncthing.tar.gz && \ + tar -xzf syncthing.tar.gz && \ + mv syncthing-linux-amd64-${SYNCTHING_VERSION}/syncthing /root/work/bin/ && \ + rm -rf syncthing-linux-amd64-${SYNCTHING_VERSION} syncthing.tar.gz + +# Install Bun +RUN curl -fsSL https://bun.sh/install | bash \ + && mv /root/.bun /root/work/bun + +# Set up PATH +ENV PATH="/root/work/bin:/root/work/bun/bin:${PATH}" + +# Set working directory +WORKDIR /root/work + +# Set up Python virtual environment +RUN python -m venv venv \ + && . venv/bin/activate \ + && rm -rf ~/.cache/pip + +# Copy requirements.txt and install Python dependencies +COPY requirements.txt . +RUN . venv/bin/activate && pip install -r requirements.txt + +# Set default shell to zsh +SHELL ["/bin/bash", "-c"] + +# Activate virtual environment in bash +RUN echo "source /root/work/venv/bin/activate" >> ~/.bashrc + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/deepnote/data/requirements.txt b/deepnote/data/requirements.txt new file mode 100644 index 0000000..5718080 --- /dev/null +++ b/deepnote/data/requirements.txt @@ -0,0 +1,6 @@ +pydantic +httpx +fastapi +pandas +matplotlib +tabulate diff --git a/deepnote/llm/Dockerfile b/deepnote/llm/Dockerfile new file mode 100644 index 0000000..d1221df --- /dev/null +++ b/deepnote/llm/Dockerfile @@ -0,0 +1,63 @@ +FROM bitnami/python:3.12-debian-12 + +# Switch to root user +USER root + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + vim \ + screen \ + lsof \ + netcat-openbsd \ + mtr-tiny \ + zsh \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create necessary directories +RUN mkdir -p /root/work/bin + +# Download and install Syncthing +RUN SYNCTHING_VERSION=$(curl -s https://api.github.com/repos/syncthing/syncthing/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') && \ + wget https://github.com/syncthing/syncthing/releases/download/${SYNCTHING_VERSION}/syncthing-linux-amd64-${SYNCTHING_VERSION}.tar.gz -O syncthing.tar.gz && \ + tar -xzf syncthing.tar.gz && \ + mv syncthing-linux-amd64-${SYNCTHING_VERSION}/syncthing /root/work/bin/ && \ + rm -rf syncthing-linux-amd64-${SYNCTHING_VERSION} syncthing.tar.gz + +# Install Bun +RUN curl -fsSL https://bun.sh/install | bash \ + && mv /root/.bun /root/work/bun + +# Set up PATH +ENV PATH="/root/work/bin:/root/work/bun/bin:${PATH}" + +# Set working directory +WORKDIR /root/work + +# Install HAProxy +RUN curl https://haproxy.debian.net/bernat.debian.org.gpg | gpg --dearmor > /usr/share/keyrings/haproxy.debian.net.gpg && \ + echo deb "[signed-by=/usr/share/keyrings/haproxy.debian.net.gpg]" \ + http://haproxy.debian.net bookworm-backports-3.0 main \ + > /etc/apt/sources.list.d/haproxy.list && \ + apt-get update && \ + apt-get install -y haproxy=3.0.\* && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Set up Python virtual environment +RUN python -m venv venv \ + && . venv/bin/activate \ + && rm -rf ~/.cache/pip + +# Copy requirements.txt and install Python dependencies +COPY requirements.txt . +RUN . venv/bin/activate && pip install -r requirements.txt + +# Set default shell to zsh +SHELL ["/bin/bash", "-c"] + +# Activate virtual environment in bash +RUN echo "source /root/work/venv/bin/activate" >> ~/.bashrc + +CMD ["/bin/bash"] \ No newline at end of file diff --git a/deepnote/llm/requirements.txt b/deepnote/llm/requirements.txt new file mode 100644 index 0000000..4720164 --- /dev/null +++ b/deepnote/llm/requirements.txt @@ -0,0 +1,3 @@ +llama-index +httpx +fastapi