Giter VIP home page Giter VIP logo

binarydoc-docker's Introduction

BinaryDoc, Binary code is the best Document

BinaryDoc generates Documents with rich diagrams from Binary files directly for Java.

This docker image needs to work together with mysql database with specified mysql.cnf configurations. An sample docker-compose.yml file has been provided.

Sample Diagrams in Generated documents:

  • Control Flow Graph for Java method bytecode Control Flow Graph for method java.net.Inet6Address.getByAddress

  • UML Sequence Diagram for Java method bytecode UML Sequence Diagram for method java.net.Inet6Address.getByAddress

  • UML Hierarchy Diagram for Java Class UML Hierarchy Diagram for class java.nio.channels.FileChannel UML Hierarchy Diagram for class java.lang.Class UML Hierarchy Diagram for class javax.swing.JTable

  • Dependency Network diagram for Java package Dependency Network Diagram for package java.beans

  • Jar,Jmod files Dependency Network Diagram (sfdp layout) Dependency Network Diagram for OpenJDK 13

There are web sites containing the documentes and diagrams generated by BinaryDoc:

BinaryDoc Docker Compose User Guide

This is an sample docker compose setup for BinaryDoc, which generates Documents with rich diagrams from Binary files directly for Java.

Warning

  • This docker compose setup is designed for none-production environment, better for evaluation or testing box
  • Password is set in .env, while password vault could be used in production
  • Default RAM in mysql.cnf is small, while 128 GB or more RAM is available in production

Hardware Requirement

BinaryDoc is a compute-intensive software which needs powerful hardware.

Here we list the suggested minimal hardware requirements:

  • CPU: 8 or more threads
  • RAM: 24 GB minimal, 64 GB is suggested for better performance, based on the size of the Java application to be parsed
  • Disk type: SSD Drive is suggested, M.2 SSD or NVMe SSD are preferred
  • Disk size: 20 GB or more avialbe disk space is suggested
    • The size is based on the binary data to be parsed.
    • Example: OpenJDK 11 binary data size is 387.9 MB, and the current corresponding DB size is 7 GB.

Steps

Customize the config files

  • .env
    • Change the DB password (default=123456) when needed
    • Change the TCP ports when needed
  • mysql.cnf
    • Change innodb_buffer_pool_size based on avabile RAM hardware and the size of application to be parsed
    • Change innodb_buffer_pool_instances based on parallel workloads

If running Docker on Windows

  • If running on other system, ignore this step
  • Change the file etc/mysql/conf.d/mysql.cnf permission as read only, or else the mysql file will not load it

Start the Docker Instances

  • docker-compose up -d

Run the Parser for current OpenJDK for demo:

  • ./run-parse-demo.sh
    • Note. the parser execution takes about 1 hour on M.2 SSD disk, and needs up to 24 GB RAM

Run the Parser for your application:

  • Put your Java Application to be Parsed to the app-to-parse folder
    • Example: Copy the application .jmod or .jar files to this folder
  • Start the parser

Access the Web Site

(Optional) Access the Backend DB if interested

  • http://127.0.0.1:10190/
    • System: MySQL
    • Server: binarydoc-db
    • Username: root
    • Password: 123456, or the password set in the .env file
    • Database: binarydocjvmadm
  • MySQL Workbench, or Other DB Access Tools
    • Server: localhost
    • Port: 13306

Other commands

When we want to Delete Existing Docker Instances, and to Start over again

When we want login to the Running Docker container

  • sudo docker-compose exec binarydoc /bin/bash

TCP Ports Mapping

  • We may change the ports 10180, 10190, 13306 in .env when necessary

Community

binarydoc-docker's People

Contributors

fuinyroot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

binarydoc-docker's Issues

Loop / Permanent Restart

Hi,

thanks for providing binarydoc!

When I execute rebuild.sh (git bash under windows 10), I see the following in the console of fuiny/binarydoc:latest:

spawn mysql_config_editor set --login-path=binarydocjvm --host=binarydoc-db --user=root --password
Enter password:
spawn mysql_config_editor set --login-path=binarydocjvmadm --host=binarydoc-db --user=root --password
Enter password:
Thu Mar 25 15:27:23 UTC 2021 Waiting for DB to be Ready ...
[...]
Thu Mar 25 15:28:02 UTC 2021 DB Server is NOT ready yet
mysqld is alive
Thu Mar 25 15:28:03 UTC 2021 DB Server is ready now
Thu Mar 25 15:28:06 UTC 2021 Create DB Users if not exist
host user authentication_string
% fuinyadmin *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
% fuinyweb *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
% root *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
localhost mysql.infoschema $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
localhost mysql.session $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
localhost mysql.sys $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
localhost root *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
Thu Mar 25 15:28:06 UTC 2021 Create DB Schema for Admin if not exists
ERROR 1418 (HY000) at line 206: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
spawn mysql_config_editor set --login-path=binarydocjvm --host=binarydoc-db --user=root --password
Enter password:
spawn mysql_config_editor set --login-path=binarydocjvmadm --host=binarydoc-db --user=root --password
Enter password:
Thu Mar 25 15:28:08 UTC 2021 Waiting for DB to be Ready ...
mysqld is alive
Thu Mar 25 15:28:08 UTC 2021 DB Server is ready now
Thu Mar 25 15:28:11 UTC 2021 Create DB Users if not exist
host user authentication_string
% fuinyadmin *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
% fuinyweb *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
% root *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
localhost mysql.infoschema $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
localhost mysql.session $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
localhost mysql.sys $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
localhost root *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
Thu Mar 25 15:28:12 UTC 2021 Create DB Schema for Admin if not exists
ERROR 1418 (HY000) at line 206: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
[...]

docker version shows:

Client: Docker Engine - Community
 Cloud integration: 1.0.9
 Version:           20.10.5
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        55c4c88
 Built:             Tue Mar  2 20:14:53 2021
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.5
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       363e9a8
  Built:            Tue Mar  2 20:15:47 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Am I doing something wrong?

Thanks in advance
Jörg

Update mysql innodb_redo_log_capacity

https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.