Skip to content

Commit

Permalink
feat: replace MIW/keycloak with IdentityHub and STS (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger authored Nov 5, 2024
1 parent 301db7c commit d1abb35
Show file tree
Hide file tree
Showing 148 changed files with 5,147 additions and 8,119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#

---
name: "Run MXD locally"
name: "Run E2E Tests"
on:
workflow_dispatch:
workflow_run:
Expand All @@ -45,6 +45,7 @@ jobs:
with:
config: mxd/kind.config.yaml
cluster_name: mxd

- name: "Install nginx ingress controller"
run: |-
echo "::notice title=nginx ingress on KinD::For details how to run nginx ingress on KinD check https://kind.sigs.k8s.io/docs/user/ingress/#ingress-nginx"
Expand All @@ -56,21 +57,17 @@ jobs:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '22'
java-version: '21'
distribution: 'temurin'
- name: "Backend-Service Build"
working-directory: mxd/backend-service
run: |-
./gradlew clean dockerize
- name: "Custom TractusX EDC Build"
working-directory: custom-tractusx-edc

- name: "Build Runtime Docker Images"
working-directory: mxd-runtimes
run: |-
./gradlew clean dockerize
- name: "Load Docker Images"
run: |-
kind load docker-image -n mxd backend-service:1.0.0
kind load docker-image -n mxd custom-edc-controlplane-postgresql-hashicorp-vault:latest
kind load docker-image -n mxd custom-edc-dataplane-hashicorp-vault:latest
kind load docker-image --name mxd data-service-api tx-identityhub tx-identityhub-sts tx-catalog-server tx-sts
- name: "Terraform init"
working-directory: mxd
run: |-
Expand All @@ -90,8 +87,10 @@ jobs:
curl --fail http://localhost/bob/health/api/check/readiness
curl --fail http://localhost/alice/health/api/check/readiness
- name: "Run Tests"
uses: ./.github/actions/mxd-test-action
- name: "Run E2E Tests"
working-directory: mxd-runtimes
run: |-
./gradlew :e2e-test:test -DrunAllTests=true -PverboseTest=true
- name: "Destroy the KinD cluster"
run: >-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
branches:
- main
paths:
- 'mxd/backend-service/**'
- 'mxd-runtimes/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -33,15 +33,41 @@ concurrency:

jobs:

End-To-End-Tests:
Unit-Tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- run: ./gradlew test
working-directory: mxd/backend-service

- name: Run Unit Tests
working-directory: mxd-runtimes
run: ./gradlew :test

API-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Run API Tests
working-directory: mxd-runtimes
run: ./gradlew -DincludeTags="ApiTest" :test

Component-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Run API Tests
working-directory: mxd-runtimes
run: ./gradlew -DincludeTags="ComponentTest" :test
52 changes: 0 additions & 52 deletions .github/workflows/verify-custom-tractusx-edc.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ terraform.rc

.gradle
build
out/

.idea/
mxd/.terraform.lock.hcl
Expand All @@ -45,4 +46,5 @@ mxd/backend-service/.gradle
.lock
.bin
mxd/backend-service/build
*.log
*.log
/mxd-runtimes/jwt-signer/out/

This file was deleted.

18 changes: 0 additions & 18 deletions custom-tractusx-edc/gradle/libs.versions.toml

This file was deleted.

26 changes: 0 additions & 26 deletions custom-tractusx-edc/settings.gradle.kts

This file was deleted.

File renamed without changes.
File renamed without changes.
51 changes: 51 additions & 0 deletions mxd-runtimes/data-service-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
*
*/



plugins {
id("java")
`java-library`
id("application")
alias(libs.plugins.shadow)
id(libs.plugins.swagger.get().pluginId)
}

group = "org.eclipse.tractusx.mxd.dataservice"
version = "1.0.0"

application {
mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime")
}

dependencies {

implementation(libs.edc.http)
implementation(libs.edc.http.lib)
implementation(libs.edc.boot)

runtimeOnly(libs.edc.core.connector)
runtimeOnly(libs.edc.api.observability)
runtimeOnly(libs.edc.sql.transactionlocal)

testImplementation(testFixtures(libs.edc.core.jersey))
testImplementation(libs.restAssured)
testImplementation(libs.assertj)
testImplementation(libs.edc.junit)

}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
mergeServiceFiles()
archiveFileName.set("${project.name}.jar")
}
44 changes: 44 additions & 0 deletions mxd-runtimes/data-service-api/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
#
#

FROM eclipse-temurin:22.0.1_8-jre-alpine
ARG JAR
ARG ADDITIONAL_FILES

ARG APP_USER=docker
ARG APP_UID=10100

RUN addgroup --system "$APP_USER"

RUN adduser \
--shell /sbin/nologin \
--disabled-password \
--gecos "" \
--ingroup "$APP_USER" \
--no-create-home \
--uid "$APP_UID" \
"$APP_USER"

USER "$APP_USER"
WORKDIR /app

COPY ${JAR} data-service.jar

# health check is handled by K8S
HEALTHCHECK NONE

CMD ["java", \
"-Djava.security.egd=file:/dev/urandom", \
"-jar", \
"data-service.jar"]
Loading

0 comments on commit d1abb35

Please sign in to comment.