From 0c5a5e3bd126169517777360e24a418dcb610439 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Fri, 17 Jan 2025 08:55:02 +0100 Subject: [PATCH] added issuer-service launcher --- .github/workflows/verify.yaml | 27 ++++++++++++++++- launcher/identityhub/Dockerfile | 1 - launcher/issuer-service/Dockerfile | 25 ++++++++++++++++ launcher/issuer-service/build.gradle.kts | 37 ++++++++++++++++++++++++ settings.gradle.kts | 1 + 5 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 launcher/issuer-service/Dockerfile create mode 100644 launcher/issuer-service/build.gradle.kts diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 5c38c6703..3d5dfc783 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -35,7 +35,7 @@ jobs: - name: Run Javadoc run: ./gradlew javadoc - Verify-Launcher: + Verify-Identityhub-Launcher: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -63,6 +63,31 @@ jobs: container-name: identity-hub timeout: 60 + Verify-Issuer-Service-Launcher: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: eclipse-edc/.github/.github/actions/setup-build@main + + - name: 'Build launcher' + run: ./gradlew :launcher:issuer-service:shadowJar + + - name: 'Build Docker image' + run: docker build -t issuer-service ./launcher/issuer-service + + - name: 'Start Identity Hub' + run: | + docker run -d --rm --name issuer-service \ + -e "EDC_STS_ACCOUNT_API_URL=https://sts.com" \ + -e "EDC_STS_ACCOUNTS_API_AUTH_HEADER_VALUE=auth-header" \ + issuer-service:latest + + - name: 'Wait for Issuer-Service to be healthy' + uses: raschmitt/wait-for-healthy-container@v1 + with: + container-name: issuer-service + timeout: 60 + Test: permissions: checks: write diff --git a/launcher/identityhub/Dockerfile b/launcher/identityhub/Dockerfile index 60fd63c48..dd6995e4f 100644 --- a/launcher/identityhub/Dockerfile +++ b/launcher/identityhub/Dockerfile @@ -22,5 +22,4 @@ HEALTHCHECK --interval=5s --timeout=5s --retries=10 CMD curl --fail http://local # Use "exec" for graceful termination (SIGINT) to reach JVM. # ARG can not be used in ENTRYPOINT so storing value in an ENV variable ENV ENV_JVM_ARGS=$JVM_ARGS -ENV ENV_APPINSIGHTS_AGENT_VERSION=$APPINSIGHTS_AGENT_VERSION ENTRYPOINT [ "sh", "-c", "exec java $ENV_JVM_ARGS -jar identity-hub.jar"] \ No newline at end of file diff --git a/launcher/issuer-service/Dockerfile b/launcher/issuer-service/Dockerfile new file mode 100644 index 000000000..eb1995bdd --- /dev/null +++ b/launcher/issuer-service/Dockerfile @@ -0,0 +1,25 @@ +# -buster is required to have apt available +FROM openjdk:17-slim-buster + +# Optional JVM arguments, such as memory settings +ARG JVM_ARGS="" + +RUN apt update \ + && apt install -y curl \ + && rm -rf /var/cache/apt/archives /var/lib/apt/lists + +WORKDIR /app + +COPY ./build/libs/issuer-service.jar /app + +EXPOSE 8188 + +ENV WEB_HTTP_PORT="8181" +ENV WEB_HTTP_PATH="/api" + +HEALTHCHECK --interval=5s --timeout=5s --retries=10 CMD curl --fail http://localhost:8181/api/check/health + +# Use "exec" for graceful termination (SIGINT) to reach JVM. +# ARG can not be used in ENTRYPOINT so storing value in an ENV variable +ENV ENV_JVM_ARGS=$JVM_ARGS +ENTRYPOINT [ "sh", "-c", "exec java $ENV_JVM_ARGS -jar issuer-service.jar"] \ No newline at end of file diff --git a/launcher/issuer-service/build.gradle.kts b/launcher/issuer-service/build.gradle.kts new file mode 100644 index 000000000..258658c9c --- /dev/null +++ b/launcher/issuer-service/build.gradle.kts @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Microsoft Corporation + * + * 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: + * Amadeus - initial API and implementation + * + */ + +plugins { + `java-library` + id("application") + alias(libs.plugins.shadow) +} + +dependencies { + runtimeOnly(project(":dist:bom:issuerservice-bom")) +} + +application { + mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime") +} + +tasks.withType { + exclude("**/pom.properties", "**/pom.xm") + mergeServiceFiles() + archiveFileName.set("issuer-service.jar") +} + +edcBuild { + publish.set(false) +} diff --git a/settings.gradle.kts b/settings.gradle.kts index ba5281b73..b4dc75931 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -74,6 +74,7 @@ include(":extensions:api:identity-api:validators:verifiable-credential-validator // other modules include(":launcher:identityhub") +include(":launcher:issuer-service") include(":version-catalog") // test modules