Skip to content

Commit e61bb61

Browse files
authored
Merge pull request #455 from ArcadeData/feature-412/multiplatform_docker_image
#412 multiplatfrom image
2 parents 0c9792d + d27e533 commit e61bb61

File tree

12 files changed

+79
-97
lines changed

12 files changed

+79
-97
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jobs:
4848
# If you wish to specify custom queries, you can do so here or in a config file.
4949
# By default, queries listed here will override any specified in a config file.
5050
# Prefix the list here with "+" to use these queries and those in the config file.
51-
51+
5252
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5353
# queries: security-extended,security-and-quality
5454

55-
55+
5656
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5757
# If this step fails, then you should remove it and run the build manually (see below)
5858
- name: Autobuild
@@ -61,7 +61,7 @@ jobs:
6161
# ℹ️ Command-line programs to run using the OS shell.
6262
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6363

64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
6565
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6666

6767
# - run: |

.github/workflows/mvn-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
server-password: MAVEN_PASSWORD
3838

3939
- name: Publish to OSS and Docker hub
40-
run: mvn deploy -Pintegration -Pcoverage -Pdeploy -Pdocker --batch-mode --errors --fail-at-end --show-version --file pom.xml
40+
run: mvn deploy -Pintegration -Pcoverage -Pdeploy -Pdocker -pl !e2e --batch-mode --errors --fail-at-end --show-version --file pom.xml
4141
env:
4242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}

.github/workflows/mvn-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444

4545
- name: E2E Test
46+
if: success()
4647
run: mvn verify -pl e2e
4748
env:
4849
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

e2e/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
</build>
5252

5353
<dependencies>
54+
<dependency>
55+
<groupId>org.junit.jupiter</groupId>
56+
<artifactId>junit-jupiter</artifactId>
57+
<version>${junit.jupiter.version}</version>
58+
<scope>test</scope>
59+
</dependency>
5460
<dependency>
5561
<groupId>org.testcontainers</groupId>
5662
<artifactId>testcontainers</artifactId>

e2e/src/test/java/com/arcadedb/e2e/ArcadeContainerTemplate.java

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,21 @@
2424
import java.time.*;
2525

2626
public abstract class ArcadeContainerTemplate {
27-
static final GenericContainer ARCADE;
27+
static final GenericContainer ARCADE;
2828

29-
static {
30-
ARCADE = new GenericContainer("arcadedata/arcadedb:latest").withExposedPorts(2480, 6379, 5432, 8182)//
31-
.withStartupTimeout(Duration.ofSeconds(90))//
32-
.withEnv("arcadedb.server.rootPassword", "playwithdata")
33-
.withEnv("arcadedb.server.defaultDatabases", "beer[root]{import:https://github.com/ArcadeData/arcadedb-datasets/raw/main/orientdb/OpenBeer.gz}")
34-
.withEnv("arcadedb.server.plugins", "Redis:com.arcadedb.redis.RedisProtocolPlugin, " +//
35-
"MongoDB:com.arcadedb.mongo.MongoDBProtocolPlugin, " +//
36-
"Postgres:com.arcadedb.postgres.PostgresProtocolPlugin, " +//
37-
"GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin").waitingFor(Wait.forListeningPort());
38-
ARCADE.start();
39-
}
29+
static {
30+
ARCADE = new GenericContainer("arcadedata/arcadedb:latest").withExposedPorts(2480, 6379, 5432, 8182)//
31+
.withStartupTimeout(Duration.ofSeconds(90))
32+
.withEnv("JAVA_OPTS", "-Darcadedb.server.rootPassword=playwithdata " +
33+
"-Darcadedb.server.defaultDatabases=beer[root]{import:https://github.com/ArcadeData/arcadedb-datasets/raw/main/orientdb/OpenBeer.gz} " +
34+
"-Darcadedb.server.plugins=Redis:com.arcadedb.redis.RedisProtocolPlugin,MongoDB:com.arcadedb.mongo.MongoDBProtocolPlugin,Postgres:com.arcadedb.postgres.PostgresProtocolPlugin,GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin")
35+
.waitingFor(Wait.forListeningPort());
36+
ARCADE.start();
37+
}
4038

41-
protected String host = ARCADE.getHost();
42-
protected int httpPort = ARCADE.getMappedPort(2480);
43-
protected int redisPort = ARCADE.getMappedPort(6379);
44-
protected int pgsqlPort = ARCADE.getMappedPort(5432);
45-
protected int gremlinPort = ARCADE.getMappedPort(8182);
39+
protected String host = ARCADE.getHost();
40+
protected int httpPort = ARCADE.getMappedPort(2480);
41+
protected int redisPort = ARCADE.getMappedPort(6379);
42+
protected int pgsqlPort = ARCADE.getMappedPort(5432);
43+
protected int gremlinPort = ARCADE.getMappedPort(8182);
4644
}

engine/src/main/java/com/arcadedb/log/LogManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@
2828
public class LogManager {
2929
private static final LogManager instance = new LogManager();
3030
private boolean debug = false;
31-
private Logger logger = new DefaultLogger();
31+
private Logger logger;
3232

3333
static class LogContext extends ThreadLocal<String> {
3434
}
3535

3636
public static final LogContext CONTEXT_INSTANCE = new LogContext();
3737

3838
protected LogManager() {
39+
logger = new DefaultLogger();
3940
}
4041

4142
public static LogManager instance() {

engine/src/main/resources/arcadedb-log.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ java.util.logging.ConsoleHandler.formatter = com.arcadedb.utility.AnsiLogFormatt
3636
# Set the default logging level for new FileHandler instances
3737
java.util.logging.FileHandler.level = INFO
3838
# Naming style for the output file
39-
java.util.logging.FileHandler.pattern=log/arcadedb.log
39+
java.util.logging.FileHandler.pattern=./log/arcadedb.log
4040
# Set the default formatter for new FileHandler instances
4141
java.util.logging.FileHandler.formatter = com.arcadedb.log.LogFormatter
4242
# Limiting size of output file in bytes:

package/pom.xml

Lines changed: 34 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
<artifactId>arcadedb-package</artifactId>
2727
<packaging>pom</packaging>
2828

29+
<properties>
30+
<kubernetes-maven-plugin.version>1.8.0</kubernetes-maven-plugin.version>
31+
</properties>
32+
2933
<parent>
3034
<groupId>com.arcadedb</groupId>
3135
<artifactId>arcadedb-parent</artifactId>
@@ -143,73 +147,42 @@
143147
<build>
144148
<plugins>
145149
<plugin>
146-
<groupId>org.apache.maven.plugins</groupId>
147-
<artifactId>maven-resources-plugin</artifactId>
148-
<version>${maven-resources-plugin.version}</version>
150+
<groupId>org.eclipse.jkube</groupId>
151+
<artifactId>kubernetes-maven-plugin</artifactId>
152+
<version>${kubernetes-maven-plugin.version}</version>
149153
<executions>
150154
<execution>
151-
<id>docker-resources</id>
152-
<phase>validate</phase>
155+
<id>default</id>
156+
<phase>package</phase>
157+
<goals>
158+
<goal>build</goal>
159+
</goals>
160+
</execution>
161+
<execution>
162+
<id>deploy</id>
163+
<phase>deploy</phase>
153164
<goals>
154-
<goal>copy-resources</goal>
165+
<goal>push</goal>
155166
</goals>
156-
<configuration>
157-
<outputDirectory>${project.build.directory}</outputDirectory>
158-
<resources>
159-
<resource>
160-
<directory>src/main/docker/</directory>
161-
<filtering>false</filtering>
162-
<excludes>
163-
<exclude>**/*.yml</exclude>
164-
</excludes>
165-
</resource>
166-
</resources>
167-
</configuration>
168167
</execution>
169168
</executions>
170-
</plugin>
171-
172-
<plugin>
173-
<groupId>com.spotify</groupId>
174-
<artifactId>dockerfile-maven-plugin</artifactId>
175-
<version>${dockerfile-maven-version}</version>
176-
<executions>
177-
<execution>
178-
<id>default</id>
179-
<phase>package</phase>
180-
<goals>
181-
<goal>build</goal>
182-
<goal>tag</goal>
183-
</goals>
184-
<configuration>
185-
<tag>latest</tag>
186-
</configuration>
187-
</execution>
188-
<execution>
189-
<id>tag-version</id>
190-
<phase>package</phase>
191-
<goals>
192-
<goal>tag</goal>
193-
</goals>
194-
<configuration>
195-
<tag>${project.version}</tag>
196-
</configuration>
197-
</execution>
198-
<execution>
199-
<id>deploy</id>
200-
<phase>deploy</phase>
201-
<goals>
202-
<goal>push</goal>
203-
</goals>
204-
</execution>
205-
</executions>
206-
<configuration>
207-
<buildArgs>
208-
<ARCADEDB_VERSION>${project.version}</ARCADEDB_VERSION>
209-
</buildArgs>
210-
<repository>arcadedata/arcadedb</repository>
211-
<contextDirectory>${project.build.directory}</contextDirectory>
212-
</configuration>
169+
<configuration>
170+
<verbose>true</verbose>
171+
<images>
172+
<image>
173+
<name>arcadedata/arcadedb</name>
174+
<build>
175+
<dockerFile>${project.basedir}/src/main/docker/Dockerfile</dockerFile>
176+
<contextDir>${project.build.directory}/arcadedb-${project.version}.dir
177+
</contextDir>
178+
<tags>
179+
<tag>latest</tag>
180+
<tag>${project.version}</tag>
181+
</tags>
182+
</build>
183+
</image>
184+
</images>
185+
</configuration>
213186
</plugin>
214187
</plugins>
215188
</build>

package/src/main/assembly/archive.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@
7070
<files>
7171
<file>
7272
<source>${basedir}/../README.md</source>
73-
<fileMode>444</fileMode>
73+
<fileMode>666</fileMode>
7474
</file>
7575
<file>
7676
<source>${basedir}/../LICENSE</source>
77-
<fileMode>444</fileMode>
77+
<fileMode>666</fileMode>
7878
</file>
7979
</files>
8080
<!--

package/src/main/config/gremlin-server.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616

1717
gremlin.graph=org.apache.tinkerpop.gremlin.arcadedb.structure.ArcadeGraph
18-
gremlin.arcadedb.directory=../databases/graph
18+
gremlin.arcadedb.directory=./databases/graph

0 commit comments

Comments
 (0)