jacamo-lang / jacamo-web

web interface for JaCaMo
7 stars 6 forks source link

Docker doesn't build #71

Closed DougTrajano closed 3 years ago

DougTrajano commented 3 years ago

Hey guys, I'm trying to build the Dockerfile in this project, but it doesn't works. Could you check that? I'm not very good with Java applications hahaha

Building jacamo-web
[+] Building 109.4s (7/8)
 => [internal] load build definition from Dockerfile                                                                     0.0s 
 => => transferring dockerfile: 703B                                                                                     0.0s 
 => [internal] load .dockerignore                                                                                        0.0s 
 => => transferring context: 2B                                                                                          0.0s 
 => [internal] load metadata for docker.io/library/alpine:latest                                                        13.3s 
 => [auth] library/alpine:pull token for registry-1.docker.io                                                            0.0s 
 => [1/4] FROM docker.io/library/alpine@sha256:eb3e4e175ba6d212ba1d6e04fc0782916c08e1c9d7b45892e9796141b1d379ae          0.0s 
 => CACHED [2/4] RUN apk add --update --no-cache git gradle openjdk8-jre bash fontconfig ttf-dejavu graphviz             0.0s 
 => ERROR [3/4] RUN git clone https://github.com/jacamo-lang/jacamo-web.git &&     cd jacamo-web &&     gradle build    96.0s 
------
 > [3/4] RUN git clone https://github.com/jacamo-lang/jacamo-web.git &&     cd jacamo-web &&     gradle build:
#7 0.452 Cloning into 'jacamo-web'...
#7 6.459
#7 6.459 Welcome to Gradle 6.8.3!
#7 6.459
#7 6.459 Here are the highlights of this release:
#7 6.460  - Faster Kotlin DSL script compilation
#7 6.460  - Vendor selection for Java toolchains
#7 6.460  - Convenient execution of tasks in composite builds
#7 6.460  - Consistent dependency resolution
#7 6.461
#7 6.461 For more details see https://docs.gradle.org/6.8.3/release-notes.html
#7 6.461
#7 6.659 Starting a Gradle Daemon (subsequent builds will be faster)
#7 95.36 > Task :compileJava FAILED
#7 95.36
#7 95.36 FAILURE: Build failed with an exception.
#7 95.36 
#7 95.36 * What went wrong:
#7 95.36 Execution failed for task ':compileJava'.
#7 95.36 > Could not find tools.jar. Please check that /usr/lib/jvm/java-1.8-openjdk contains a valid JDK installation.       
#7 95.36
#7 95.36 * Try:
#7 95.36 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
#7 95.36
#7 95.36 * Get more help at https://help.gradle.org
#7 95.36
#7 95.36 Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
#7 95.36 Use '--warning-mode all' to show the individual deprecation warnings.
#7 95.36 See https://docs.gradle.org/6.8.3/userguide/command_line_interface.html#sec:command_line_warnings
#7 95.36
#7 95.36 BUILD FAILED in 1m 29s
#7 95.36 1 actionable task: 1 executed
------
executor failed running [/bin/sh -c git clone https://github.com/jacamo-lang/jacamo-web.git &&     cd jacamo-web &&     gradle build]: exit code: 1
ERROR: Service 'jacamo-web' failed to build : Build failed
cleberjamaral commented 3 years ago

Hi, Douglas!

That is a good question!

I tried here /my_local_path/jacamo-web$ docker build -t jacamo-runrest . and had a different result. In your case, it seems to be related with Java 1.8 jdk installation. The Dockerfile configuration is expecting to find the JDK in the following specific folder: /usr/lib/jvm/java-1.8-openjdk. You can change this configuration if you want to avoid installing 1.8 jdk on your machine.

Still, it is not working for some reason. In my case, I got an error on yarnSetup task. I am investigating what is happening.

Task :compileJava Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.

Task :processResources Task :classes Task :jar Task :assemble Task :nodeSetup

Task :yarnSetup FAILED env: can't execute 'node': No such file or directory

jomifred commented 3 years ago

Hi Douglas,

i've also tried and faced the same problem as you. I updated the Dockerfile so that that error is fixed (about jdk).

However, it now fails with something related to node -- but not the same error as Cleber!

I hope we can fix it soon.

thanks,

DougTrajano commented 3 years ago

Tks guys! I'll check your new Dockerfile, I'll work on this issue this night as well. If I find a solution, I'll tell you all.

Tomorrow I'll have a class with Dr. Rafael Bordini and I'll try to use your application in my course this semester haha

Tks for your support on that! o/

jomifred commented 3 years ago

BTW, i've update the jacamo docker file at https://hub.docker.com/r/jomifred/jacamo

cleberjamaral commented 3 years ago

Hi, guys! Please, check the branch "fix-docker" which seems to fix, this issue. What we have done:

rbordini commented 3 years ago

Many thanks guys! It seems Douglas will have no excuses not to run jacamo in the lecture tomorrow! ;)

On Wed, 18 Aug 2021, 23:26 Cleber Jorge Amaral, @.***> wrote:

Hi, guys! Please, check the branch "fix-docker" which seems to fix, this issue. What we have done:

  • Dockerfile was missing the installation of nodejs and npm. Besides, com.moowork.node seems to have some issues with new gradle versions. Luckly, the fork com.github.node-gradle.node is fixing it. New versions of node and yarn were also set.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jacamo-lang/jacamo-web/issues/71#issuecomment-901559505, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACMU7UAPPJFDDRE7FEWHYZLT5RTVTANCNFSM5CCQUSOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

DougTrajano commented 3 years ago

Hi, guys! Please, check the branch "fix-docker" which seems to fix, this issue. What we have done:

  • Dockerfile was missing the installation of nodejs and npm. Besides, com.moowork.node seems to have some issues with new gradle versions. Luckly, the fork com.github.node-gradle.node is fixing it. New versions of node and yarn were also set.

Hi guys, thanks for the help on that, but it still doesn't work with the Dockerfile in fix-docker. The docker logs was following:

docker build logs

``` [+] Building 110.5s (7/8) => [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 387B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/openjdk:8-jdk-alpine 13.3s => [auth] library/openjdk:pull token for registry-1.docker.io 0.0s => CACHED [1/4] FROM docker.io/library/openjdk:8-jdk-alpine@sha256:94792824df2df33402f201713f932b58cb9de94a0cd524164a0f2283343547b3 0.0s => [2/4] RUN apk add --update --no-cache git bash fontconfig ttf-dejavu graphviz nodejs npm 11.1s => ERROR [3/4] RUN git clone https://github.com/jacamo-lang/jacamo-web.git && cd jacamo-web && ./gradlew run 86.0s ------ > [3/4] RUN git clone https://github.com/jacamo-lang/jacamo-web.git && cd jacamo-web && ./gradlew run: #7 0.536 Cloning into 'jacamo-web'... #7 3.629 Downloading https://services.gradle.org/distributions/gradle-6.8-bin.zip #7 5.394 ..........10%..........20%..........30%...........40%..........50%..........60%..........70%...........80%..........90%..........100% #7 18.52 #7 18.52 Welcome to Gradle 6.8! #7 18.52 #7 18.52 Here are the highlights of this release: #7 18.52 - Faster Kotlin DSL script compilation #7 18.52 - Vendor selection for Java toolchains #7 18.52 - Convenient execution of tasks in composite builds #7 18.52 - Consistent dependency resolution #7 18.52 #7 18.52 For more details see https://docs.gradle.org/6.8/release-notes.html #7 18.52 #7 18.71 Starting a Gradle Daemon (subsequent builds will be faster) #7 78.61 #7 78.61 > Task :compileJava #7 78.61 Note: Some input files use or override a deprecated API. #7 78.61 Note: Recompile with -Xlint:deprecation for details. #7 84.51 #7 84.51 > Task :processResources #7 84.51 > Task :classes #7 84.91 > Task :jar #7 84.91 > Task :assemble #7 85.41 > Task :nodeSetup FAILED #7 85.41 #7 85.41 FAILURE: Build failed with an exception. #7 85.41 #7 85.41 * What went wrong: #7 85.41 Execution failed for task ':nodeSetup'. #7 85.41 > Could not resolve all files for configuration ':detachedConfiguration1'. #7 85.41 > Could not find org.nodejs:node:10.14.1. #7 85.41 Searched in the following locations: #7 85.41 - https://nodejs.org/dist/v10.14.1/ivy.xml #7 85.41 Required by: #7 85.41 project : #7 85.41 #7 85.41 * Try: #7 85.41 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. #7 85.41 #7 85.41 * Get more help at https://help.gradle.org #7 85.51 #7 85.51 Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. #7 85.51 Use '--warning-mode all' to show the individual deprecation warnings. #7 85.51 See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings #7 85.51 #7 85.51 BUILD FAILED in 1m 21s4 actionable tasks: 4 executed #7 85.51 ```

I'm in the same issue (related to nodejs), but it seems that we need to define the required version of the nodejs as we have nodejs in 16.7 and this project uses nodejs 10.14.1. Alpine Linux deletes old versions of the packages in the package index. So, I think that we should use other distribution like ubuntu, I'm testing that.

cleberjamaral commented 3 years ago

Sorry, I forgot that the branch should be merged to master first.

@DougTrajano, just to test it before merging, please in your local Dockerfile (this file is at the root folder of jacamo-web project), please change the following piece of code as below (note that you have to add "-b fix-docker"):

RUN git clone -b fix-docker https://github.com/jacamo-lang/jacamo-web.git && \
    cd jacamo-web && \
    ./gradlew run # To deploy on heroku, use build instead