Skip to content

Commit

Permalink
Merge branch 'release-0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
artur committed Feb 4, 2024
2 parents 1429b3d + 037d760 commit 108dea2
Show file tree
Hide file tree
Showing 172 changed files with 94,293 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.github
.git
.idea
*/logs
**/target
**/node_modules
**/build
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
REACT_APP_REST_HOST=rest
REACT_APP_REST_PORT=8080
REST_API_HOST=rest
REST_API_PORT=8080
FITS_HOST=fits
FITS_PORT=8080
DB_HOST=db
DB_PORT=8080
69 changes: 69 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Docker Image CI

on:
push:
branches: [main, dev, release/*]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and push FITSInn REST
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: artourkin/fitsinn-rest:${{ github.ref_name }}
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Build and push FITSInn WEB
uses: docker/build-push-action@v5
with:
file: ./web/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: artourkin/fitsinn-web:${{ github.ref_name }}
- name: Build and push FITS WEB
uses: docker/build-push-action@v5
with:
file: ./fits/Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: artourkin/fits-web:${{ github.ref_name }}
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,63 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*


**/build/
**/yarn.lock
*.lock
.classpath
.project
.settings/
.DS_Store
target/
bin/
c3po-core/output.xml
c3po-webapi/war/
*/profiles/*
*/exports/*
*/*.csv
*/logs/
*/log
.idea/
*.iml
# vagrant related local settings, should never end up in the repo
.vagrant_settings/maven_settings.xml
.vagrant_settings/proxy_settings.conf
# Eclipse
.project
.classpath
.settings/
bin/

# IntelliJ
.idea
*.ipr
*.iml
*.iws

# NetBeans
nb-configuration.xml

# Visual Studio Code
.vscode

# OSX
.DS_Store

# Vim
*.swp
*.swo

# patch
*.orig
*.rej

# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties

**/node_modules
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM maven:3.9.0 as builder
COPY . /app
WORKDIR /app
RUN mvn -pl !web clean install -Pprod

FROM openjdk:21-jdk-slim
WORKDIR /app
RUN printenv
COPY --from=builder /app/main/target/fitsinn-main-*.jar ./app.jar

RUN chown 1001 ./app.jar \
&& chmod "g+rwX" ./app.jar

USER 1001
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# fitsinn
Place where your FITS files feel good
# FITSInn
Place where your FITS files feel good.
## Purpose

FITSInn is a tool to store and analyse technical metadata extracted by characterisation tools such as [FITS](https://projects.iq.harvard.edu/fits/).
![img.png](docs/img.png)

The features include:
* Improved user experience through an intuitive UI.
* Running file characterisation using FITS on the uploaded files.
* The original files are not stored.
* Slice and dice:
* Filtering,
* Drill-down,
* Property value aggregations,
* Distribution visualisations,
* Sampling.
* Built-in metadata conflict resolution.
* REST API for workflow automation.


## Installation

### Deployment

The artifacts are released as Docker images. You can install FITSInn using Docker-compose:

```
docker-compose -f docker-compose.yaml up --pull
```

Installation of FITSInn to Docker Swarm or K8S is possible, but is not currently addressed.


### Local build

Building the Docker images from scratch and starting FITSInn is executed via:

```
docker-compose -f docker-compose.dev.yaml up --build
```

File uploading using bash:

bash fileupload.sh http://localhost:8082 ~/rnd/data/govdocs_fits/govdocs1/000/

## Issues

If you have any issue regarding FITSInn, please use [https://github.com/datascience/fitsinn/issues](https://github.com/datascience/fitsinn/issues).

## License

FITSInn is released under MIT license. See the [LICENSE](LICENSE) for details.
36 changes: 36 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<parent>
<groupId>rocks.artur</groupId>
<artifactId>fitsinn</artifactId>
<version>0.1.0</version>
</parent>

<groupId>rocks.artur</groupId>
<artifactId>fitsinn-core</artifactId>


</project>
13 changes: 13 additions & 0 deletions core/src/main/java/rocks/artur/api/AnalyzePersistFile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package rocks.artur.api;

import java.io.File;

/**
* This interface enables the following actions:
* - to analyze a digital object using a characterisation tool,
* - to persist a characterisation result in a db.
*/
public interface AnalyzePersistFile {
Long uploadCharacterisationResults(File file);
Long uploadCharacterisationResults(byte[] file, String filename);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package rocks.artur.api;

import rocks.artur.domain.CharacterisationResult;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
* this interface helps to build a wrapper for a characterisation tool.
*/
public interface CharacterisationResultProducer {
/***
* This method returns the version of the used tool
* @return A version of the tool
* @throws IOException
*/
String getVersion() throws IOException;

/***
*
* This method extracts metadata properties from a given digital object.
*
* @param file Input File
* @return A list of @CharacterisationResult
* @throws IOException
*/
List<CharacterisationResult> processFile(File file) throws IOException;


/***
*
* This method extracts metadata properties from a given digital object passed as a byte array.
*
* @param file Input File
* @param filename
* @return A list of @CharacterisationResult
* @throws IOException
*/
List<CharacterisationResult> processFile(byte[] file, String filename) throws IOException;
}
10 changes: 10 additions & 0 deletions core/src/main/java/rocks/artur/api/GetCollectionStatistics.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package rocks.artur.api;

import rocks.artur.domain.FilterCriteria;

import java.util.Map;

public interface GetCollectionStatistics {
Map<String, Double> getStatistics(FilterCriteria filterCriteria);

}
17 changes: 17 additions & 0 deletions core/src/main/java/rocks/artur/api/GetObjects.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package rocks.artur.api;

import rocks.artur.domain.CharacterisationResult;
import rocks.artur.domain.FilterCriteria;
import rocks.artur.domain.statistics.PropertiesPerObjectStatistic;

import java.util.List;

/**
* This interface enables getting characterisation results.
*/
public interface GetObjects {
List<PropertiesPerObjectStatistic> getObjects(FilterCriteria filterCriteria);
Iterable<CharacterisationResult> getObject(String filePath);

List<CharacterisationResult> getConflictsFromObject(String filePath);
}
14 changes: 14 additions & 0 deletions core/src/main/java/rocks/artur/api/GetProperties.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package rocks.artur.api;

import rocks.artur.domain.FilterCriteria;
import rocks.artur.domain.statistics.PropertyStatistic;

import java.util.List;

/**
* This interface enables getting a property distribution.
*/
public interface GetProperties {
List<PropertyStatistic> getProperties();
List<PropertyStatistic> getProperties(FilterCriteria filter);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package rocks.artur.api;

import rocks.artur.domain.CharacterisationResult;
import rocks.artur.domain.FilterCriteria;
import rocks.artur.domain.Property;
import rocks.artur.domain.statistics.PropertyValueStatistic;

import java.util.List;

/**
* This interface enables getting a property value distribution given a property name.
*/
public interface GetPropertyValueDistribution {
List<PropertyValueStatistic> getPropertyValueDistribution(Property propertyName, FilterCriteria<CharacterisationResult> filterCriteria);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package rocks.artur.api;

import rocks.artur.domain.statistics.PropertyValueStatistic;

import java.util.List;

/**
* This interface enables getting a property value distribution given a filter.
*/
public interface GetPropertyValueDistributionWithFilter {
List<PropertyValueStatistic> getPropertyValueDistributionWithFilter(String propertyName, String filter);
}
Loading

0 comments on commit 108dea2

Please sign in to comment.