Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containerisation #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
# EvaluationEngine
Sources of the Java Evaluation Engine
Sources of the Java Evaluation Engine. The evaluation engine performs backend tasks for OpenML:

- `process_datasets`: download a dataset, describe information per feature (e.g., the datatype and number of values per feature) and upload the results.
- `evaluate_run`: download a dataset and its splits, run the run's predictor on this dataset, and upload the evaluation (e.g., mean absolute error).
- `extract_features_all`: download a dataset, describe some features such as maximum number of distinct values of nominal features, and upload the results.
- `extract_features_simple`: same as `extract_features_all`, but with a subset of features.

## Usage
Please note that this library relies on the OpenML API Connector (maven id: org.openml.apiconnector) and often requires a snapshot version that is not released on Maven yet. Usually, this can be achieved by adding the latest version to your java classpath.
For more information on Snapshot dependencies, please check:
https://www.mojohaus.org/versions-maven-plugin/examples/unlock-snapshots.html

See [docker](./docker/README.md) directory for how to run this using docker.

### Prerequisites

- Java. It works with 11 LTS, compatibility with other versions is unknown.
- Maven

### Compile / package

mvn clean compile # only compile
mvn clean package -DskipTests # package (generate jar)

### Run
Generate the jar (see "Compile / package"). Then

java -jar target/EvaluationEngine-*-SNAPSHOT-jar-with-dependencies.jar -f process_dataset -id 1
java -jar target/EvaluationEngine-*-SNAPSHOT-jar-with-dependencies.jar -f evaluate_run -id 1
12 changes: 12 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM maven:3.9.7-eclipse-temurin-11-alpine AS build
COPY lib /app/lib
COPY src /app/src
COPY pom.xml /app
RUN mvn -f /app/pom.xml clean package -DskipTests

FROM openjdk:11-slim-bullseye
RUN useradd --create-home unprivileged-user
USER unprivileged-user

COPY --from=build /app/target/EvaluationEngine-*-jar-with-dependencies.jar /usr/local/lib/evaluation-engine.jar
ENTRYPOINT ["java", "-jar", "/usr/local/lib/evaluation-engine.jar"]
20 changes: 20 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Evaluation Engine

This docker container contains the OpenML Evaluation Engine.
Instructions only tested on a Linux host machine.

First pull the docker image:

docker pull openml/evaluation-engine


## Usage

docker run -it openml/evaluation-engine


## Building

docker build -f docker/Dockerfile --tag openml/evaluation-engine:0.0.1 .

docker --push openml/evaluation-engine:0.0.1
5 changes: 5 additions & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Libs

Libraries that are not published to maven.

We're having some problems publishing the Openml Apiconnector and OpenmlWeka to Maven Central. See build_instructions.txt in the directory of the ApiConnector (openml-java). I'm not able to make it work (Jos, Sept 2024). oss.sonatype.org throws a "Failed to deploy artifacts: Could not transfer artifact org.openml:apiconnector:kar:1.0.26 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Transfer failed for https://oss.sonatype.org/service/local/staging/deploy/maven2/org/openml/apiconnector/1.0.26/apiconnector-1.0.26.jar 401 Content access is protected by token." I assume that my token (created on https://central.sonatype.com/) is incorrect. I cannot log into https://oss.sonatype.org/. After a while, I decided to give up and to add the libraries here. Ugly, but it works...
Binary file removed lib/apiconnector-1.0.11-SNAPSHOT.jar
Binary file not shown.
Binary file added lib/apiconnector-1.0.26-SNAPSHOT.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions lib/apiconnector/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Manifest-Version: 1.0
Created-By: Maven Jar Plugin 3.2.0
Build-Jdk-Spec: 11

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
artifactId=apiconnector
groupId=org.openml
version=1.0.26-SNAPSHOT
279 changes: 279 additions & 0 deletions lib/apiconnector/META-INF/maven/org.openml/apiconnector/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
<?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>org.openml</groupId>
<artifactId>apiconnector</artifactId>
<version>1.0.26-SNAPSHOT</version>
<packaging>jar</packaging>

<name>APIConnector</name>
<description>Ancestor for API connector libraries for specific frameworks.</description>
<url>https://www.openml.org/</url>
<organization>
<name>Leiden University, NL</name>
<url>https://liacs.leidenuniv.nl/</url>
</organization>
<licenses>
<license>
<name>BSD-3-Clause</name>
<url>https://opensource.org/licenses/BSD-3-Clause</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<id>janvanrijn</id>
<name>Jan van Rijn</name>
<email>j.n.van.rijn@liacs.leidenuniv.nl</email>
<url>http://www.janvanrijn.eu</url>
<organization>Leiden University, NL</organization>
<organizationUrl>http://liacs.leidenuniv.nl/</organizationUrl>
<roles>
<role>Postdoctoral Reaseacher</role>
</roles>
</developer>
</developers>

<!-- this refers to the following file:
https://github.com/sonatype/oss-parents/blob/master/oss-parent/pom.xml
-->
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<scm>
<connection>scm:git:https://github.com/openml/java</connection>
<developerConnection>scm:git:https://github.com/openml/java</developerConnection>
<url>https://github.com/openml/java</url>
<tag>apiconnector-1.0.23</tag>
</scm>

<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<!-- used for skipping tests -->
<id>no-tests</id>
<properties>
<skipTests>true</skipTests>
</properties>
</profile>
</profiles>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.8</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.13</version>
</dependency>

<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.20</version>
</dependency>

<dependency>
<groupId>gov.nist.math</groupId>
<artifactId>scimark</artifactId>
<version>2.0</version>
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
</dependencies>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.10</source>
<target>1.10</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<includes>
<include>**/Test*.java</include>
</includes>
<disableXmlReport>true</disableXmlReport>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<useReleaseProfile>false</useReleaseProfile>
<localCheckout>true</localCheckout>
<pushChanges>true</pushChanges>
<commitByProject>true</commitByProject>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>.</directory>
<includes>
<include>**/*~</include>
<include>**/.attach_pid*</include>
<include>**/hs_err_pid*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<excludeResources>true</excludeResources>
</configuration>
</execution>
<execution>
<id>attach-test-sources</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<show>protected</show>
<nohelp>true</nohelp>
<!-- avoids "-SNAPSHOT" in title when using the release.xml configuration -->
<doctitle>${project.name}</doctitle>
</configuration>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.3.0</version>
</plugin>
</plugins>
</build>
</project>

Binary file removed lib/commons-cli-1.2.jar
Binary file not shown.
Binary file removed lib/commons-codec-1.9.jar
Binary file not shown.
Binary file removed lib/commons-io-2.4.jar
Binary file not shown.
Binary file removed lib/commons-lang3-3.1.jar
Binary file not shown.
Binary file removed lib/commons-logging-1.2.jar
Binary file not shown.
Binary file removed lib/commons-math3-3.4.jar
Binary file not shown.
Binary file removed lib/cortana.3103.jar
Binary file not shown.
Binary file removed lib/httpclient-4.5.2.jar
Binary file not shown.
Binary file removed lib/httpcore-4.4.4.jar
Binary file not shown.
Binary file removed lib/httpmime-4.5.2.jar
Binary file not shown.
Binary file removed lib/openmlcortana.jar
Binary file not shown.
Binary file added lib/openmlweka-0.9.10-SNAPSHOT.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions lib/openmlweka/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: josvdvelde
Build-Jdk: 11.0.23

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Generated by Maven
#Fri Jul 19 11:28:28 CEST 2024
groupId=org.openml
artifactId=openmlweka
version=0.9.10-SNAPSHOT
Loading