Skip to content

Commit 5e35c9c

Browse files
authored
Merge pull request #169 from VariantSync/unparse
Improved Unparser
2 parents 3e04daf + fd60dfb commit 5e35c9c

43 files changed

Lines changed: 1361 additions & 58 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Project name | Domain | Source code available (\*\*y\*\*es/\*\*n\*\*o)? | Is it a git repository (\*\*y\*\*es/\*\*n\*\*o)? | Repository URL | Clone URL | Estimated number of commits
2+
-------------------|-------------------------|-------------------------------------------------|--------------------------------------------------|--------------------------------------------------------------|----------------------------------------------------|---------------------------------
3+
berkeley-db-libdb | database system | y | y | https://github.com/berkeleydb/libdb | https://github.com/berkeleydb/libdb.git | 7
4+
sylpheed | e-mail client | y | y | https://github.com/jan0sch/sylpheed | https://github.com/jan0sch/sylpheed.git | 2,682
5+
vim | text editor | y | y | https://github.com/vim/vim | https://github.com/vim/vim.git | 17,109

replication/thesis-es/Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM alpine:3.15
4+
# PACKAGE STAGE
5+
6+
# Prepare the compile environment. JDK is automatically installed
7+
RUN apk add maven
8+
9+
# Create and navigate to a working directory
10+
WORKDIR /home/user
11+
12+
COPY local-maven-repo ./local-maven-repo
13+
14+
# Copy the source code
15+
COPY src ./src
16+
# Copy the pom.xml if Maven is used
17+
COPY pom.xml .
18+
# Execute the maven package process
19+
RUN mvn package || exit
20+
21+
FROM alpine:3.15
22+
23+
# Create a user
24+
RUN adduser --disabled-password --home /home/sherlock --gecos '' sherlock
25+
26+
RUN apk add --no-cache --upgrade bash
27+
RUN apk add --update openjdk17
28+
29+
# Change into the home directory
30+
WORKDIR /home/sherlock
31+
32+
# Copy the compiled JAR file from the first stage into the second stage
33+
# Syntax: COPY --from=STAGE_ID SOURCE_PATH TARGET_PATH
34+
WORKDIR /home/sherlock/holmes
35+
COPY --from=0 /home/user/target/diffdetective-*-jar-with-dependencies.jar ./DiffDetective.jar
36+
WORKDIR /home/sherlock
37+
RUN mkdir results
38+
39+
# Copy the setup
40+
COPY docs holmes/docs
41+
42+
# Copy the docker resources
43+
COPY docker/* ./
44+
COPY replication/thesis-es/docker/* ./
45+
RUN mkdir DiffDetectiveMining
46+
47+
# Adjust permissions
48+
RUN chown sherlock:sherlock /home/sherlock -R
49+
RUN chmod +x execute.sh
50+
RUN chmod +x entrypoint.sh
51+
RUN chmod +x fix-perms.sh
52+
53+
# Set the entrypoint
54+
ENTRYPOINT ["./entrypoint.sh", "./execute.sh"]
55+
56+
# Set the user
57+
USER sherlock

replication/thesis-es/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
![Maven](https://github.com/VariantSync/DiffDetective/actions/workflows/maven.yml/badge.svg)
2+
[![Documentation](https://img.shields.io/badge/Documentation-Read-purple)][documentation]
3+
[![Install](https://img.shields.io/badge/Install-Instructions-blue)](INSTALL.md)
4+
[![GitHubPages](https://img.shields.io/badge/GitHub%20Pages-online-blue.svg?style=flat)][website]
5+
[![License](https://img.shields.io/badge/License-GNU%20LGPLv3-blue)](../../LICENSE.LGPL3)
6+
7+
# Unparsing Experiment
8+
This is an experiment for the bachelor thesis by Eugen Shulimov which tests the unparser for variation trees and diffs.
9+
10+
### Prerequisite
11+
All following commands assume that working directory of your terminal is the `thesis-es` directory. Please switch directories, if this is not the case:
12+
```shell
13+
cd DiffDetective/replication/thesis-es
14+
```
15+
16+
### Build the Docker container
17+
Start the docker deamon.
18+
Clone this repository.
19+
Open a terminal and navigate to the root directory of this repository.
20+
To build the Docker container you can run the `build` script corresponding to your operating system.
21+
#### Windows:
22+
`.\build.bat`
23+
#### Linux/Mac (bash):
24+
`./build.sh`
25+
26+
### Start the experiment
27+
To execute the experiment you can run the `execute`script corresponding to your operating system.
28+
29+
#### Windows:
30+
`.\execute.bat
31+
#### Linux/Mac (bash):
32+
`./execute.sh
33+
34+
> If you want to stop the execution, you can call the provided script for stopping the container in a separate terminal.
35+
> When restarted, the execution will continue processing by restarting at the last unfinished repository.
36+
> #### Windows:
37+
> `.\stop-execution.bat`
38+
> #### Linux/Mac (bash):
39+
> `./stop-execution.sh`
40+
41+
You might see warnings or errors reported from SLF4J like `Failed to load class "org.slf4j.impl.StaticLoggerBinder"` which you can safely ignore.
42+
43+
### View the results in the [results][resultsdir] directory
44+
All raw results are stored in the [results][resultsdir] directory.
45+
46+
[documentation]: https://variantsync.github.io/DiffDetective/docs/javadoc/
47+
[website]: https://variantsync.github.io/DiffDetective/
48+
49+
[resultsdir]: results

replication/thesis-es/build.bat

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@echo off
2+
setlocal
3+
4+
set "targetSubPath=thesis-es"
5+
6+
rem Get the current directory
7+
for %%A in ("%CD%") do set "currentDir=%%~nxA"
8+
9+
rem Check if the current directory ends with the target sub-path
10+
11+
if "%currentDir:~-9%"=="%targetSubPath%" (
12+
cd ..\..
13+
docker build -t diff-detective-unparse -f replication\thesis-es\Dockerfile .
14+
@pause
15+
) else (
16+
echo error: the script must be run from inside the thesis-es directory, i.e., DiffDetective\replication\%targetSubPath%
17+
)
18+
endlocal
19+

replication/thesis-es/build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
# We have to switch to the root directory of the project and build the Docker image from there,
4+
# because Docker only allows access to the files in the current file system subtree (i.e., no access to ancestors).
5+
# We have to do this to get access to 'src', 'docker', 'local-maven-repo', etc.
6+
# For resiliency against different working directories during execution of this
7+
# script we calculate the correct path using the special bash variable
8+
# BASH_SOURCE.
9+
cd "$(dirname "${BASH_SOURCE[0]}")/../.." || exit
10+
11+
docker build -t diff-detective-unparse -f replication/thesis-es/Dockerfile .
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Docker Files
2+
3+
This directory contains the files that are required to run the Docker container.
4+
5+
## Execution
6+
The [`execute.sh`](execute.sh) script can be adjusted to run the program that should be executed by the Docker container.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
cd /home/sherlock/holmes || exit
4+
5+
echo "Running the experiment."
6+
java -cp DiffDetective.jar org.variantsync.diffdetective.experiments.thesis-es.Main
7+
8+
echo "Collecting results."
9+
cp -r results/* ../results/
10+
echo "The results are located in the 'results' directory."
11+

replication/thesis-es/execute.bat

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
setlocal
3+
4+
set "targetSubPath=thesis-es"
5+
6+
rem Get the current directory
7+
for %%A in ("%CD%") do set "currentDir=%%~nxA"
8+
9+
rem Check if the current directory ends with the target sub-path
10+
if "%currentDir:~-9%"=="%targetSubPath%" (
11+
docker run --rm -v "%cd%\results":"/home/sherlock/results" diff-detective-unparse %*
12+
) else (
13+
echo error: the script must be run from inside the thesis-es directory, i.e., DiffDetective\replication\%targetSubPath%
14+
)
15+
endlocal

replication/thesis-es/execute.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
# Assure that the script is only called from the folder cotaining this script
3+
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
4+
5+
if [[ $# -gt 0 ]]; then
6+
echo "Executing $1"
7+
fi
8+
docker run --rm -v "$(pwd)/results":"/home/sherlock/results" diff-detective-unparse "$@"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

0 commit comments

Comments
 (0)