eclipse / repairnator

Software development bots for Github. Join the bot revolution! :star2::robot::star2::revolving_hearts:
MIT License
382 stars 83 forks source link

Need Help with Repairnator Pipeline Setup #1222

Closed zen93 closed 1 year ago

zen93 commented 3 years ago

Hello Everyone,

My name is Akshay. I am a Master's student at KTH and I'm looking to add chatbot capabilities to Repairnator. I will accomplish this by utilizing the Repairnator github app to interact with developers on pull requests that are proposed as patches by Repairnator.

I need some guidance on how to setup a local installation of Repairnator. I have been able to setup my own version of the github-app repo and have confirmed it is working (although it required updates to the code). Next, I would like to setup a local Repairnator pipleine that accepts messages from the github app and responds with PRs when a patch is found. I'm having trouble setting up the repairnator-pipeline repo. I have installed activemq and docker on a WSL-version of ubuntu 20.04. When I run the script launch_pipeline.sh, I get the following error: ./launch_pipeline.sh: line 43: ./launch_dockerpool.sh: No such file or directory.

Any help would be greatly appreciated.

Thanks, Akshay

andre15silva commented 3 years ago

Hello Everyone,

Hi @zen93 !

My name is Akshay. I am a Master's student at KTH and I'm looking to add chatbot capabilities to Repairnator. I will accomplish this by utilizing the Repairnator github app to interact with developers on pull requests that are proposed as patches by Repairnator.

That sounds very cool.

I need some guidance on how to setup a local installation of Repairnator. I have been able to setup my own version of the github-app repo and have confirmed it is working (although it required updates to the code). Next, I would like to setup a local Repairnator pipleine that accepts messages from the github app and responds with PRs when a patch is found. I'm having trouble setting up the repairnator-pipeline repo. I have installed activemq and docker on a WSL-version of ubuntu 20.04. When I run the script launch_pipeline.sh, I get the following error: ./launch_pipeline.sh: line 43: ./launch_dockerpool.sh: No such file or directory.

I did some digging and that script was removed in https://github.com/eclipse/repairnator/commit/baa4b4aa8f43b4cf8abc0e7063cd3a7f82f4ef50. Looks like that information and code may be outdated.

To run a local repairnator-pipeline instance you can:

Good luck!

zen93 commented 3 years ago

Hello, @andre15silva!

Thanks for the reply.

To run a local repairnator-pipeline instance you can:

I think this is my preferred method as I would like to makes some modifications to Repairnator so that it can implement certain changes in the patch it will produce. But, when I try to run the command mvn install -DskipTests I get the following error from maven:

[ERROR] Failed to execute goal on project repairnator-pipeline: Could not resolve dependencies for project fr.inria.repairnator:repairnator-pipeline:jar:3.3-SNAPSHOT: Could not find artifact fr.inria.repairnator:repairnator-core:jar:3.3-SNAPSHOT in tdurieux-maven-repository-snapshot (https://tdurieux.github.io/maven-repository/snapshots/) -> [Help 1]

I have tried building my own Docker image too but I get the error: NB: JAVA_HOME should point to a JDK not a JRE. I have tried multiple different JAVA_HOME values but none of them seem to work. When I run echo $JAVA_HOME it produces the following response: /usr/lib/jvm/java-8-openjdk-amd64.

Can you please assist me in fixing the issues mentioned above? Preferably, the issue with trying to run the main classes so that I may also contribute to Repairnator?

Thanks!

andre15silva commented 3 years ago

I think this is my preferred method as I would like to makes some modifications to Repairnator so that it can implement certain changes in the patch it will produce. But, when I try to run the command mvn install -DskipTests I get the following error from maven:

[ERROR] Failed to execute goal on project repairnator-pipeline: Could not resolve dependencies for project fr.inria.repairnator:repairnator-pipeline:jar:3.3-SNAPSHOT: Could not find artifact fr.inria.repairnator:repairnator-core:jar:3.3-SNAPSHOT in tdurieux-maven-repository-snapshot (https://tdurieux.github.io/maven-repository/snapshots/) -> [Help 1]

Oh sorry, the documentation seems to be a bit deceptive. You should run the command on the top-level directory. This will result in other modules being installed locally, such as repairnator-core, whose snapshots are used.

Alternatively you can simply install the ones you want with a command like and replacing the target module:

mvn clean install -DskipTests -f src/repairnator-core/

Note, I just identified an issue with a transitive dependency of repairnator-core, identified in #1225. If this happens to you too, you can temporarily use the workaround in https://github.com/andre15silva/repairnator/tree/tmp-fix-jenkins-repo.

I have tried building my own Docker image too but I get the error: NB: JAVA_HOME should point to a JDK not a JRE. I have tried multiple different JAVA_HOME values but none of them seem to work. When I run echo $JAVA_HOME it produces the following response: /usr/lib/jvm/java-8-openjdk-amd64.

@javierron do you know what might be causing this? I haven't touched the docker image, so not sure.

javierron commented 3 years ago

Hello, @zen93

I believe the easiest way to get the pipeline working is building the JAR yourself: mvn clean package -DskipTests -f src/repairnator-pipeline/, don't forget to install the repairnator-core module first, as pointed by @andre15silva.

You can check this script as a reference on how to execute the built JAR.

Regarding the docker image:

  1. The current Dockerfile depends on build_repairnator.sh which does not currently work, but you can work around this issue by changing the Dockerfile and copying the pipeline JAR directly.
  2. The repairnator/pipeline:latest image currently on docker hub should work fine. For a reference on what to specify as environment variables you can check this and this files.
  3. Regarding the JAVA_HOME problem, it could help if you share the command you are executing and its full output.

Finally, thank you for pointing where the automation scripts and their documentation need to be updated. :+1: Don't hesitate to submit a pull request with fixes :sweat_smile:.

zen93 commented 3 years ago

I have been able to run Repairnator pipeline successfully. I used the main class method. Using the updated documentation, I was able to build and run the pipeline. It produced the patches for failing builds.

The problem was that I was using windows 10. I also tried WSL which is linux installed on windows as a subsystem. They both did not work correctly. The solution was to dual boot my laptop with Ubuntu 20.04.

Also, the build number listed in the documentation does not exist anymore.

Run it on Travis CI build 413285802

Maybe someone can update it?

Thanks for the help.

monperrus commented 3 years ago

Also, the build number listed in the documentation does not exist anymore.

Thanks for the bug report, this is #1231