Skip to content

Commit 3723cf1

Browse files
authored
Updated the Backend's Deployment (#657)
* removed webpack dependency and background_jobs endpoint * removed legacy deployment stuff and began work on new production dockerfile * added building the application to the publish workflow * updated publish workflow to run on push for now * made index.html paths relative * appended tira-frontend to all resource paths in the compiled frontend * set base path explicitly * added tfr-static prefix * added workaround for disraptor * test * rewoked last changes * updated dockerfile of frontend * fixed frontend dockerfile * removed extractRole for fetchUserInfo * removed extractOrganizerTeams * elaborated TODO Comment * fixed typehints * removed unused utils functions * renamed application module to tira_app and updated production container * minor fixes to ci * more configurable TIRA_ROOT and TIRA_CONF * cleaned the settings.py and settings-test.py up a bit * consolidated tira-application-config.*.yml and improved settings.py further * removed src/tira_app/static and fixed TIRA_DEBUG handling * configured TIRE_CONFIG appropriately in CI and dockerfile for make setup * another problem found * dockerfile.prod runs make setup in debug mode * automatic migration; extended configuration via environment variables; fixed a bug in Tasks.vue * fixed python-gitlabto 4.10.0 * added helpful tools to production container * fixed wrong path * fixed django to 5.0.9 * oops * heldenhaft * final deployment adjustments * made django_secret and discourse_api_key configurable via env * updated deployment documentation * uwsgi uses port 8080 * the info endpoint now fetches the actual tira version
1 parent fb66cc7 commit 3723cf1

File tree

144 files changed

+2001
-2049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+2001
-2049
lines changed

.devcontainer/Dockerfile.dev

+6-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ ENV PIP_BREAK_SYSTEM_PACKAGES 1
4545
USER root
4646
RUN apt-get update && apt-get install -y python3 python3-pip python3-dev pkg-config default-libmysqlclient-dev \
4747
libpcre3-dev
48-
# Create a dummy secret
49-
COPY <<EOF /etc/discourse/client-api-key
50-
I am so secret
51-
EOF
48+
49+
# Environment Variables for TIRA Configuration:
50+
ENV TIRA_ROOT=/workspaces/tira/model/src
51+
ENV TIRA_CONFIG=/workspaces/tira/application/config/tira-application-config.yml
52+
ENV TIRA_DEBUG=true
53+
ENV DISCOURSE_API_KEY="I am so secret"
5254

5355
########################################################################################################################
5456
# Client #

.github/workflows/publish.yml

+22-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Publish Docker images
33
on:
44
release:
55
types: [published]
6+
# TODO: The run on push should be removed (or commented out) in the future. It is here only for testing purposes
7+
# while the deployment is WiP
8+
push:
9+
branches:
10+
- updated_backend_deployment
611

712
env:
813
REGISTRY: ghcr.io
@@ -24,7 +29,7 @@ jobs:
2429
username: ${{ github.actor }}
2530
password: ${{ secrets.GITHUB_TOKEN }}
2631
- name: Extract metadata (tags, labels) for Docker
27-
id: meta
32+
id: meta-frontend
2833
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
2934
with:
3035
images: ${{ env.REGISTRY }}/tira-io/tira-frontend
@@ -34,5 +39,19 @@ jobs:
3439
context: ${{ github.workspace }}/frontend
3540
file: ${{ github.workspace }}/frontend/Dockerfile.prod
3641
push: true
37-
tags: ${{ steps.meta.outputs.tags }}
38-
labels: ${{ steps.meta.outputs.labels }}
42+
tags: ${{ steps.meta-frontend.outputs.tags }}
43+
labels: ${{ steps.meta-frontend.outputs.labels }}
44+
45+
- name: Extract metadata (tags, labels) for Docker
46+
id: meta-backend
47+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
48+
with:
49+
images: ${{ env.REGISTRY }}/tira-io/tira-backend
50+
- name: Publish tira-backend image
51+
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
52+
with:
53+
context: ${{ github.workspace }}/
54+
file: ${{ github.workspace }}/application/Dockerfile.prod
55+
push: true
56+
tags: ${{ steps.meta-backend.outputs.tags }}
57+
labels: ${{ steps.meta-backend.outputs.labels }}

.github/workflows/tests.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
timeout-minutes: 15
99
strategy:
1010
matrix:
11-
python-version: ["3.9", "3.10"]
11+
python-version: ["3.11", "3.12"]
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Set up Python ${{ matrix.python-version }}
@@ -20,14 +20,16 @@ jobs:
2020
run: |
2121
# Install tira from the repository since the pip version may not be up-to-date enough.
2222
# The install musst be editable (-e) since importing from tira fails otherwise
23-
pip3 install -e .[dev,test]
23+
pip3 install .[dev,test]
2424
- name: Install dependencies
2525
working-directory: ${{github.workspace}}/application
2626
run: |
27-
# Create a dummy DISRAPTOR_API_KEY
28-
sudo bash -c 'mkdir -p "/etc/discourse/" && echo "I am so secret" > "/etc/discourse/client-api-key"'
29-
pip3 install -e .[dev,test]
27+
pip3 install .[dev,test]
3028
make setup
29+
env:
30+
TIRA_ROOT: ${{github.workspace}}/model/src
31+
TIRA_CONFIG: ${{github.workspace}}/application/config/tira-application-config.yml
32+
DISCOURSE_API_KEY: "I am so secret"
3133
- name: Run backend tests
3234
working-directory: ${{github.workspace}}/application/test
3335
run: pytest

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<a href="https://tira.io">
1515
<img alt="Deployment" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fwww.tira.io%2Finfo&query=%24.version&prefix=v.&label=tira.io"/>
1616
</a>
17-
<a href="https://github.com/tira-io/tira/actions/workflows/run-all-tests.yml">
18-
<img alt="Tests" src="https://github.com/tira-io/tira/actions/workflows/run-all-tests.yml/badge.svg"/>
17+
<a href="https://github.com/tira-io/tira/actions/workflows/tests.yml">
18+
<img alt="Tests" src="https://github.com/tira-io/tira/actions/workflows/tests.yml/badge.svg"/>
1919
</a>
2020
<a href="https://github.com/tira-io/tira/actions/workflows/linters.yml">
2121
<img alt="Linters" src="https://github.com/tira-io/tira/actions/workflows/linters.yml/badge.svg"/>

application/.devcontainer.json

-8
This file was deleted.

0 commit comments

Comments
 (0)