Skip to content

Commit

Permalink
Migrate to QOSDK (#36)
Browse files Browse the repository at this point in the history

Signed-off-by: Attila Mészáros <csviri@gmail.com>
  • Loading branch information
csviri authored Mar 29, 2024
1 parent d45ebbe commit 0f00d96
Show file tree
Hide file tree
Showing 12 changed files with 463 additions and 374 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ jobs:
java: [ 17 ]
kubernetes: [ 'v1.26.12', 'v1.27.9', 'v1.28.5' ]
steps:
- name: Set up Minikube
uses: manusa/actions-setup-minikube@v2.10.0
with:
minikube version: v1.31.2
kubernetes version: ${{ matrix.kubernetes }}
driver: 'docker'
github token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
Expand Down
175 changes: 118 additions & 57 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,114 +10,133 @@
<name>Resource Flow Operator</name>
<packaging>jar</packaging>

<!-- TODO remove -->
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<properties>
<java.version>17</java.version>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<josdk.version>4.8.2</josdk.version>
<slf4j.version>1.7.36</slf4j.version>
<junit.version>5.10.2</junit.version>
<log4j.version>2.23.1</log4j.version>
<surefire-plugin.version>3.2.5</surefire-plugin.version>
<fabric8-client.version>6.11.0</fabric8-client.version>
<directory-maven-plugin.version>1.0</directory-maven-plugin.version>
<impsort-maven-plugin.version>1.9.0</impsort-maven-plugin.version>
<formatter-maven-plugin.version>2.23.0</formatter-maven-plugin.version>
<graalvm.version>23.0.3</graalvm.version>
<graalvm.version>24.0.0</graalvm.version>
<mokito.version>5.11.0</mokito.version>
<mustache.version>0.9.11</mustache.version>
<qosdk.version>6.6.7</qosdk.version>
<assertj.version>3.25.3</assertj.version>
</properties>

<!-- <dependencyManagement>-->
<!-- <dependencies>-->
<!-- <dependency>-->
<!-- <groupId>io.javaoperatorsdk</groupId>-->
<!-- <artifactId>operator-framework-bom</artifactId>-->
<!-- <version>${josdk.version}</version>-->
<!-- <type>pom</type>-->
<!-- <scope>import</scope>-->
<!-- </dependency>-->
<!-- </dependencies>-->
<!-- </dependencyManagement>-->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client-bom</artifactId>
<version>${fabric8-client.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.quarkiverse.operatorsdk</groupId>
<artifactId>quarkus-operator-sdk-bom</artifactId>
<version>${qosdk.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
<version>${fabric8-client.version}</version>
</dependency>
<dependency>
<groupId>io.javaoperatorsdk</groupId>
<artifactId>operator-framework</artifactId>
<version>${josdk.version}</version>
<groupId>io.quarkiverse.operatorsdk</groupId>
<artifactId>quarkus-operator-sdk</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>generator-annotations</artifactId>
<version>${fabric8-client.version}</version>
<groupId>io.quarkiverse.operatorsdk</groupId>
<artifactId>quarkus-operator-sdk-bundle-generator</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-apt</artifactId>
<version>${fabric8-client.version}</version>
<scope>provided</scope>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.javaoperatorsdk</groupId>
<artifactId>operator-framework-junit-5</artifactId>
<version>${josdk.version}</version>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-mockito</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<groupId>org.jboss.slf4j</groupId>
<artifactId>slf4j-jboss-logmanager</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
<groupId>io.fabric8</groupId>
<artifactId>generator-annotations</artifactId>
<version>${fabric8-client.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
<version>${junit.version}</version>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-jib</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mokito.version}</version>
<scope>test</scope>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js-community</artifactId>
<version>${graalvm.version}</version>
<type>pom</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
<version>${mustache.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-apt</artifactId>
<scope>test</scope>
<version>${fabric8-client.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -146,6 +165,47 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -178,7 +238,8 @@
</goals>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<configFile>${resourceglueoperator.project.root}/contributing/eclipse-google-style.xml</configFile>
<configFile>${resourceglueoperator.project.root}/contributing/eclipse-google-style.xml
</configFile>
</configuration>
</execution>
</executions>
Expand Down
21 changes: 0 additions & 21 deletions src/main/java/io/csviri/operator/resourceglue/Runner.java
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
package io.csviri.operator.resourceglue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.csviri.operator.resourceglue.reconciler.glue.GlueReconciler;
import io.csviri.operator.resourceglue.reconciler.operator.GlueOperatorReconciler;
import io.javaoperatorsdk.operator.Operator;

public class Runner {

private static final Logger log = LoggerFactory.getLogger(Runner.class);

public static void main(String[] args) {
Operator operator = new Operator();
operator.register(new GlueReconciler());
operator.register(new GlueOperatorReconciler());
operator.start();
log.info("resource-glue controller started.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -36,6 +37,11 @@ public boolean isMet(DependentResource<GenericKubernetesResource, Glue> dependen
Glue glue,
Context<Glue> context) {
try {
List<ScriptEngineFactory> engines = new ScriptEngineManager().getEngineFactories();
for (ScriptEngineFactory f : engines) {
System.out.println(f.getLanguageName() + " " + f.getEngineName() + " " + f.getNames());
}

var start = LocalDateTime.now();
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("js");
Expand Down
16 changes: 0 additions & 16 deletions src/main/resources/log4j2.xml

This file was deleted.

Loading

0 comments on commit 0f00d96

Please sign in to comment.