Skip to content

Commit

Permalink
Add edc-controlplane-memory-hashicorp-vault
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Neuling <[email protected]>
  • Loading branch information
denisneuling committed Nov 30, 2022
1 parent 3defbc0 commit 8afc4cd
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ jobs:
matrix:
name:
- edc-controlplane-memory
- edc-controlplane-memory-hashicorp-vault
- edc-controlplane-postgresql
- edc-controlplane-postgresql-hashicorp-vault
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
matrix:
image:
- edc-controlplane-memory
- edc-controlplane-memory-hashicorp-vault
- edc-controlplane-postgresql
- edc-controlplane-postgresql-hashicorp-vault
- edc-dataplane-azure-vault
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/veracode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
matrix:
name:
- edc-controlplane-memory
- edc-controlplane-memory-hashicorp-vault
- edc-controlplane-postgresql
- edc-controlplane-postgresql-hashicorp-vault
steps:
Expand Down
4 changes: 4 additions & 0 deletions edc-controlplane/edc-controlplane-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
<groupId>org.eclipse.dataspaceconnector</groupId>
<artifactId>data-plane-selector-spi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.dataspaceconnector</groupId>
<artifactId>data-plane-transfer-client</artifactId>
</dependency>

<!-- Telemetry -->
<dependency>
Expand Down
174 changes: 174 additions & 0 deletions edc-controlplane/edc-controlplane-memory-hashicorp-vault/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2022 Contributors to the Eclipse Foundation
See the NOTICE file(s) distributed with this work for additional
information regarding copyright ownership.
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
SPDX-License-Identifier: Apache-2.0
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>edc-controlplane</artifactId>
<groupId>org.eclipse.tractusx.edc</groupId>
<version>0.1.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>edc-controlplane-memory-hashicorp-vault</artifactId>
<packaging>jar</packaging>

<properties>
<sonar.moduleKey>${project.groupId}_${project.artifactId}</sonar.moduleKey>
</properties>

<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<directory>../../</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>NOTICE.md</include>
<include>LICENSE</include>
</includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.eclipse.dataspaceconnector.boot.system.runtime.BaseRuntime</mainClass>
<useUniqueVersions>false</useUniqueVersions>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


<dependencies>
<!-- Base Control-Plane -->
<dependency>
<groupId>org.eclipse.tractusx.edc</groupId>
<artifactId>edc-controlplane-base</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.dataspaceconnector</groupId>
<artifactId>control-plane-core</artifactId>
</dependency>

<!-- Vault -->
<dependency>
<groupId>org.eclipse.tractusx.edc.extensions</groupId>
<artifactId>hashicorp-vault</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.dataspaceconnector</groupId>
<artifactId>data-plane-transfer-client</artifactId>
</dependency>
</dependencies>

<profiles>
<profile>
<!--
mvn package -Pwith-docker-image
-->
<id>with-docker-image</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<!--
NOTE: To build and tag docker images the `docker` executable needs to
be on the PATH to be used by the exec-maven-plugin plugin
-->
<execution>
<id>docker-build-${project.artifactId}:${project.version}</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>build</argument>
<argument>-f</argument>
<argument>src/main/docker/Dockerfile</argument>
<argument>--build-arg</argument>
<argument>JAR=target/${project.artifactId}.jar</argument>
<argument>--build-arg</argument>
<argument>LIB=target/lib</argument>
<argument>-t</argument>
<argument>${project.artifactId}:${project.version}</argument>
<argument>.</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>docker-tag-${project.artifactId}:latest</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>tag</argument>
<argument>${project.artifactId}:${project.version}</argument>
<argument>${project.artifactId}:latest</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#
# Copyright (c) 2022 Mercedes-Benz Tech Innovation GmbH
# Copyright (c) 2021,2022 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# 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
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
FROM alpine:3.17.0 as otel

ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar"

HEALTHCHECK NONE

RUN wget ${OTEL_AGENT_LOCATION} -O /tmp/opentelemetry-javaagent.jar

FROM alpine:3.17.0

ARG JAR
ARG LIB

ARG APP_USER=docker
ARG APP_UID=10100

RUN apk update && \
apk add openjdk11-jre-headless=11.0.17_p8-r3 --no-cache && \
rm -rf /var/cache/apk/*

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 --from=otel /tmp/opentelemetry-javaagent.jar .
COPY ${JAR} edc-controlplane.jar
COPY ${LIB} ./lib/

HEALTHCHECK NONE

CMD ["java", \
"-javaagent:/app/opentelemetry-javaagent.jar", \
"-Dedc.fs.config=/app/configuration.properties", \
"-Djava.util.logging.config.file=/app/logging.properties", \
"-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \
"-Dotel.metrics.exporter=prometheus", \
"-Dotel.exporter.prometheus.port=9090", \
"-Djava.security.edg=file:/dev/.urandom", \
"-jar", \
"edc-controlplane.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@
<groupId>org.eclipse.tractusx.edc.extensions</groupId>
<artifactId>hashicorp-vault</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.dataspaceconnector</groupId>
<artifactId>data-plane-transfer-client</artifactId>
</dependency>
</dependencies>


Expand Down
1 change: 1 addition & 0 deletions edc-controlplane/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
<module>edc-controlplane-memory</module>
<module>edc-controlplane-postgresql</module>
<module>edc-controlplane-postgresql-hashicorp-vault</module>
<module>edc-controlplane-memory-hashicorp-vault</module>
</modules>
</project>

0 comments on commit 8afc4cd

Please sign in to comment.