Skip to content

Commit

Permalink
Upgrades to java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
Qnzvna committed Dec 6, 2023
1 parent 9fd4722 commit 3f25306
Show file tree
Hide file tree
Showing 65 changed files with 799 additions and 257 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: maven build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B clean verify -P docker

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
2 changes: 1 addition & 1 deletion cyclone-daemon/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:11-jre-slim
FROM amazoncorretto:17.0.9-alpine3.18

RUN mkdir /opt/cyclone /opt/cyclone/parcels /etc/cyclone /var/log/cyclone

Expand Down
31 changes: 24 additions & 7 deletions cyclone-daemon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
Expand All @@ -42,13 +48,15 @@
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-auth</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard-bundles</groupId>
<artifactId>dropwizard-webjars-bundle</artifactId>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<exclusions>
<exclusion>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
Expand Down Expand Up @@ -163,8 +171,8 @@
<phase>generate-test-resources</phase>
<configuration>
<target name="copy examples">
<copy file="${project.basedir}/../cyclone-examples/target/cyclone-examples-${project.version}.jar" tofile="${project.basedir}/target/test-classes/67548d96-076d-4f69-bd1d-3b9316b2ba15" />
<copy file="${project.basedir}/../cyclone-examples/target/cyclone-examples-${project.version}.jar" tofile="${project.basedir}/target/examples.jar" />
<copy file="${project.basedir}/../cyclone-examples/target/cyclone-examples-${project.version}.jar" tofile="${project.basedir}/target/test-classes/67548d96-076d-4f69-bd1d-3b9316b2ba15"/>
<copy file="${project.basedir}/../cyclone-examples/target/cyclone-examples-${project.version}.jar" tofile="${project.basedir}/target/examples.jar"/>
</target>
</configuration>
</execution>
Expand Down Expand Up @@ -214,7 +222,7 @@
<createDependencyReducedPom>true</createDependencyReducedPom>
<outputFile>target/cyclone-daemon.jar</outputFile>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.cempaka.cyclone.daemon.CycloneDaemon</mainClass>
</transformer>
Expand All @@ -226,7 +234,16 @@
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.md</exclude>
<exclude>META-INF/*.txt</exclude>
<exclude>*.module-info</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/DEPENDENCIES</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/*.MF</exclude>
<exclude>META-INF/*.markdown</exclude>
<exclude>module-info.*</exclude>
<exclude>about.html</exclude>
</excludes>
</filter>
</filters>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import io.dropwizard.auth.AuthFilter;
import io.dropwizard.auth.basic.BasicCredentialAuthFilter;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.cempaka.cyclone.configurations.AuthenticationConfiguration;

@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import static com.google.common.base.Preconditions.checkNotNull;

import io.dropwizard.auth.AuthFilter;
import jakarta.annotation.Priority;
import jakarta.ws.rs.Priorities;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.core.Response;

import java.util.Optional;
import javax.annotation.Priority;
import javax.ws.rs.Priorities;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

@Priority(Priorities.AUTHENTICATION)
class HeaderAuthFilter extends AuthFilter<String, AdminUser>
Expand All @@ -28,7 +28,7 @@ class HeaderAuthFilter extends AuthFilter<String, AdminUser>
public void filter(final ContainerRequestContext requestContext)
{
if (!authenticate(requestContext, requestContext.getHeaderString(headerName), SCHEME)) {
throw new WebApplicationException(Response.status(Status.UNAUTHORIZED).build());
throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.cempaka.cyclone.auth;

import io.dropwizard.auth.AuthFilter;
import jakarta.annotation.Priority;
import jakarta.ws.rs.Priorities;
import jakarta.ws.rs.container.ContainerRequestContext;

import java.util.Optional;
import javax.annotation.Priority;
import javax.ws.rs.Priorities;
import javax.ws.rs.container.ContainerRequestContext;

@Priority(Priorities.AUTHENTICATION)
class NoopAuthFilter extends AuthFilter<Object, AdminUser>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.cempaka.cyclone.configurations;

import javax.validation.constraints.Min;
import jakarta.validation.constraints.Min;

public class ChannelConfiguration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import org.cempaka.cyclone.services.NodeIdentifierProvider;
import org.cempaka.cyclone.services.StaticNodeIdentifierProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.cempaka.cyclone.configurations;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.dropwizard.Configuration;
import io.dropwizard.core.Configuration;
import io.dropwizard.db.DataSourceFactory;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import io.dropwizard.logging.common.ExternalLoggingFactory;
import io.dropwizard.logging.common.LoggingFactory;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;

public class DaemonConfiguration extends Configuration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cempaka.cyclone.configurations;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;

public class StalledTestCleanerConfiguration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cempaka.cyclone.configurations;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.Valid;
import jakarta.validation.Valid;
import org.cempaka.cyclone.storage.repositories.JdbiLogMessageRepository;
import org.cempaka.cyclone.storage.repositories.JdbiNodeStateRepository;
import org.cempaka.cyclone.storage.repositories.JdbiParcelRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cempaka.cyclone.configurations;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;

public class TestRunnerConfiguration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.HashMap;
import java.util.Map;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotNull;

public class TypedConfiguration<T>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package org.cempaka.cyclone.configurations;

import javax.annotation.Nullable;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.cempaka.cyclone.workers.WorkerConfiguration;
import jakarta.validation.constraints.Min;
import org.hibernate.validator.constraints.NotEmpty;

import javax.annotation.Nullable;

public class WorkersConfiguration
{
@Min(1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.cempaka.cyclone.core.log;

import javax.inject.Singleton;
import com.google.inject.Singleton;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static org.cempaka.cyclone.core.utils.Preconditions.checkNotNull;

import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.cempaka.cyclone.storage.repositories.LogMessageRepository;

@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

import com.google.inject.Guice;
import com.google.inject.Injector;
import io.dropwizard.Application;
import io.dropwizard.assets.AssetsBundle;
import io.dropwizard.bundles.webjars.WebJarBundle;
import io.dropwizard.core.Application;
import io.dropwizard.core.setup.Bootstrap;
import io.dropwizard.core.setup.Environment;
import io.dropwizard.forms.MultiPartBundle;
import io.dropwizard.jersey.setup.JerseyEnvironment;
import io.dropwizard.lifecycle.setup.LifecycleEnvironment;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import java.net.SocketException;
import java.net.UnknownHostException;
import org.cempaka.cyclone.auth.AuthFilterFactory;
import org.cempaka.cyclone.configurations.DaemonConfiguration;
import org.cempaka.cyclone.core.channel.DaemonChannel;
Expand All @@ -26,9 +23,13 @@
import org.cempaka.cyclone.resources.TestExecutionResource;
import org.cempaka.cyclone.resources.TestResource;
import org.cempaka.cyclone.storage.MigrationRunner;
import org.cempaka.cyclone.webjars.WebJarBundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.SocketException;
import java.net.UnknownHostException;

public class CycloneDaemon extends Application<DaemonConfiguration>
{
private static final Logger LOG = LoggerFactory.getLogger(CycloneDaemon.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import com.google.inject.Provides;
import com.google.inject.TypeLiteral;
import com.google.inject.name.Names;
import io.dropwizard.core.setup.Environment;
import io.dropwizard.db.DataSourceFactory;
import io.dropwizard.jdbi3.JdbiFactory;
import io.dropwizard.setup.Environment;
import java.time.Clock;
import java.util.Map;
import java.util.function.BiConsumer;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.cempaka.cyclone.configurations.AuthenticationConfiguration;
Expand All @@ -42,7 +42,6 @@
import org.cempaka.cyclone.services.NodeIdentifierProvider;
import org.cempaka.cyclone.services.TestRunnerService;
import org.cempaka.cyclone.storage.StorageModule;
import org.cempaka.cyclone.workers.WorkerConfiguration;
import org.jdbi.v3.core.Jdbi;
import org.jdbi.v3.jackson2.Jackson2Config;
import org.jdbi.v3.jackson2.Jackson2Plugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import java.util.UUID;
import java.util.function.BiConsumer;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.cempaka.cyclone.beans.TestState;
import org.cempaka.cyclone.core.channel.Payload;
import org.cempaka.cyclone.core.channel.PayloadType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import java.util.UUID;
import java.util.function.BiConsumer;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.cempaka.cyclone.core.channel.LogPayload;
import org.cempaka.cyclone.core.channel.Payload;
import org.cempaka.cyclone.core.channel.PayloadType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
import java.util.function.BiConsumer;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.cempaka.cyclone.core.channel.Payload;
import org.cempaka.cyclone.core.channel.PayloadType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.time.Instant;
import java.util.UUID;
import java.util.function.BiConsumer;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.cempaka.cyclone.beans.MetricDataPoint;
import org.cempaka.cyclone.core.channel.Payload;
import org.cempaka.cyclone.core.channel.PayloadType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import java.util.UUID;
import java.util.function.BiConsumer;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.cempaka.cyclone.beans.TestState;
import org.cempaka.cyclone.core.channel.Payload;
import org.cempaka.cyclone.core.channel.PayloadType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.cempaka.cyclone.beans.TestState;
import org.cempaka.cyclone.beans.exceptions.ParcelNotFoundException;
import org.cempaka.cyclone.beans.exceptions.WorkerNotAvailableException;
Expand Down
Loading

0 comments on commit 3f25306

Please sign in to comment.