summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-04-04 17:00:31 +0200
committerGitHub <noreply@github.com>2022-04-04 17:00:31 +0200
commit38769373c7e89783d33849283586bfa0b62e8251 (patch)
tree4fda128ee6b30018c1aa14c584cc53ade80e67f7 /.github
parent6021aa4278bebb34bf5603ead4b5daeabcdc4c19 (diff)
parent527ae2230f5c2dd22f496f45d5d8e3bd4acdb854 (diff)
merge: Migrate to Quarkus-based web API
This pull request changes the web API to a Quarkus-based version. Currently, the OpenDC web API is written in Python (using Flask). Although Python is a powerful language to develop web services, having another language next to Kotlin/Java and JavaScript introduces some challenges. For instance, the web API and UI lack integration with our Gradle-based build pipeline and require additional steps from the developer to start working with. Furthermore, deploying OpenDC requires having Python installed in addition to the JVM. By converting the web API into a Quarkus application, we can enjoy further integration with our Gradle-based build pipeline and simplify the development/deployment process of OpenDC, by requiring only the JVM and Node to work with OpenDC. ## Implementation Notes :hammer_and_pick: * Move build dependencies into version catalog * Design unified communication protocol * Add Quarkus API implementation * Add new web client implementation * Update runner to use new web client * Fix compatibility with React.js UI * Remove Python build steps from CI pipeline * Update Docker deployment for new web API * Remove obsolete database configuration ## External Dependencies :four_leaf_clover: * Quarkus ## Breaking API Changes :warning: * The new web API only supports SQL-based databases for storing user-data, as opposed to MongoDB currently. We intend to use H2 for development and Postgres for production.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml40
-rw-r--r--.github/workflows/publish.yml9
2 files changed, 3 insertions, 46 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index becbbbed..bc30d584 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -55,45 +55,7 @@ jobs:
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- files: ./build/reports/jacoco/report.xml
- flags: simulator
- build-api:
- name: Build API (Python ${{ matrix.python }})
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- python: [3.9]
- defaults:
- run:
- working-directory: opendc-web/opendc-web-api
- steps:
- - uses: actions/checkout@v3
- - name: Set up Python
- uses: actions/setup-python@v3
- with:
- python-version: ${{ matrix.python }}
- - name: Install dependencies
- run: |
- python -m pip install --upgrade pip
- pip install -r requirements.txt
- - name: Lint with pylint
- run: ./check.sh
- - name: Test with pytest
- run: pytest --cov --cov-report=xml --junitxml=junit-report.xml
- - name: Publish report
- if: always()
- uses: mikepenz/action-junit-report@v3.0.1
- with:
- check_name: test (Python ${{ matrix.python }})
- report_paths: '**/junit-report.xml'
- github_token: ${{ secrets.GITHUB_TOKEN }}
- - name: Upload code coverage
- uses: codecov/codecov-action@v2
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- files: opendc-web/opendc-web-api/coverage.xml
- flags: api
+ files: ./build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml
build-ui:
name: Build UI (Node ${{ matrix.node }})
runs-on: ${{ matrix.os }}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 479b94f2..4e386603 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -9,8 +9,6 @@ jobs:
name: Push Simulator
runs-on: ubuntu-latest
steps:
- - name: Check out the repo
- uses: actions/checkout@v3
- name: Prepare
id: prep
run: |
@@ -30,14 +28,13 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
+ file: opendc-web/opendc-web-runner/Dockerfile
repository: atlargeresearch/opendc
tags: ${{ steps.prep.outputs.tags }}
push-api:
name: Push API
runs-on: ubuntu-latest
steps:
- - name: Check out the repo
- uses: actions/checkout@v3
- name: Prepare
id: prep
run: |
@@ -57,15 +54,13 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
- context: opendc-web/opendc-web-api
+ file: opendc-web/opendc-web-api/Dockerfile
repository: atlargeresearch/opendc-web-api
tags: ${{ steps.prep.outputs.tags }}
push-ui:
name: Push UI
runs-on: ubuntu-latest
steps:
- - name: Check out the repo
- uses: actions/checkout@v3
- name: Prepare
id: prep
run: |