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.1 #63

Merged
merged 14 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 13 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
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy-k8s-dev-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- uses: Azure/[email protected]
with:
manifests: |
manifests/25-genai-deployment-dev.yaml
manifests/25-virtual-contributor-engine-guidance-deployment-dev.yaml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}
imagepullsecrets: |
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/build-deploy-k8s-dev-hetzner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build, Migrate & Deploy to Dev on Hetzner

on:
push:
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/[email protected]

- name: "Login into ACR"
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: "Build & Push image"
run: |
docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}

deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/[email protected]

- name: Install Kubectl
uses: azure/[email protected]
with:
version: "v1.27.6" # Ensure this matches the version used in your cluster

- name: Set up Kubeconfig for Hetzner k3s
run: |
mkdir -p $HOME/.kube # Ensure the .kube directory exists
echo "${{ secrets.KUBECONFIG_SECRET_HETZNER_DEV }}" > $HOME/.kube/config
chmod 600 $HOME/.kube/config

- name: Create Image Pull Secret
run: |
kubectl create secret docker-registry alkemio-virtual-contributor-engine-guidance-secret \
--docker-server=${{ secrets.REGISTRY_LOGIN_SERVER }} \
--docker-username=${{ secrets.REGISTRY_USERNAME }} \
--docker-password=${{ secrets.REGISTRY_PASSWORD }} \
--dry-run=client -o yaml | kubectl apply -f -

- uses: azure/[email protected]
with:
manifests: |
manifests/25-virtual-contributor-engine-guidance-deployment-dev.yaml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}
imagepullsecrets: |
alkemio-virtual-contributor-engine-guidance-secret
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy-k8s-sandbox-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: Azure/[email protected]
with:
manifests: |
manifests/25-genai-deployment-dev.yaml
manifests/25-virtual-contributor-engine-guidance-deployment-dev.yaml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}
imagepullsecrets: |
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build-deploy-k8s-sandbox-hetzner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build, Migrate & Deploy to Test on Hetzner

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/[email protected]

- name: "Login into ACR"
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: "Build & Push image"
run: |
docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}

deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/[email protected]

- name: Install Kubectl
uses: azure/[email protected]
with:
version: "v1.27.6" # Ensure this matches the version used in your cluster

- name: Set up Kubeconfig for Hetzner k3s
run: |
mkdir -p $HOME/.kube # Ensure the .kube directory exists
echo "${{ secrets.KUBECONFIG_SECRET_HETZNER_SANDBOX }}" > $HOME/.kube/config
chmod 600 $HOME/.kube/config

- name: Create Image Pull Secret
run: |
kubectl create secret docker-registry alkemio-virtual-contributor-engine-guidance-secret \
--docker-server=${{ secrets.REGISTRY_LOGIN_SERVER }} \
--docker-username=${{ secrets.REGISTRY_USERNAME }} \
--docker-password=${{ secrets.REGISTRY_PASSWORD }} \
--dry-run=client -o yaml | kubectl apply -f -

- uses: azure/[email protected]
with:
manifests: |
manifests/25-virtual-contributor-engine-guidance-deployment-dev.yaml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}
imagepullsecrets: |
alkemio-virtual-contributor-engine-guidance-secret
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy-k8s-test-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: Azure/[email protected]
with:
manifests: |
manifests/25-genai-deployment-dev.yaml
manifests/25-virtual-contributor-engine-guidance-deployment-dev.yaml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}
imagepullsecrets: |
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build-deploy-k8s-test-hetzner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build, Migrate & Deploy to Test on Hetzner

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/[email protected]

- name: "Login into ACR"
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: "Build & Push image"
run: |
docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}

deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/[email protected]

- name: Install Kubectl
uses: azure/[email protected]
with:
version: "v1.27.6" # Ensure this matches the version used in your cluster

- name: Set up Kubeconfig for Hetzner k3s
run: |
mkdir -p $HOME/.kube # Ensure the .kube directory exists
echo "${{ secrets.KUBECONFIG_SECRET_HETZNER_TEST }}" > $HOME/.kube/config
chmod 600 $HOME/.kube/config

- name: Create Image Pull Secret
run: |
kubectl create secret docker-registry alkemio-virtual-contributor-engine-guidance-secret \
--docker-server=${{ secrets.REGISTRY_LOGIN_SERVER }} \
--docker-username=${{ secrets.REGISTRY_USERNAME }} \
--docker-password=${{ secrets.REGISTRY_PASSWORD }} \
--dry-run=client -o yaml | kubectl apply -f -

- uses: azure/[email protected]
with:
manifests: |
manifests/25-virtual-contributor-engine-guidance-deployment-dev.yaml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-virtual-contributor-engine-guidance:${{ github.sha }}
imagepullsecrets: |
alkemio-virtual-contributor-engine-guidance-secret
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ azure.env
local.env
docker-compose-local.yaml
.DS_Store
*.log
repos
repos/*
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use an official Python runtime as a parent image
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION}-slim-bullseye as builder
FROM python:${PYTHON_VERSION}-slim-bullseye AS builder

# Set the working directory in the container to /app
WORKDIR /app
Expand All @@ -10,7 +10,7 @@ ARG HUGO_VERSION=0.121.2
ARG TARGETARCH

# install git, go and hugo
RUN apt update && apt upgrade -y && apt install -y git wget
RUN apt update && apt upgrade -y && apt install -y git wget
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
Expand Down Expand Up @@ -43,4 +43,4 @@ COPY --from=builder /root/.cache/pypoetry/virtualenvs /root/.cache/pypoetry/virt
ENV PATH="/usr/local/hugo:/usr/local/go/bin:${PATH}"

# Run virtual_contributor_engine_guidance.py when the container launches
CMD ["poetry", "run", "python", "virtual_contributor_engine_guidance.py"]
CMD ["poetry", "run", "python", "main.py"]
Loading
Loading