-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
172 changed files
with
94,293 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.github | ||
.git | ||
.idea | ||
*/logs | ||
**/target | ||
**/node_modules | ||
**/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
core/src/main/java/rocks/artur/api/AnalyzePersistFile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
41 changes: 41 additions & 0 deletions
41
core/src/main/java/rocks/artur/api/CharacterisationResultProducer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
10
core/src/main/java/rocks/artur/api/GetCollectionStatistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
15 changes: 15 additions & 0 deletions
15
core/src/main/java/rocks/artur/api/GetPropertyValueDistribution.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
12 changes: 12 additions & 0 deletions
12
core/src/main/java/rocks/artur/api/GetPropertyValueDistributionWithFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
Oops, something went wrong.