Skip to content

Commit

Permalink
Extract KubeVela analysis to separate library
Browse files Browse the repository at this point in the history
The static methods in the new class
`eu.nebulouscloud.optimiser.kubevela.KubevelaAnalyzer` are used by
multiple components in the NebulOuS Solver.

Create a library `nebulous-requirements-extractor` that houses this
class.

Adapt the container build job to run at project root, not inside the
`nebulous-controller` subdirectory.

Add jobs for library build and repository upload.

Change-Id: Ic61c7064d216201031659bc362e3ed218f9c2b67
  • Loading branch information
rudi authored and jmarchel7bulls committed Feb 29, 2024
1 parent 12a9e8a commit 3f75c54
Show file tree
Hide file tree
Showing 16 changed files with 487 additions and 184 deletions.
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,26 @@ __pycache__/

# Gradle project-specific cache directory
.gradle
# Gradle build output directory
/optimiser-controller/build/

# Various output directories
build/
bin/
/nebulous-requirements-extractor/target/

# generated artefact directory
/optimiser-controller/dist/

# jdtls (Java LSP server) and/or eclipse data files
.classpath
.factorypath
.project
.settings/
/optimiser-controller/bin/

# IntelliJ IDEA configuration files
/.idea/

# Visual Studio Code files
/.vscode/

# Emacs files
/.dir-locals.el
2 changes: 1 addition & 1 deletion optimiser-controller/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ RUN gradle --no-daemon -Dorg.gradle.logging.level=info clean build
# Package stage
#
FROM docker.io/library/eclipse-temurin:17-jre
COPY --from=build /home/optimiser-controller/dist/optimiser-controller-all.jar /usr/local/lib/optimiser-controller-all.jar
COPY --from=build /home/optimiser-controller/optimiser-controller/dist/optimiser-controller-all.jar /usr/local/lib/optimiser-controller-all.jar
ENTRYPOINT ["java","-jar","/usr/local/lib/optimiser-controller-all.jar", "-vv"]
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ To compile, install a JDK (Java Development Kit) version 17 or greater on the bu
A container can be built and run with the following commands:

```sh
cd optimiser-controller
docker build -t optimiser-controller -f Dockerfile .
docker run --rm optimiser-controller
```
Expand Down
13 changes: 13 additions & 0 deletions nebulous-requirements-extractor/.mvn/local-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
<mirrors>
<mirror>
<id>my-repository-http-unblocker</id>
<mirrorOf>activeeon</mirrorOf>
<name></name>
<url>http://repository.activeeon.com/content/groups/proactive/</url>
<blocked>false</blocked>
</mirror>
</mirrors>
</settings>
1 change: 1 addition & 0 deletions nebulous-requirements-extractor/.mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--settings .mvn/local-settings.xml
61 changes: 61 additions & 0 deletions nebulous-requirements-extractor/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/

plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
// Use this to check for newer versions of dependency libraries via
// ./gradlew dependencyUpdates
id "com.github.ben-manes.versions" version "0.50.0"
// https://docs.freefair.io/gradle-plugins/8.4/reference/#_lombok
id "io.freefair.lombok" version "8.4"
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()

// 7bulls, activeeon maven repositories for SAL
maven {
url 'http://repository.activeeon.com/content/groups/proactive/'
allowInsecureProtocol = true
}
}

dependencies {
// JSON parsing; exported to consumers
// https://github.com/FasterXML/jackson
api 'com.fasterxml.jackson.core:jackson-databind:2.16.1'

// SAL client library; exported to consumers
api 'org.ow2.proactive:sal-common:13.1.0-SNAPSHOT'

// YAML parsing: https://github.com/FasterXML/jackson-dataformats-text
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.1'
// Logging (only the API; backends will be set up by the application)
implementation 'org.slf4j:slf4j-api:1.7.32'

}

testing {
suites {
// Configure the built-in test suite
test {
// Use JUnit Jupiter test framework
useJUnitJupiter('5.10.0')
}
}
}

// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

group = 'eu.nebulouscloud'
version = '1.0'
13 changes: 13 additions & 0 deletions nebulous-requirements-extractor/local-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
<mirrors>
<mirror>
<id>my-repository-http-unblocker</id>
<mirrorOf>activeeon</mirrorOf>
<name></name>
<url>http://repository.activeeon.com/content/groups/proactive/</url>
<blocked>false</blocked>
</mirror>
</mirrors>
</settings>
102 changes: 102 additions & 0 deletions nebulous-requirements-extractor/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>

<groupId>eu.nebulouscloud</groupId>
<artifactId>nebulous-requirements-extractor</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<!-- Define properties for versions -->
<jackson.version>2.16.1</jackson.version>
<sal.version>13.1.0-SNAPSHOT</sal.version>
<slf4j.version>1.7.32</slf4j.version>
<junit.jupiter.version>5.10.0</junit.jupiter.version>
</properties>

<dependencies>
<!-- JSON parsing -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
</dependency>
<!-- SAL client library -->
<dependency>
<groupId>org.ow2.proactive</groupId>
<artifactId>sal-common</artifactId>
<version>${sal.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- YAML parsing -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson.version}</version>
</dependency>

<!-- Logging API -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<repositories>
<repository>
<!-- Maven Central -->
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<!-- Activeeon Repository -->
<id>activeeon</id>
<url>http://repository.activeeon.com/content/groups/proactive/</url>
<name>repository.activeeon</name>
</repository>
<repository>
<!-- Apache Log4j Repository -->
<id>apache-log4j</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
</repositories>
</project>
Loading

0 comments on commit 3f75c54

Please sign in to comment.