From df15fb54b02acf8c0acebcf2d1e5deb339d34fca Mon Sep 17 00:00:00 2001 From: Ryan Turner Date: Sat, 4 Jan 2025 19:39:23 -0600 Subject: [PATCH 1/6] Initial checkin --- Dockerfile | 8 ++--- script/docker/compose.yaml | 52 ++++++++++++++++++++++++++++++ script/docker/ollama-entrypoint.sh | 16 +++++++++ 3 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 script/docker/compose.yaml create mode 100644 script/docker/ollama-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index cd6152d..13daf5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,18 +7,14 @@ RUN apt-get update && apt-get install -y gettext tzdata locales && rm -rf /var/l RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ dpkg-reconfigure --frontend=noninteractive locales && \ update-locale LANG=en_US.UTF-8 -ENV LANG=en_US.UTF-8 +ENV LANG="en_US.UTF-8" ENV TZ="America/Los_Angeles" WORKDIR /app COPY . /app -COPY requirements.txt . RUN pip install -r requirements.txt -COPY . . - -COPY config.ini /app/config.ini -COPY entrypoint.sh /app/entrypoint.sh RUN chmod +x /app/entrypoint.sh + ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/script/docker/compose.yaml b/script/docker/compose.yaml new file mode 100644 index 0000000..2aa35cf --- /dev/null +++ b/script/docker/compose.yaml @@ -0,0 +1,52 @@ +services: + meshing-around: + build: + context: .. + # depends_on: + # ollama: + # condition: service_healthy + devices: + - /dev/ttyAMA10 # Replace this with your actual device! + configs: + - source: me_config + target: /app/config.ini + extra_hosts: + - "host.docker.internal:host-gateway" # Used to access a local linux meshtasticd device via tcp + # ollama: + # image: ollama/ollama:0.5.1 + # volumes: + # - ./ollama:/root/.ollama + # - ./ollama-entrypoint.sh:/entrypoint.sh + # container_name: ollama + # pull_policy: always + # tty: true + # restart: always + # entrypoint: + # - /usr/bin/bash + # - /entrypoint.sh + # expose: + # - 11434 + # healthcheck: + # test: "apt update && apt install curl -y && curl -f http://localhost:11434/api/tags | grep -q llama3.2:3b" + # interval: 30s + # timeout: 10s + # retries: 20 + # node-exporter: + # image: quay.io/prometheus/node-exporter:latest + # volumes: + # - /proc:/host/proc:ro + # - /sys:/host/sys:ro + # - /:/rootfs:ro + # command: + # - --path.procfs=/host/proc + # - --path.rootfs=/rootfs + # - --path.sysfs=/host/sys + # - --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/) + # restart: unless-stopped + # expose: + # - 9100 + # network_mode: host + # pid: host +configs: + me_config: + file: ./config.ini \ No newline at end of file diff --git a/script/docker/ollama-entrypoint.sh b/script/docker/ollama-entrypoint.sh new file mode 100644 index 0000000..ced1718 --- /dev/null +++ b/script/docker/ollama-entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Start Ollama in the background. +/bin/ollama serve & +# Record Process ID. +pid=$! + +# Pause for Ollama to start. +sleep 5 + +echo "🔴 Retrieve llama3.2:3b model..." +ollama pull llama3.2:3b +echo "🟢 Done!" + +# Wait for Ollama process to finish. +wait $pid From 4f9c36fdad4e4c242c831ea3cae879d39d00accf Mon Sep 17 00:00:00 2001 From: Ryan Turner Date: Sat, 4 Jan 2025 19:41:41 -0600 Subject: [PATCH 2/6] fixup! Initial checkin --- script/docker/README.md | 3 +++ script/docker/compose.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 script/docker/README.md diff --git a/script/docker/README.md b/script/docker/README.md new file mode 100644 index 0000000..ec76b4e --- /dev/null +++ b/script/docker/README.md @@ -0,0 +1,3 @@ +# How do I use this thing? + +`docker compose up` diff --git a/script/docker/compose.yaml b/script/docker/compose.yaml index 2aa35cf..66f5444 100644 --- a/script/docker/compose.yaml +++ b/script/docker/compose.yaml @@ -1,7 +1,7 @@ services: meshing-around: build: - context: .. + context: ../.. # depends_on: # ollama: # condition: service_healthy From d3f07ae5249ec55e477fcca2c16d20cfbeaa694b Mon Sep 17 00:00:00 2001 From: Ryan Turner Date: Sat, 4 Jan 2025 19:58:12 -0600 Subject: [PATCH 3/6] fixup! fixup! Initial checkin --- script/docker/README.md | 2 +- script/docker/compose.yaml | 70 +++++++++++++++++++------------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/script/docker/README.md b/script/docker/README.md index ec76b4e..dc803c0 100644 --- a/script/docker/README.md +++ b/script/docker/README.md @@ -1,3 +1,3 @@ # How do I use this thing? -`docker compose up` +`docker compose up -d` diff --git a/script/docker/compose.yaml b/script/docker/compose.yaml index 66f5444..e432fda 100644 --- a/script/docker/compose.yaml +++ b/script/docker/compose.yaml @@ -12,41 +12,41 @@ services: target: /app/config.ini extra_hosts: - "host.docker.internal:host-gateway" # Used to access a local linux meshtasticd device via tcp - # ollama: - # image: ollama/ollama:0.5.1 - # volumes: - # - ./ollama:/root/.ollama - # - ./ollama-entrypoint.sh:/entrypoint.sh - # container_name: ollama - # pull_policy: always - # tty: true - # restart: always - # entrypoint: - # - /usr/bin/bash - # - /entrypoint.sh - # expose: - # - 11434 - # healthcheck: - # test: "apt update && apt install curl -y && curl -f http://localhost:11434/api/tags | grep -q llama3.2:3b" - # interval: 30s - # timeout: 10s - # retries: 20 - # node-exporter: - # image: quay.io/prometheus/node-exporter:latest - # volumes: - # - /proc:/host/proc:ro - # - /sys:/host/sys:ro - # - /:/rootfs:ro - # command: - # - --path.procfs=/host/proc - # - --path.rootfs=/rootfs - # - --path.sysfs=/host/sys - # - --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/) - # restart: unless-stopped - # expose: - # - 9100 - # network_mode: host - # pid: host + ollama: + image: ollama/ollama:0.5.1 + volumes: + - ./ollama:/root/.ollama + - ./ollama-entrypoint.sh:/entrypoint.sh + container_name: ollama + pull_policy: always + tty: true + restart: always + entrypoint: + - /usr/bin/bash + - /entrypoint.sh + expose: + - 11434 + healthcheck: + test: "apt update && apt install curl -y && curl -f http://localhost:11434/api/tags | grep -q llama3.2:3b" + interval: 30s + timeout: 10s + retries: 20 + node-exporter: + image: quay.io/prometheus/node-exporter:latest + volumes: + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro + command: + - --path.procfs=/host/proc + - --path.rootfs=/rootfs + - --path.sysfs=/host/sys + - --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/) + restart: unless-stopped + expose: + - 9100 + network_mode: host + pid: host configs: me_config: file: ./config.ini \ No newline at end of file From 70e11117f1004fb907d2c41901c8c143208407b9 Mon Sep 17 00:00:00 2001 From: Ryan Turner Date: Sat, 4 Jan 2025 20:18:35 -0600 Subject: [PATCH 4/6] fixup! fixup! fixup! Initial checkin --- script/docker/compose.yaml | 2 +- script/docker/ollama-entrypoint.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/docker/compose.yaml b/script/docker/compose.yaml index e432fda..3410cc5 100644 --- a/script/docker/compose.yaml +++ b/script/docker/compose.yaml @@ -27,7 +27,7 @@ services: expose: - 11434 healthcheck: - test: "apt update && apt install curl -y && curl -f http://localhost:11434/api/tags | grep -q llama3.2:3b" + test: "apt update && apt install curl -y && curl -f http://localhost:11434/api/tags | grep -q llama3.3:3b" interval: 30s timeout: 10s retries: 20 diff --git a/script/docker/ollama-entrypoint.sh b/script/docker/ollama-entrypoint.sh index ced1718..18e1550 100644 --- a/script/docker/ollama-entrypoint.sh +++ b/script/docker/ollama-entrypoint.sh @@ -8,8 +8,8 @@ pid=$! # Pause for Ollama to start. sleep 5 -echo "🔴 Retrieve llama3.2:3b model..." -ollama pull llama3.2:3b +echo "🔴 Retrieve llama3.3:3b model..." +ollama pull llama3.3:3b echo "🟢 Done!" # Wait for Ollama process to finish. From 89a088460049ed2c6a855a9e652807b061640f44 Mon Sep 17 00:00:00 2001 From: Ryan Turner Date: Sat, 4 Jan 2025 20:22:40 -0600 Subject: [PATCH 5/6] fixup! fixup! fixup! fixup! Initial checkin --- script/docker/compose.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/docker/compose.yaml b/script/docker/compose.yaml index 3410cc5..a1c059d 100644 --- a/script/docker/compose.yaml +++ b/script/docker/compose.yaml @@ -2,9 +2,9 @@ services: meshing-around: build: context: ../.. - # depends_on: - # ollama: - # condition: service_healthy + depends_on: + ollama: + condition: service_healthy devices: - /dev/ttyAMA10 # Replace this with your actual device! configs: From acf39d08709822140947f270d62bbe90a432751d Mon Sep 17 00:00:00 2001 From: Ryan Turner Date: Sat, 4 Jan 2025 20:40:27 -0600 Subject: [PATCH 6/6] fixup! fixup! fixup! fixup! fixup! Initial checkin --- script/docker/compose.yaml | 2 +- script/docker/ollama-entrypoint.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/docker/compose.yaml b/script/docker/compose.yaml index a1c059d..c4e4a20 100644 --- a/script/docker/compose.yaml +++ b/script/docker/compose.yaml @@ -27,7 +27,7 @@ services: expose: - 11434 healthcheck: - test: "apt update && apt install curl -y && curl -f http://localhost:11434/api/tags | grep -q llama3.3:3b" + test: "apt update && apt install curl -y && curl -f http://localhost:11434/api/tags | grep -q llama3.2:3b" interval: 30s timeout: 10s retries: 20 diff --git a/script/docker/ollama-entrypoint.sh b/script/docker/ollama-entrypoint.sh index 18e1550..ced1718 100644 --- a/script/docker/ollama-entrypoint.sh +++ b/script/docker/ollama-entrypoint.sh @@ -8,8 +8,8 @@ pid=$! # Pause for Ollama to start. sleep 5 -echo "🔴 Retrieve llama3.3:3b model..." -ollama pull llama3.3:3b +echo "🔴 Retrieve llama3.2:3b model..." +ollama pull llama3.2:3b echo "🟢 Done!" # Wait for Ollama process to finish.