📰 What is pochi
🔑 Key idea
Almost traditional birthmark systems are usually simple input and output. For example, an user specifies the type of target birthmark, $p$ and $q$ as input, and obtains result as output. The process of such system is hard to use. Because, when the user would perform some process (ex. filtering results), it requires the update of birthmark system.
In general, the process of birthmarking is composed of extraction phase, and comparison phase. Also, the both phases are performed to huge amount of programs.
Therefore, the birthmark system accept the script file as input, and the user describes extraction and comparison of birthmarks in the script file. If the user would perform filtering process, it is easy to perform the process.
🍴 Usage
🏃♂️ CLI Interface
pochi [OPTIONS] [SCRIPT_FILE [ARGV...]]
OPTIONS
-c, --classpath <CLASSPATH> specifies the classpaths for Groovy (JVM) separated with colon (:).
-C, --config <CONFIG_FILE> specifies the configuration file.
-e, --expression <EXPRESSION> specifies one line script.
-w, --working-dir <DIR> specifies the working directory.
-v, --verbose sets as verbose mode.
-h, --help prints this message.
SCRIPT_FILE [ARGV...]
Groovy script file name and its arguments.
If no script files and no expression were given, pochi runs on interactive mode.
Script file
The script files are parsed by the Groovy. For more detail, see 🐜 Examples.
🐳 Docker
Container images of pochi for Docker are:
ghcr.io/tamada/pochi
2.6.0
,latest
2.5.2
2.5.1
2.5.0
2.4.6
2.4.0
2.3.24
2.3.23
2.3.21
2.3.19
2.3.18
2.3.17
2.3.16
2.3.10
2.3.2
2.3.1
2.3.0
2.2.0
2.1.0
2.0.0
- accept only
.groovy
script files.
- accept only
1.0.0
- accept only
.js
script files.
- accept only
To run pochi on Docker container OS, type the following commands.
$ docker run --rm -it -v "$PWD":/home/pochi ghcr.io/tamada/pochi:latest [OPTIONS] [SCRIPT [ARGV...]]
OPTIONS
: the options for pochi.[SCRIPT [ARGV...]]
: script file for pochi.--rm
: remove the container after running.-it
: interactive and tty mode.-v "$PWD":/home/pochi
: share volume$PWD
in host OS to/home/pochi
in the container OS.$PWD
must be the absolute path.
ghcr.io/tamada/pochi
does not include groovy interactive shell environment.
Therefore, it does not work on interactive mode.
If want to run pochi
on the interactive mode, use ghcr.io/tamada/pochi-groovysh
image instead.
Environments in the docker container
USER
:pochi
WORKDIR
:/home/pochi
JAVA_HOME
:/opt/java
(symbolic link from/opt/openjdk-11-minimal
)- This Java runtime environment do not include unnecessary modules.
POCHI_HOME
:/opt/pochi
(symbolic link from/opt/pochi-x.x.x
)GROOVY_HOME
:/opt/groovy
(symbolic link from/opt/groovy-x.x.x
, only exist onghcr.io/tamada/pochi-groovysh
image)
🏊♂️ The birthmarking flow
The birthmarking process in pochi shows in Figure 1.
The followings are the description of the nodes and edges in the flowchart.
Classes
- is the Java class files, almost included in the jar files, and the directory.
pochi treats them as the object of
DataSource
- is the Java class files, almost included in the jar files, and the directory.
pochi treats them as the object of
Birthmarks
- shows the extracted characteristics from Java class files by certain method.
In the pochi,
Birthmarks
andBirthmark
show the extracted birthmarks. The string representation ofBirthmark
(the return value oftoString
method) is CSV format, therefore, we can store them into some csv file.
- shows the extracted characteristics from Java class files by certain method.
In the pochi,
Pair
- shows the pair list of extracted birthmarks.
pochi shows these objects as
Pair<Birthmark>
.
- shows the pair list of extracted birthmarks.
pochi shows these objects as
Comparisons
- represents the comparison results of birthmarks by the certain similarity calculation algorithm.
pochi shows these objects as
Comparisons
andComparison
.
- represents the comparison results of birthmarks by the certain similarity calculation algorithm.
pochi shows these objects as
Extractor
- extracts birthmarks from given class files by the certain algorithm.
In the script file,
pochi.extractor("ALGORITHM_NAME")
obtains the instance ofExtractor
.
- extracts birthmarks from given class files by the certain algorithm.
In the script file,
Parser
- parses the given csv file and build
Birthmarks
object. To get the instance ofBirthmarkParser
, callpochi.parser()
method in the script file.
- parses the given csv file and build
PairMatcher
- matches the pair of birthmarks by some algorithm.
pochi.matcher("ALGORITHM_NAME")
returns the instance ofPairMatcher
.
- matches the pair of birthmarks by some algorithm.
Comparator
- calculates similarity between two given birthmaks by the certain algorithm.
In the script file,
pochi.comparator("ALGORITHM_NAME")
gets the instance ofComparator
.
- calculates similarity between two given birthmaks by the certain algorithm.
In the script file,