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

Release v0.8.2 #67

Merged
merged 5 commits into from
Dec 6, 2024
Merged
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
42 changes: 18 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,32 @@ ARG GO_VERSION=1.21.6
ARG HUGO_VERSION=0.121.2
ARG TARGETARCH

# install git, go and hugo
RUN apt update && apt upgrade -y && apt install -y git wget
# install wget and git
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y git wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN wget https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz && tar -C /usr/local -xzf go${GO_VERSION}.linux-${TARGETARCH}.tar.gz
RUN export PATH=$PATH:/usr/local/go/bin:/usr/local && go version
RUN wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz && tar -C /usr/local -xzf hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz && ls -al /usr/local
RUN /usr/local/hugo version

ENV PATH="/usr/local/go/bin:/usr/local:${PATH}"
RUN go version

RUN wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz \
&& tar -C /bin -xzf hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz \
&& rm hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz

RUN hugo version

# Install Poetry
RUN pip install poetry

# Copy the current directory contents into the container at /app
COPY . /app

# Use Poetry to install dependencies
# # Use Poetry to install dependencies
RUN poetry config virtualenvs.create true && poetry install --no-interaction --no-ansi

# Start a new, final stage
FROM python:${PYTHON_VERSION}-slim-bullseye

WORKDIR /app

# Install git and Poetry in the final stage
RUN apt update && apt install -y git && pip install poetry

# Copy the compiled app, Hugo executable, Go, and the virtual environment from the previous stage
COPY --from=builder /app /app
COPY --from=builder /usr/local/hugo /usr/local/hugo
COPY --from=builder /usr/local/go /usr/local/go
COPY --from=builder /root/.cache/pypoetry/virtualenvs /root/.cache/pypoetry/virtualenvs

# Add Hugo and Go to the PATH
ENV PATH="/usr/local/hugo:/usr/local/go/bin:${PATH}"

# Run virtual_contributor_engine_guidance.py when the container launches
# Run main.py when the container launches
CMD ["poetry", "run", "python", "main.py"]
4 changes: 2 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def __init__(self):
self.site_url = os.getenv("AI_SOURCE_WEBSITE", "")
self.welcome_site_url = os.getenv("AI_SOURCE_WEBSITE2", "")

self.site_repo = os.getenv("AI_WEBSITE_REPO", "")
self.welcome_site_repo = os.getenv("AI_WEBSITE_REPO2", "")
self.site_repo = f"https://{os.getenv('AI_GITHUB_PAT', '')}@{os.getenv('AI_WEBSITE_REPO', '')}"
self.welcome_site_repo = f"https://{os.getenv('AI_GITHUB_PAT', '')}@{os.getenv('AI_WEBSITE_REPO2', '')}"

self.github_user = os.getenv("AI_GITHUB_USER", "")
self.github_pat = os.getenv("AI_GITHUB_PAT", "")
Expand Down
4 changes: 2 additions & 2 deletions ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def embed_text(documents: list[Document]):

async def ensure_cloned(repo_name: str, path: str):
if os.path.exists(path):
logger.info(f"Repository {repo_name} already cloned.")
logger.info(f"Repository {path} already cloned.")
repo = Repo.init(path)
else:
logger.info(f"Closning repository: {repo_name}")
logger.info(f"Cloning repository: {path}")
repo = Repo.clone_from(repo_name, path, branch="main")

repo.heads.main.checkout()
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "virtual-contributor-engine-guidance"
version = "0.8.1"
version = "0.8.2"
description = "Alkemio Generative AI Guidance Engine"
authors = ["Alkemio BV <[email protected]>"]
license = "EUPL-1.2"
Expand Down
Loading