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

feat(infrastructure): add infrastructure #1

Merged
merged 7 commits into from
Aug 27, 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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ruigomes99
20 changes: 20 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7

- name: Release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 #v2.0.8
with:
prerelease: ${{ contains(github.ref, '-alpha') }}
generate_release_notes: true
token: ${{ secrets.ACTION_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests

on:
pull_request:
branches: [master, main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Verify Docker Compose installation
run: docker-compose --version

- name: Run Development Docker Compose
run: docker-compose up -d
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uploads
427 changes: 427 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Run Docker Compose to build and start services
docker-compose:
docker-compose up --build

# Run Docker Compose in detached mode (background)
docker-compose-d:
docker-compose up --build -d
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
# component-core
<div align="center">
<a href="https://www.eng.uminho.pt" target="_blank"><img src="https://i.imgur.com/mOynow9.png" alt="Engineering School"/></a>
<a href="https://www.uminho.pt" target="_blank"><img src="https://i.imgur.com/1gtSAGM.png" alt="University Of Minho"/></a>
<br/>
<a href="http://www.dsi.uminho.pt" target="_blank">
<strong>Information Systems Department</strong>
</a>
<br/>
<br/>
<a href="https://github.com/ABI-Deployment-Thesis/component-core/actions"><img alt="Tests Status" src="https://github.com/ABI-Deployment-Thesis/component-core/actions/workflows/tests.yaml/badge.svg"></a>
<a href="https://github.com/ABI-Deployment-Thesis/component-core/releases"><img alt="GitHub Release" src="https://img.shields.io/github/v/release/ABI-Deployment-Thesis/component-core"></a>
<a href="https://github.com/ABI-Deployment-Thesis/component-core/blob/main/LICENSE"><img alt="GitHub License" src="https://img.shields.io/github/license/ABI-Deployment-Thesis/component-core"></a>
</div>

<h2 align="center">ABI Deployment Thesis - Component Core</h2>

Welcome to the component-core repository! This project is a key part of a master's thesis at the University of Minho. It's a Proof of Concept for a proposed architecture designed to deploy and integrate intelligent models within Adaptive Business Intelligence (ABI) systems.

**This repository provides the infrastructure for automating the deployment and execution of the PoC.**

For a detailed explanation of the proposed architecture and its deployment strategy, please refer to the published article: [Architecture proposal for deploying and integrating intelligent models in ABI](https://www.sciencedirect.com/science/article/pii/S1877050923022445).

## Setup

- [Install Docker Enginne](https://docs.docker.com/engine/install/)
- [Configure remote access for Docker daemon](https://docs.docker.com/engine/daemon/remote-access/)

## Quick Start

1. Clone the repository:
```shell
git clone https://github.com/ABI-Deployment-Thesis/component-core.git
```
2. Change directory:
```shell
cd component-core
```
3. Start docker compose:
```shell
docker-compose up --build -d
```
4. View the web app at: http://localhost:8080
- Use the default admin credentials (ID: 66c8d271f5b68d63c5a232c1):
- Email: [email protected]
- Password: admin
- For testing, you can use our [healthcare-models](https://github.com/ABI-Deployment-Thesis/healthcare-models) repository

## Author

- Rui Gomes ([LinkedIn](https://www.linkedin.com/in/ruigomes99))

## License

- [CC BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)
132 changes: 132 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
version: '3.9'

services:
# MongoDB service
mongo_db:
container_name: core_db
image: mongo@sha256:3b120f4dd854327f26ec51511e109be61f8f21329a53efa3646aa9212b8266d3 #7.0.14-rc0
restart: always
ports:
- 27017:27017
volumes:
- mongo_db:/data/db

# RabbitMQ service
rabbitmq:
image: rabbitmq@sha256:611107e29cce05c2acd968325d5dcbde7e2fee404970f1ead75fdb22be2821b3 #3.13.6-management-alpine
container_name: 'rabbitmq'
ports:
- "5672:5672"
- "15672:15672" # RabbitMQ Management UI
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
volumes:
- rabbitmq_data:/var/lib/rabbitmq

# Node Access Cotrol service
access_control:
image: ghcr.io/abi-deployment-thesis/access-control@sha256:db81bc06a9d846def9d5a6cc94bc3e4e35bbb14824d71480572a8f63db61f5f6 #v1.0.0
ports:
- 3001:3001
environment:
HTTP_PORT: 3001
MONGO_DB_URL: mongodb://core_db:27017/AccessControl?retryWrites=true&w=majority
BCRYPT_SALT: 10
JWT_SESSION_PASS: password
deploy:
resources:
limits:
cpus: "0.5"
memory: "256M"
depends_on:
- mongo_db

# Node Model Management service
model_management:
image: ghcr.io/abi-deployment-thesis/model-management@sha256:a87059ddb39e2a5704faeac22000f97c1011155686e7c4665b6f3a9ade9974ed #v1.0.0
ports:
- 3002:3002
environment:
HTTP_PORT: 3002
GRPC_PORT: 50052
MONGO_DB_URL: mongodb://core_db:27017/ModelManagement?retryWrites=true&w=majority
JWT_SESSION_PASS: password
STORAGE_URL: /uploads
deploy:
resources:
limits:
cpus: "0.5"
memory: "256M"
depends_on:
- mongo_db
volumes:
- ./uploads:/uploads

# Node Model Runner service
model_runner:
image: ghcr.io/abi-deployment-thesis/model-runner@sha256:f8512e4bd25a2361dbc3d84f924acc9880fbb2780212c7e2014bc0ec06ae4381 #v1.0.0
ports:
- 3003:3003
environment:
HTTP_PORT: 3003
GRPC_PORT: 50053
GRPC_MODEL_MGMT_HOST: model_management:50052
HTTP_MODEL_MGMT_HOST: model_management:3002
GRPC_STABLE: "false"
RABBITMQ_HOST: rabbitmq
RABBITMQ_DOCKER_ENGINE_QUEUE: docker_queue
MONGO_DB_URL: mongodb://core_db:27017/ModelRunner?retryWrites=true&w=majority
JWT_SESSION_PASS: password
STORAGE_URL: /uploads
deploy:
resources:
limits:
cpus: "0.5"
memory: "256M"
depends_on:
- mongo_db
- rabbitmq
- model_management
volumes:
- ./uploads:/uploads

# Python Docker Engine service
docker_engine:
image: ghcr.io/abi-deployment-thesis/docker-engine@sha256:240fdf5a717db5287eaf2f11ef5ecea3774737c137ce27f21ea14dfd7746d984 #v1.0.0
environment:
GRPC_MODEL_RUNNER_HOST: model_runner:50053
RABBITMQ_HOST: rabbitmq
RABBITMQ_QUEUE: docker_queue
DOCKER_HOST: tcp://host.docker.internal:2375
DOCKER_TAG: docker-engine
CONTAINER_PREFIX: run_
deploy:
resources:
limits:
cpus: "0.5"
memory: "256M"
depends_on:
- rabbitmq
- model_runner
volumes:
- ./uploads:/uploads

# Node ABI Deployment Webapp service
abi-deployment-webapp:
image: ghcr.io/abi-deployment-thesis/abi-deployment-webapp@sha256:4435d1d92cc5f602f037f81b411ac29dbd9aa5d3dc41ae6e4189702ebe6c080b #v1.0.0
ports:
- 8080:80
deploy:
resources:
limits:
cpus: "0.5"
memory: "256M"
depends_on:
- access_control
- model_management
- model_runner

volumes:
mongo_db: {}
rabbitmq_data: