Explorar el Código

Added further instructions in how to use Docker.

ossv hace 5 años
padre
commit
6d764ea579
Se han modificado 3 ficheros con 43 adiciones y 9 borrados
  1. 1 9
      code/Dockerfile
  2. 2 0
      code/README.md
  3. 40 0
      code/doc/Docker.md

+ 1 - 9
code/Dockerfile

@@ -7,13 +7,6 @@ ADD . /root/
 WORKDIR /root
 RUN git clone https://github.com/jenkinsci/jenkins.git
 
-WORKDIR /root/fetch_jira_bugs
-RUN python3 fetch.py
-RUN python3 git_log_to_array.py --repo-path ../jenkins
-RUN python3 find_bug_fixes.py --gitlog ./gitlog.json --issue-list ./issues
-
-WORKDIR /root/szz
-
 RUN apk add --no-cache --update openjdk8 curl
 
 RUN mkdir /usr/lib/gradle
@@ -27,6 +20,5 @@ ENV PATH ${PATH}:/usr/lib/gradle/gradle-4.10.3/bin
 WORKDIR /root/szz
 
 RUN gradle build && gradle fatJar
-RUN java -jar ./build/libs/szz_find_bug_introducers-0.1.jar -i ../fetch_jira_bugs/issue_list.json -r ../jenkins
 
-WORKDIR /root
+WORKDIR /root

+ 2 - 0
code/README.md

@@ -99,6 +99,8 @@ fixes.
 
 ## Use SZZ Unleashed with Docker <a name="szz_docker"></a>
 
+A more thorough instruction in using docker to produce the results can be found in [doc/Docker.md](doc/Docker.md). Below is a very brief instruction.
+
 There exists a *Dockerfile* in the repository. It contains all the steps in chronological order that is needed to generate the **fix\_and\_bug\_introducing\_pairs.json**. Simply run this command in the directory where the Dockerfile is located:
 
 ```bash

+ 40 - 0
code/doc/Docker.md

@@ -0,0 +1,40 @@
+### How to generate fix and bug introducing pairs using Docker
+
+Docker is a great tool if one is using a system where either the Python or Java installation is not working properly. It requires docker to be installed which is something that won't be covered here but can be found in dockers own [installation instructions](https://docs.docker.com/install/). To get further information about what docker is, read the overall  [documentation](https://docs.docker.com/).
+
+In this project it exists a file called *Dockerfile*. With this file it is possible to build a docker image that contains all the necessary parts for the algorithm to run. A docker image is more or less a template for a future virtual machine which will run a certain system, in this case a small system called Alpine.
+
+To build a docker image, one just need to execute the build command:
+
+```bash
+docker build -t szz .
+```
+The dot indicates that the Dockerfile is located in the same directory which the command was executed in.
+
+When the build is done, one can see the finished docker image with:
+```bash
+docker images
+```
+
+Now to actually do something, a docker container is needed. The docker container is the running instance, or if one prefer virtual machine, of the docker image. It will be a fully fledged system which runs an Alpine system. To start the container, just execute the command:
+```bash
+docker run -it --name szz_con szz ash
+```
+
+As a result, one is provided with a [ash shell](https://linux.die.net/man/1/ash) that is executed inside the docker container. With it, one can now run the steps required to generate the data. Here is a brief instruction how to generate data using the [jenkins project](https://github.com/jenkinsci/jenkins).
+
+```bash
+docker run -it --name ssz_con szz ash
+cd /roo/fetch_jira_bugs
+python3 fetch.py --issue-code JENKINS --jira-project issues.jenkins-ci.org
+python3 git_log_to_array.py --repo-path ../jenkins
+python3 find_bug_fixes.py --gitlog ./gitlog.json --issue-list ./issues
+cd /root/szz
+java -jar ./build/libs/szz_find_bug_introducers-0.1.jar -i ../fetch_jira_bugs/issue_list.json -r ../jenkins
+```
+
+The results from the algorithm will now be located in */root/szz/results*. To get it, start another command prompt and execute the following command:
+
+```bash
+docker cp szz_con:/root/szz/results .
+```