Skip to content

Commit

Permalink
Merge pull request #1 from StartUpNationLabs/fix-ci
Browse files Browse the repository at this point in the history
Fix ci
  • Loading branch information
Tsukoyachi authored Oct 13, 2024
2 parents 817327d + ba3b5b2 commit 30b460f
Show file tree
Hide file tree
Showing 44 changed files with 1,244 additions and 71 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/CI-backend.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/docker-build-alert.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI-backend

on:
push:
branches:
- main
- fix-ci

permissions: write-all

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: downcase REPO name as output
id: downcase
run: |
echo "::set-output name=downcase::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
- name: Build and push api image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
context: cloud/backend
file: cloud/backend/alert-management/src/main/docker/Dockerfile.multistage
tags: ghcr.io/${{ steps.downcase.outputs.downcase }}/alert-management:${{ github.sha }}, ghcr.io/${{ steps.downcase.outputs.downcase }}/alert-management:${{ github.ref_name }}

45 changes: 45 additions & 0 deletions .github/workflows/docker-build-gateway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Docker Build and Push Gateway Images
on:
push:
branches:
- main
- fix-ci

permissions: write-all

jobs:
build-push-gateway:
runs-on: ubuntu-latest
strategy:
matrix:
application: [adapter, dataManager, AlerteDetector]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: downcase REPO name as output
id: downcase
run: |
echo "::set-output name=downcase::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
- name: downcase APPLICATION name as output
id: downcase-application
run: |
echo "::set-output name=downcase::$(echo ${{ matrix.application }} | tr '[:upper:]' '[:lower:]')"
- name: Build and push api image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
context: gateway/${{ matrix.application }}
tags: ghcr.io/${{ steps.downcase.outputs.downcase }}/gateway-${{ steps.downcase-application.outputs.downcase }}:${{ github.sha }}, ghcr.io/${{ steps.downcase.outputs.downcase }}/gateway-${{ steps.downcase-application.outputs.downcase }}:${{ github.ref_name }}

39 changes: 39 additions & 0 deletions .github/workflows/docker-build-patient.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI-backend

on:
push:
branches:
- main
- fix-ci

permissions: write-all

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: downcase REPO name as output
id: downcase
run: |
echo "::set-output name=downcase::$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
- name: Build and push api image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
context: cloud/backend
file: cloud/backend/patient-management/src/main/docker/Dockerfile.multistage
tags: ghcr.io/${{ steps.downcase.outputs.downcase }}/patient-management:${{ github.sha }}, ghcr.io/${{ steps.downcase.outputs.downcase }}/patient-management:${{ github.ref_name }}

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Create Kind cluster
```bash
kind create cluster --config kind-config.yaml
kind create cluster --config kind-cluster.yaml
```

### Install Manifests
Expand All @@ -14,5 +14,5 @@ NB: The command will fail on the first run because the crds are not yet created.

### Add the following entries to /etc/hosts
```bash
127.0.0.1 keycloak.al.apoorva64.com prometheus.al.apoorva64.com grafana.al.apoorva64.com
127.0.0.1 keycloak.al.apoorva64.com prometheus.al.apoorva64.com grafana.al.apoorva64.com patient-management.al.apoorva64.com alert-management.al.apoorva64.com
```
1 change: 0 additions & 1 deletion cloud/backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*
!target/*-runner
!target/*-runner.jar
!target/lib/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# configure the mongoDB client for a single instance on localhost
quarkus.mongodb.connection-string=${DB_URL:mongodb://localhost:27017}
quarkus.mongodb.database=${DB_NAME:poulet}
# Enable keycloak authentication
quarkus.oidc.auth-server-url=${AUTH_SERVER_URL:http://localhost:8081/realms/poulet-realm}
quarkus.oidc.client-id=${CLIENT_ID:backend-service}
quarkus.oidc.credentials.secret=${CLIENT_SECRET:J1jZPePtgzG4Q9ltZTHlBGKEyj93P4hd}
quarkus.oidc.application-type=web-app
# Docker build properties
quarkus.container-image.registry=ghcr.io

quarkus.http.port=8083
quarkus.metric.enabled=true

Expand Down
1 change: 0 additions & 1 deletion cloud/backend/alert-management/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*
!target/*-runner
!target/*-runner.jar
!target/lib/*
Expand Down
30 changes: 30 additions & 0 deletions cloud/backend/alert-management/manifests/base/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: alert-management
name: alert-management
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: alert-management
template:
metadata:
labels:
io.kompose.service: alert-management
spec:
containers:
- image: ghcr.io/startupnationlabs/poulet/alert-management:e3911b5eaa38b49c29022ad6c7e83d45884a7f32
name: alert-management
ports:
- containerPort: 8080
protocol: TCP
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "512Mi"
restartPolicy: Always
24 changes: 24 additions & 0 deletions cloud/backend/alert-management/manifests/base/ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-alert-management
annotations:
kubernetes.io/ingress.class: traefik
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd
spec:
rules:
- host: alert-management.al.polytech.apoorva64.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: alert-management
port:
number: 8080
tls:
- hosts:
- alert-management.al.polytech.apoorva64.com
secretName: alert-management.al.polytech.apoorva64-tls
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1

kind: Kustomization
resources:
- deployment.yml
- ingress.yml
- service.yml
13 changes: 13 additions & 0 deletions cloud/backend/alert-management/manifests/base/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
labels:
io.kompose.service: alert-management
name: alert-management
spec:
ports:
- name: "8080"
port: 8080
targetPort: 8080
selector:
io.kompose.service: alert-management
Loading

0 comments on commit 30b460f

Please sign in to comment.