|
1 | 1 | # PyCRE
|
2 | 2 | Conflict-aware Inference of Python Compatible Runtime Environments with Domain Knowledge Graph, ICSE 2022
|
| 3 | + |
| 4 | +## Dependencies |
| 5 | + |
| 6 | +This project is developed using Python 3.6.9 on Ubuntu 18.04 LTS. |
| 7 | + |
| 8 | +| Name | Version | |
| 9 | +| -------------- | ------- | |
| 10 | +| Docker | 20.10.8 | |
| 11 | +| Docker Compose | 1.23.2 | |
| 12 | + |
| 13 | +## Python Package Knowledge Graph |
| 14 | +We have opened our knowledge graphs in [releases](https://github.com/nju-websoft/PyCRE/releases). If you need to create a new knowledge graph, follow the instructions below: |
| 15 | + |
| 16 | +First, you need to install Neo4j 4.1.1 and its required Java version (Java SE 11). |
| 17 | + |
| 18 | +Install extra Python dependencies: |
| 19 | + |
| 20 | +``` |
| 21 | +pip install -r build_KG/requirements.txt |
| 22 | +``` |
| 23 | + |
| 24 | +Automatically acquire knowledge and build KG for specific Python packages: |
| 25 | + |
| 26 | +``` |
| 27 | +python build_KG/run.py <packages_file> <neo4j_HOME> <Python_version> |
| 28 | +``` |
| 29 | + |
| 30 | +Load data from CSV files into an unused Neo4j database and dump the database into a single-file archive: |
| 31 | + |
| 32 | +``` |
| 33 | +./build_KG/data/Pythonxxx/csv-data/run.sh |
| 34 | +
|
| 35 | +NEO4J_HOME/bin/neo4j-admin dump --database=neo4j --to=neo4j.dump |
| 36 | +``` |
| 37 | + |
| 38 | +## Inference |
| 39 | + |
| 40 | +Move the dump files to the specific folder: |
| 41 | + |
| 42 | +``` |
| 43 | +mv py2.dump py3.dump docker_env/neo4j |
| 44 | +``` |
| 45 | + |
| 46 | +Build the docker images and start the deamon service: |
| 47 | + |
| 48 | +``` |
| 49 | +cd docker_env |
| 50 | +
|
| 51 | +./build_images.sh |
| 52 | +
|
| 53 | +docker-compose up --detach |
| 54 | +``` |
| 55 | + |
| 56 | +Install extra Python dependencies: |
| 57 | + |
| 58 | +``` |
| 59 | +pip install -r bin/requirements.txt |
| 60 | +``` |
| 61 | + |
| 62 | +Compile [CryptoMiniSat SAT solver](https://github.com/msoos/cryptominisat). |
| 63 | + |
| 64 | +Then you can use PyCRE to infer a compatible runtime environment to a Python code: |
| 65 | + |
| 66 | +``` |
| 67 | +python bin/run.py <snippet_path> <dependencies_dir> |
| 68 | +``` |
0 commit comments