Skip to content

Commit 9eb3af2

Browse files
authored
Merge branch 'main' into frontend
2 parents 22d9d45 + fb81d35 commit 9eb3af2

File tree

91 files changed

+1781
-448
lines changed

Some content is hidden

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

91 files changed

+1781
-448
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Backend Development
2+
3+
on:
4+
push:
5+
branches: [ "backend" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Django tests
13+
runs-on: ubuntu-latest
14+
strategy:
15+
max-parallel: 4
16+
matrix:
17+
python-version: [3.12, 3.13]
18+
defaults:
19+
run:
20+
working-directory: ./backend
21+
steps:
22+
- uses: actions/checkout@v4
23+
- run: cat .env.github >> $GITHUB_ENV
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install Dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
- name: Run Tests
33+
run: |
34+
python manage.py collectstatic
35+
python manage.py test

.github/workflows/frontend-development.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ jobs:
8484
npm config list
8585
npm install --omit=dev
8686
# npx webpack
87-
npm run build
87+
npm run build

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ __pycache__
66
# Backend files and folders
77

88
# Old fixtures
9-
**/fixtures/2024-11-0*.json
10-
**/fixtures/2024-11-1*.json
9+
**/fixtures/2024*.json
1110

1211
# Frontend files and folders
1312
build

application-quality-reference-deployment/values.yaml

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@ global:
1818
application-quality:
1919
# Values for deploying the Application Quality Building Block in the EOEPCA Develop cluster.
2020

21+
publicUrl: "https://application-quality.develop.eoepca.org"
22+
2123
namespace:
2224
application-quality
2325

2426
# Application Quality backend
2527
api:
2628
image:
27-
tag: 2025-01-10.1
29+
tag: 2025-04-07.1
2830

2931
# Application Quality frontend
3032
web:
3133
image:
32-
tag: 2025-01-15.1
34+
tag: 2025-04-07.2
35+
publicUrl: "https://application-quality.develop.eoepca.org"
3336

3437
persistence:
3538
enabled: true
@@ -46,7 +49,8 @@ application-quality:
4649
maxCores: "2"
4750
maxRam: "2Gi"
4851

49-
#db:
52+
vclusters:
53+
enabled: false
5054

5155
opensearch:
5256
enabled: false
@@ -454,24 +458,20 @@ opensearch-dashboards:
454458

455459
opensearch_security:
456460
# https://opensearch.org/docs/latest/security/authentication-backends/openid-connect/#configuration-settings
457-
#auth.multiple_auth_enabled: true
458-
#auth.type: ["basicauth", "openid"]
459-
auth.type: basicauth
460-
#auth.type: openid
461-
462-
# openid:
463-
# connect_url: https://auth.eoepca-testing.spaceapplications.com/realms/eoepca/.well-known/openid-configuration
464-
# base_redirect_url: https://application-quality.develop.eoepca.org/dashboards/
465-
# client_id: application-quality-develop-dashboards
466-
# client_secret: 2Oz8olwAgHD5oRuEmtFsYsnrdkeWEAln
467-
# # scope: openid profile email
468-
# scope: openid roles profile user_name email
469-
# header: Authorization
470-
# verify_hostnames: false
471-
# #root_ca: /usr/share/dashboards/root-ca/root.ca.crt
472-
# #root_ca: /etc/ssl/certs/ca-certificates.crt
473-
# #root_ca: /usr/share/opensearch-dashboards/certs/ca.crt
474-
# trust_dynamic_headers: "true"
461+
auth.multiple_auth_enabled: true
462+
auth.type: ["basicauth", "openid"]
463+
464+
openid:
465+
# OIDC parameters provided using environment variables
466+
connect_url: ${OPENSEARCH_SECURITY_OPENID_CONNECT_URL}
467+
client_id: ${OPENSEARCH_SECURITY_OPENID_CLIENT_ID}
468+
client_secret: ${OPENSEARCH_SECURITY_OPENID_CLIENT_SECRET}
469+
base_redirect_url: ${OPENSEARCH_SECURITY_OPENID_BASE_REDIRECT_URL}
470+
# scope: openid profile email
471+
scope: openid roles profile user_name email
472+
header: Authorization
473+
verify_hostnames: false
474+
trust_dynamic_headers: "true"
475475

476476
opensearchDashboards:
477477
# The default application to load.
@@ -511,6 +511,13 @@ opensearch-dashboards:
511511
disableWelcomeScreen: false
512512
disableNewThemeModal: false
513513

514+
# Load environment variables from kubernetes secret or config map
515+
envFrom:
516+
- secretRef:
517+
name: application-quality-opensearch-dashboards-openid-config
518+
# - configMapRef:
519+
# name: application-quality-opensearch-dashboards-openid-config
520+
514521
secretMounts:
515522
- name: certs
516523
secretName: opensearch-dashboards-tls-certificate

backend/.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
**/__pycache__
33

44
# old fixtures
5-
**/fixtures/2024-11-0*.json
6-
**/fixtures/2024-11-1*.json
5+
**/fixtures/2024*.json

backend/.env.github

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
OIDC_ENABLED=false
2+
PUBLIC_URL=http://host

backend/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
FROM python:slim
1+
FROM python:3.13.3-slim
22

33
WORKDIR /app
44

55
COPY requirements.txt .
66

77
RUN apt-get update \
8-
&& apt-get install -y gcc libpq-dev postgresql-client redis-server supervisor \
8+
&& apt-get install -y gcc libpq-dev postgresql-client redis-server supervisor curl \
9+
&& curl -fSLo /usr/local/bin/kubectl https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl \
10+
&& chmod +x /usr/local/bin/kubectl \
11+
&& curl -fSLo /usr/local/bin/vcluster https://github.com/loft-sh/vcluster/releases/download/v0.24.1/vcluster-linux-amd64 \
12+
&& chmod +x /usr/local/bin/vcluster \
913
&& rm -rf /var/lib/apt/lists/* \
1014
&& pip install --no-cache-dir -r requirements.txt
1115

backend/application_quality/settings.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
https://docs.djangoproject.com/en/5.1/ref/settings/
1111
"""
1212
import os
13+
import sys
1314

1415
from pathlib import Path
1516

@@ -127,6 +128,9 @@
127128
}
128129
}
129130

131+
if 'test' in sys.argv:
132+
DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3'}
133+
130134

131135
# Password validation
132136
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
@@ -177,6 +181,7 @@
177181
"DEFAULT_AUTHENTICATION_CLASSES": [
178182
"rest_framework.authentication.SessionAuthentication",
179183
"rest_framework.authentication.TokenAuthentication",
184+
'rest_framework_simplejwt.authentication.JWTAuthentication',
180185
],
181186
#'DEFAULT_PERMISSION_CLASSES': [
182187
# 'rest_framework.permissions.AllowAny',
@@ -190,7 +195,7 @@
190195
CELERY_WORKER_REDIRECT_STDOUTS = False
191196

192197
# OpenID Connect configuration
193-
OIDC_ENABLED = os.getenv("OIDC_ENABLED")
198+
OIDC_ENABLED = os.getenv("OIDC_ENABLED", 'false')
194199
if OIDC_ENABLED.lower() == "true":
195200
OIDC_CONNECT_CONFIG_URL = os.getenv("OIDC_CONNECT_CONFIG_URL")
196201
OIDC_RP_CLIENT_ID = os.getenv("OIDC_RP_CLIENT_ID")
@@ -221,12 +226,10 @@
221226

222227

223228
CORS_ORIGIN_ALLOW_ALL = True
224-
CORS_ALLOWED_ORIGINS = [
225-
os.getenv("LOGIN_REDIRECT_URL").strip("/"), # Frontend URL
226-
]
229+
CORS_ALLOWED_ORIGINS = [os.getenv("PUBLIC_URL")] # Frontend URL
227230

228231
CORS_ALLOW_HEADERS = "*"
229232

230233
#CSRF_COOKIE_SECURE = False
231234
#CSRF_USE_SESSIONS = True
232-
CSRF_TRUSTED_ORIGINS = [os.getenv("LOGIN_REDIRECT_URL").strip("/")] # (Api Base Url)
235+
CSRF_TRUSTED_ORIGINS = [os.getenv("PUBLIC_URL")] # (Api Base Url)

backend/application_quality/urls.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414
1. Import the include() function: from django.urls import include, path
1515
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1616
"""
17+
1718
import os
1819

1920
from django.contrib import admin
2021
from django.contrib.auth.views import LoginView, LogoutView
2122
from django.urls import path, include
22-
from rest_framework.authtoken.views import ObtainAuthToken
23+
from rest_framework_simplejwt.views import (
24+
TokenObtainPairView,
25+
TokenRefreshView,
26+
)
2327

2428
from application_quality.views import user_details
2529

@@ -28,9 +32,10 @@
2832
path("api/", include("backend.urls")),
2933
path("login/", LoginView.as_view(), name="login"),
3034
path("logout/", LogoutView.as_view(), name="logout"),
31-
path("api/token-auth/", ObtainAuthToken.as_view(), name="token-auth"),
35+
path("api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
36+
path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
3237
]
3338

34-
if os.getenv("OIDC_ENABLED").lower() == "true":
39+
if os.getenv("OIDC_ENABLED", "false").lower() == "true":
3540
urlpatterns.append(path("oidc/", include("mozilla_django_oidc.urls")))
3641
urlpatterns.append(path("oidc/user-details/", user_details, name="user_details"))

backend/backend/admin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
admin.site.register(models.Pipeline)
55
admin.site.register(models.PipelineRun)
66
admin.site.register(models.JobReport)
7-
# admin.site.register(models.Tool)
87
admin.site.register(models.Tag)
98
admin.site.register(models.Subworkflow)
109
admin.site.register(models.CommandLineTool)

0 commit comments

Comments
 (0)