Uploaded image for project: 'Serverless logic'
  1. Serverless logic
  2. SRVLOGIC-612

Maven wrapper download timeouts for image running in disconnected cluster

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • 1.37.0
    • 1.36.0
    • Cloud:Images
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      In disconnected cluster environments, the logic-swf-builder-rhel8 and logic-swf-devmode-rhel8 images are not able to download maven-wrapper that is required for the images to build and run the workflow applications.
      Available workarounds are provided in the JIRA description.
      Show
      In disconnected cluster environments, the logic-swf-builder-rhel8 and logic-swf-devmode-rhel8 images are not able to download maven-wrapper that is required for the images to build and run the workflow applications. Available workarounds are provided in the JIRA description.
    • Known Issue
    • +

      Summary
      In SRVLOGIC-528 was introduced maven wrapper downloader. Changes were done to install Maven wrapper for Maven 3.8.6. The maven wrapper is installed from public repo.maven.apache.org (see the properties configured - maven-wrapper.properties )

      Installation of maven-wrapper in disconnected cluster causes the `Connection timed out` exception during starting the build. Disconnected cluster does not have access outside and it is not possible to pull these resources, so build is not started.

      As these artifacts have hard-coded location in properties file and they are not part of pom, the MAVEN_MIRROR_URL does not affect this.


      Environment
      OpenShift Disconnected 4.16 running in AWS
      Mirrored images for 1.36.0.CR1 build
       

      Steps to reproduce

      1. Create a simple workflow (e.g. greeting)
      2. Deploy it in preview mode into OCP with Operator

      Actual results
      Build failing with following exception:

      [1/2] STEP 7/7: RUN /home/kogito/launch/build-app.sh ./resources
      INFO -> Copying files from /home/kogito/serverless-workflow-project/resources, if any...
      INFO -> Destination folder is /home/kogito/serverless-workflow-project/src/main/resources/
      '/home/kogito/serverless-workflow-project/resources/Dockerfile' -> '/home/kogito/serverless-workflow-project/src/main/resources/Dockerfile'
      '/home/kogito/serverless-workflow-project/resources/application-prod.properties' -> '/home/kogito/serverless-workflow-project/src/main/resources/application-prod.properties'
      '/home/kogito/serverless-workflow-project/resources/application.properties' -> '/home/kogito/serverless-workflow-project/src/main/resources/application.properties'
      '/home/kogito/serverless-workflow-project/resources/greeting.sw.json' -> '/home/kogito/serverless-workflow-project/src/main/resources/greeting.sw.json'
      INFO Configure Maven
      INFO --> checking if .mvn/jvm.config exists.
      INFO ---> .mvn/jvm.config does not exists, memory will be calculated based on container limits.
      Exception in thread "main" java.net.ConnectException: Connection timed out
      	at java.base/sun.nio.ch.Net.connect0(Native Method)
      	at java.base/sun.nio.ch.Net.connect(Net.java:579)
      	at java.base/sun.nio.ch.Net.connect(Net.java:568)
      	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)
      	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
      	at java.base/java.net.Socket.connect(Socket.java:633)
      	at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
      	at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:174)
      	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
      	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533)
      	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:638)
      	at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
      	at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
      	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
      	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1257)
      	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1143)
      	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
      	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1702)
      	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626)
      	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
      	at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:100)
      	at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:86)
      	at org.apache.maven.wrapper.Installer.createDist(Installer.java:84)
      	at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:160)
      	at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:73)
      error: build error: building at STEP "RUN /home/kogito/launch/build-app.sh ./resources": while running runtime: exit status 1
       

      Expected results

      Build passes without any exception

      Workaround

      Exists, only for builder image. It is not trivial

      Steps for builder:

      1. Into the mirror registry upload the artifacts from distributionUrl and wrapperUrl that are used in maven-wrapper.properties file
      2. Update the build dockerfile to replace the repo url in maven-wrapper.properties
        RUN sed -i "s|https://repo.maven.apache.org/maven2|<your-mirror-registry-that-ocp-disconnected-can-use>|"  /usr/share/maven/bin/.mvn/wrapper/maven-wrapper.properties
        
      3. Rebuild the sonataflow

      Steps for devmode image

      1. Into the mirror registry upload the artifacts from distributionUrl and wrapperUrl that are used in maven-wrapper.properties file
      2. Add to the devmode running sonataflow definition env variable `MVNW_REPOURL` for pod template to change the url for download
          podTemplate: 
            container: 
              env: 
                - name: MAVEN_MIRROR_URL
                  value: '<your-mirror-registry-that-ocp-disconnected-can-use>'
                - name: MVNW_REPOURL
                  value: '<your-mirror-registry-that-ocp-disconnected-can-use>'
        
      3. Check the running devmode image

      Workaround 2 for builder image (this one is easier and similar to devmode workaround)

      1. Into the mirror registry upload the artifacts from distributionUrl and wrapperUrl that are used in maven-wrapper.properties file
      2. First, create SonataflowPlatform with set-up build template env variable for `MVNW_REPOURL`
        spec: 
          build: 
            template: 
              envs: 
                - name: MAVEN_MIRROR_URL
                  value: '<your-mirror-registry-that-ocp-disconnected-can-use>'
                - name: MVNW_REPOURL
                  value: '<your-mirror-registry-that-ocp-disconnected-can-use>'
        
      3. Create a new preview workflow (e.g. greetings)
      4. Check that build passes

      Testing
      Covered by manual test in test plan.

              wmedvede@redhat.com Walter Medvedeo
              jakubschwan Jakub Schwan
              Jakub Schwan Jakub Schwan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: