-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 RELEASE: First working release, version bumped to
1.0.0
. 🎉. (#1)
* 📦 NEW: Dockerfile for Meeseeks chat The docker image is building successfully and uses the port `8502` by default. * 📦 NEW: Add Docker build workflow with multi-arch support.
- Loading branch information
Showing
10 changed files
with
220 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Ignore environment files | ||
.env | ||
.env.example | ||
|
||
# Ignore git files | ||
.gitattributes | ||
.gitignore | ||
|
||
# Ignore build scripts | ||
build-install.sh | ||
|
||
# Ignore Python cache files | ||
**/__pycache__/ | ||
|
||
# Ignore documentation | ||
docs/ | ||
|
||
# Ignore specific application directories | ||
# meeseeks-api/ | ||
|
||
# (when needed) Ignore poetry lock files | ||
poetry.lock | ||
|
||
|
||
# Ignore codemod scripts | ||
repo-to-prompt.codemod.js | ||
|
||
# Ignore requirements file (if any) | ||
requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#@doc | ||
# * This GitHub Actions workflow builds and pushes a Docker image to GitHub Container Registry. | ||
# * It is triggered when a branch is created with the name syntax "release/[version]-[channel]". | ||
# | ||
# The workflow does the following: | ||
# 1. Checks out the code, sets up Docker buildx, Login to the registry. | ||
# 2. Extracts the branch name from the GITHUB_REF environment variable. | ||
# 3. Splits the branch name to get the version and channel. | ||
# 4. Builds and pushes the Docker image. | ||
|
||
# Examples: | ||
# If the branch name is 'release/1.0.0-latest', the image is tagged as '1.0.0' and 'latest'. | ||
# If the branch name is 'release/1.0.1-stable', the image is tagged as '1.0.1' and 'stable'. | ||
# If the branch name is 'release/1.0.2-dev', the image is tagged as '1.0.2-dev'. | ||
# | ||
# * The 'latest' and 'stable' tags allow us to easily switch between different versions. | ||
# * The 'dev' tag allows you to have a separate version for development. | ||
|
||
name: Build Meseeks Chat Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "release/*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract branch name | ||
id: extract_branch | ||
shell: bash | ||
run: | | ||
BRANCH_NAME=$(echo ${{ github.ref }} | sed 's/refs\/heads\///') | ||
echo "branch=$BRANCH_NAME" >> $GITHUB_ENV | ||
echo "Extracted branch name: $BRANCH_NAME" | ||
- name: Set version and channel | ||
id: version_channel | ||
run: | | ||
BRANCH_NAME=${{ env.branch }} | ||
VERSION=$(echo $BRANCH_NAME | cut -d'/' -f 2 | cut -d'-' -f 1) | ||
CHANNEL=$(echo $BRANCH_NAME | cut -d'/' -f 2 | cut -d'-' -f 2) | ||
echo "version=$VERSION" >> $GITHUB_ENV | ||
echo "channel=$CHANNEL" >> $GITHUB_ENV | ||
echo "Extracted version: $VERSION" | ||
echo "Extracted channel: $CHANNEL" | ||
echo "Extracted branch name: $BRANCH_NAME" | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/bearlike/meeseeks-chat:${{ env.version }}${{ env.channel == 'dev' && '-dev' || '' }} | ||
ghcr.io/bearlike/meeseeks-chat:${{ env.channel == 'latest' && 'latest' || env.channel == 'stable' && 'stable' || 'dev' }} | ||
platforms: linux/amd64,linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Dockerfile to build meeseeks-chat with core dependencies. | ||
|
||
FROM python:3.11-buster | ||
|
||
# Set the title, GitHub repo URL, version, and author | ||
ARG TITLE="Meeseeks Chat: Personal Assistant" \ | ||
VERSION="1.0.0" \ | ||
AUTHOR="Krishnakanth Alagiri" | ||
|
||
LABEL org.opencontainers.image.source="https://github.com/bearlike/Personal-Assistant" \ | ||
org.opencontainers.image.version=$VERSION \ | ||
org.opencontainers.image.vendor=$AUTHOR \ | ||
org.opencontainers.image.licenses="[email protected]" \ | ||
org.opencontainers.image.licenses="MIT" | ||
|
||
LABEL maintainer=$AUTHOR \ | ||
title=$TITLE \ | ||
url=$GITHUB_REPO_URL \ | ||
version=$VERSION | ||
|
||
# Virtualens are redundant for Dockerfile. | ||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache \ | ||
POETRY_VIRTUALENVS_CREATE=false | ||
|
||
# Update and install necessary software | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
curl \ | ||
software-properties-common \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the working directory to /app (assuming project root) | ||
WORKDIR /app | ||
|
||
# Copy the repo contents to the Docker image | ||
COPY . /app | ||
|
||
# Install Poetry | ||
RUN pip install 'poetry>=1.8,<1.9' | ||
|
||
# Install the core dependencies | ||
RUN poetry install | ||
|
||
# Install the meeseeks-chat dependencies | ||
WORKDIR /app/meeseeks-chat | ||
RUN poetry install | ||
|
||
# Set default environment variablesfor Meeseeks | ||
ENV CACHE_DIR='/tmp/meeseeks_cache' \ | ||
DEFAULT_MODEL='gpt-3.5-turbo' \ | ||
LOG_LEVEL=DEBUG \ | ||
ENVMODE=dev \ | ||
VERSION=${VERSION} \ | ||
COLOREDLOGS_FIELD_STYLES='asctime=color=240;name=45,inverse' \ | ||
COLOREDLOGS_LEVEL_STYLES='info=220;spam=22;debug=34;verbose=34;notice=220;warning=202;success=118,bold;error=124;critical=background=red' \ | ||
COLOREDLOGS_LOG_FORMAT='%(asctime)s [%(name)s] %(levelname)s %(message)s' | ||
|
||
|
||
# Expose port 8501 for Streamlit | ||
EXPOSE 8502 | ||
|
||
# Healthcheck to ensure the Streamlit server is running | ||
HEALTHCHECK CMD curl --fail http://localhost:8502/_stcore/health | ||
|
||
# Run the Streamlit application | ||
ENTRYPOINT ["poetry", "run", "python", "-m", "streamlit", "run", "chat_master.py", "--server.port=8502", "--server.address=0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters