Skip to content

Commit

Permalink
Merge pull request #63 from alkem-io/develop
Browse files Browse the repository at this point in the history
Release v0.8.1
  • Loading branch information
valentinyanakiev authored Dec 4, 2024
2 parents 07411b9 + a419ecd commit c50ba72
Show file tree
Hide file tree
Showing 18 changed files with 2,574 additions and 1,858 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Migrate & Deploy to Dev
name: Build, Migrate & Deploy to Dev on Hetzner

on:
push:
Expand All @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.7

- name: "Login into ACR"
uses: azure/docker-login@v1.0.1
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
Expand All @@ -27,34 +27,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.7

- name: "Login via Azure CLI"
uses: azure/[email protected]
- name: Install Kubectl
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CRED_K8S_NEW }}
version: "v1.27.6" # Ensure this matches the version used in your cluster

- uses: Azure/[email protected]
with:
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP_K8S }}

- uses: Azure/[email protected]
with:
container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }}
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
secret-name: alkemio-virtual-contributor-engine-guidance-secret
- 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
- uses: azure/[email protected]
with:
version: "v1.22.0" # default is latest stable, fixing it to a compatible version
id: install
- 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/k8s-deploy@v4.10
- uses: azure/k8s-deploy@v5.0.0
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Migrate & Deploy to Sandbox on Azure
name: Build, Migrate & Deploy to Test on Hetzner

on:
workflow_dispatch:
Expand All @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.7

- name: "Login into ACR"
uses: azure/docker-login@v1.0.1
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
Expand All @@ -21,38 +21,36 @@ jobs:
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: "Login via Azure CLI"
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CRED_K8S_NEW }}
uses: actions/[email protected]

- uses: Azure/[email protected]
- name: Install Kubectl
uses: azure/[email protected]
with:
cluster-name: k8s-sandbox
resource-group: res-grp-k8s-sandbox
version: "v1.27.6" # Ensure this matches the version used in your cluster

- uses: Azure/[email protected]
with:
container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }}
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
secret-name: alkemio-virtual-contributor-engine-guidance-secret
- 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
- uses: azure/[email protected]
with:
version: "v1.22.0" # default is latest stable, fixing it to a compatible version
id: install
- 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/k8s-deploy@v4.10
- uses: azure/k8s-deploy@v5.0.0
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Migrate & Deploy to Test on Azure
name: Build, Migrate & Deploy to Test on Hetzner

on:
workflow_dispatch:
Expand All @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.7

- name: "Login into ACR"
uses: azure/docker-login@v1.0.1
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
Expand All @@ -26,34 +26,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4.1.7

- name: "Login via Azure CLI"
uses: azure/[email protected]
- name: Install Kubectl
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CRED_K8S_NEW }}
version: "v1.27.6" # Ensure this matches the version used in your cluster

- uses: Azure/[email protected]
with:
cluster-name: k8s-test
resource-group: res-grp-k8s-test

- uses: Azure/[email protected]
with:
container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }}
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
secret-name: alkemio-virtual-contributor-engine-guidance-secret
- 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
- uses: azure/[email protected]
with:
version: "v1.22.0" # default is latest stable, fixing it to a compatible version
id: install
- 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/k8s-deploy@v4.10
- uses: azure/k8s-deploy@v5.0.0
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
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

0 comments on commit c50ba72

Please sign in to comment.