Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions for dokkaMultiModuleHtml times out (6+ hours) #2255

Open
TheNewJavaman opened this issue Dec 1, 2021 · 8 comments
Open

GitHub Actions for dokkaMultiModuleHtml times out (6+ hours) #2255

TheNewJavaman opened this issue Dec 1, 2021 · 8 comments
Labels

Comments

@TheNewJavaman
Copy link

TheNewJavaman commented Dec 1, 2021

Describe the bug
Generating docs through GitHub Actions doesn't finish for a multimodule multiplatform gradle project

Affected repository

Expected behaviour
I used the exact same steps on my local machine, and dokka generates html docs correctly

Screenshots

Logs
2021-12-01T07:20:39.6419192Z ##[group]Run ./gradlew dokkaHtmlMultiModule
2021-12-01T07:20:39.6420115Z �[36;1m./gradlew dokkaHtmlMultiModule�[0m
2021-12-01T07:20:39.6466108Z shell: /usr/bin/bash -e {0}
2021-12-01T07:20:39.6466773Z env:
2021-12-01T07:20:39.6467486Z   JAVA_HOME: /opt/hostedtoolcache/Java_Adopt_jdk/11.0.11-9/x64
2021-12-01T07:20:39.6468259Z ##[endgroup]
2021-12-01T07:20:41.3431956Z Downloading https://services.gradle.org/distributions/gradle-7.3-bin.zip
2021-12-01T07:20:44.7040880Z ...........10%...........20%...........30%...........40%...........50%...........60%...........70%...........80%...........90%...........100%
2021-12-01T07:20:46.2778306Z 
2021-12-01T07:20:46.2780816Z Welcome to Gradle 7.3!
2021-12-01T07:20:46.2782110Z 
2021-12-01T07:20:46.2783581Z Here are the highlights of this release:
2021-12-01T07:20:46.2785850Z  - Easily declare new test suites in Java projects
2021-12-01T07:20:46.2787571Z  - Support for Java 17
2021-12-01T07:20:46.2789143Z  - Support for Scala 3
2021-12-01T07:20:46.2790580Z 
2021-12-01T07:20:46.2848088Z For more details see https://docs.gradle.org/7.3/release-notes.html
2021-12-01T07:20:46.2849229Z 
2021-12-01T07:20:46.6733008Z Starting a Gradle Daemon (subsequent builds will be faster)
2021-12-01T07:21:57.7761617Z 
2021-12-01T07:21:57.7803262Z > Task :api:dokkaHtmlPartial
2021-12-01T07:21:57.7927895Z Initializing plugins
2021-12-01T07:21:57.8732537Z Dokka is performing: documentation for api
2021-12-01T07:21:57.8734665Z Validity check
2021-12-01T07:21:57.8738843Z Creating documentation models
2021-12-01T07:22:02.8731968Z Transforming documentation model before merging
2021-12-01T07:22:02.8737715Z Merging documentation models
2021-12-01T07:22:02.8738692Z Transforming documentation model after merging
2021-12-01T07:22:02.9738634Z Creating pages
2021-12-01T07:22:03.1731048Z Transforming pages
2021-12-01T07:22:03.2730545Z Rendering
2021-12-01T07:22:05.6749737Z Running post-actions
2021-12-01T07:22:05.7730512Z 
2021-12-01T07:22:19.5744287Z 
2021-12-01T07:22:19.5775740Z > Task :api:compileKotlinJvm
2021-12-01T07:22:19.5778557Z > Task :api:jvmProcessResources NO-SOURCE
2021-12-01T07:22:19.5779200Z > Task :api:jvmMainClasses
2021-12-01T07:22:19.6730669Z > Task :api:jvmJar
2021-12-01T07:22:21.3733822Z > Task :api:compileKotlinMetadata
2021-12-01T07:22:21.3751845Z > Task :api:metadataMainClasses
2021-12-01T07:22:21.3752784Z > Task :api:metadataJar
2021-12-01T07:22:23.3730888Z 
2021-12-01T07:22:23.3733108Z > Task :ibmq-provider:dokkaHtmlPartial
2021-12-01T07:22:23.3734130Z Initializing plugins
2021-12-01T07:22:23.3736451Z Dokka is performing: documentation for ibmq-provider
2021-12-01T07:22:23.3737165Z Validity check
2021-12-01T07:22:23.3737700Z Creating documentation models
2021-12-01T07:22:26.9730099Z Transforming documentation model before merging
2021-12-01T07:22:27.6730504Z Merging documentation models
2021-12-01T07:22:27.6731279Z Transforming documentation model after merging
2021-12-01T07:22:27.6731911Z Creating pages
2021-12-01T07:22:27.8730423Z Transforming pages
2021-12-01T07:22:30.9735811Z 
2021-12-01T07:22:30.9738064Z Daemon will be stopped at the end of the build after running out of JVM memory
2021-12-01T07:22:32.6730416Z 
2021-12-01T07:22:32.6732881Z > Task :ibmq-provider:dokkaHtmlPartial FAILED
2021-12-01T07:22:32.6733644Z 
2021-12-01T13:20:47.6275524Z ##[error]The operation was canceled.
2021-12-01T13:20:47.6398968Z Post job cleanup.
2021-12-01T13:20:47.8051280Z Post job cleanup.
2021-12-01T13:20:47.9409730Z [command]/usr/bin/git version
2021-12-01T13:20:47.9464944Z git version 2.34.0
2021-12-01T13:20:47.9502732Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-12-01T13:20:47.9546468Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-12-01T13:20:47.9810375Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-12-01T13:20:47.9841243Z http.https://github.com/.extraheader
2021-12-01T13:20:47.9851492Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2021-12-01T13:20:47.9889260Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-12-01T13:20:48.0206517Z Cleaning up orphan processes
2021-12-01T13:20:48.0426703Z Terminate orphan process: pid (1574) (java)
2021-12-01T13:20:48.0461180Z Terminate orphan process: pid (1611) (java)
2021-12-01T13:20:48.0493816Z Terminate orphan process: pid (1740) (java)

To Reproduce
To reproduce, fork the linked repository from above and run the docs workflow

Dokka configuration

Parent project build.gradle.kts
plugins {
    kotlin("multiplatform") version "1.6.0" apply false
    id("org.jetbrains.dokka") version "1.6.0"
}

repositories {
    mavenCentral()
}

tasks.dokkaHtmlMultiModule.configure {
    outputDirectory.set(rootDir.resolve("docs"))
}
Child project 1
plugins {
    kotlin("multiplatform")
    id("io.gitlab.arturbosch.detekt") version "1.19.0-RC2"
    id("org.jetbrains.dokka")
}

group = "net.javaman"
version = "0.1.0"

repositories {
    mavenCentral()
}

kotlin {
    jvm {
        val main by compilations.getting {
            kotlinOptions {
                jvmTarget = "11"
            }
        }
        val test by compilations.getting {
            kotlinOptions {
                jvmTarget = "11"
            }
        }
    }
    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(kotlin("stdlib-common"))
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.1")
            }
        }
        val jvmMain by getting
        val jvmTest by getting {
            dependencies {
                implementation("org.junit.jupiter:junit-jupiter:5.7.0")
            }
        }
    }
}

detekt {
    this.source = objects.fileCollection().from(
        "src/commonMain/kotlin",
        "src/jvmMain/kotlin",
        "src/jvmTest/kotlin"
    )
}

tasks.withType<Test> {
    useJUnitPlatform()
}
Child project 2
plugins {
    kotlin("multiplatform")
    kotlin("plugin.serialization") version "1.6.0"
    id("io.gitlab.arturbosch.detekt") version "1.19.0-RC2"
    id("org.jetbrains.dokka")
}

group = "net.javaman"
version = "0.1.0"

repositories {
    mavenCentral()
}

kotlin {
    jvm {
        val main by compilations.getting {
            kotlinOptions {
                jvmTarget = "11"
            }
        }
        val test by compilations.getting {
            kotlinOptions {
                jvmTarget = "11"
            }
        }
    }
    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(project(":api"))
                implementation("io.ktor:ktor-client-core:1.6.5")
                implementation("io.ktor:ktor-client-cio:1.6.5")
                implementation("io.ktor:ktor-client-serialization:1.6.5")
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.1")
            }
        }
        val jvmTest by getting {
            dependencies {
                implementation("org.junit.jupiter:junit-jupiter:5.7.0")
            }
        }
    }
}

detekt {
    this.source = objects.fileCollection().from(
        "src/commonMain/kotlin",
        "src/jvmTest/kotlin"
    )
}

tasks.withType<Test> {
    useJUnitPlatform()
}
GitHub Actions script
name: Publish Docs (Dokka)

on:
  push:
    branches: [ main ]
    
  workflow_dispatch:

jobs:
  docs:
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2
      
      - name: Cache gradle dependencies
        uses: actions/setup-java@v2
        with:
          java-version: '11'
          distribution: 'adopt'
          cache: gradle
      
      - name: Make gradlew executable
        run: chmod +x gradlew
      
      - name: Generate docs
        run: ./gradlew dokkaHtmlMultiModule
      
      - name: Add docs to git
        run: git add *
      
      - name: Stash docs changes
        run: git stash push
      
      - name: Switch to docs-pages branch
        run: git checkout docs-pages
      
      - name: Remove previous docs
        run: rm -rf docs
      
      - name: Pop docs stash
        run: git stash pop
      
      - name: Commit new docs
        run: git commit -m 'Updated docs'
      
      - name: Push docs to origin
        run: git push origin
Installation

  • Operating system: ubuntu-latest on GitHub Actions
  • Build tool: Gradle v7.3
  • Dokka version: 1.6.0

Additional context
I can give access to this project's actions if you would like, just comment that you need access.

Are you willing to provide a PR?
I don't know what's causing the issue

@TheNewJavaman
Copy link
Author

Based on these lines in the log, maybe gradle ran out of memory? I've seen dokka crash on my local machine because it ran out of memory

2021-12-01T07:22:23.3733108Z > Task :ibmq-provider:dokkaHtmlPartial
2021-12-01T07:22:23.3734130Z Initializing plugins
2021-12-01T07:22:23.3736451Z Dokka is performing: documentation for ibmq-provider
2021-12-01T07:22:23.3737165Z Validity check
2021-12-01T07:22:23.3737700Z Creating documentation models
2021-12-01T07:22:26.9730099Z Transforming documentation model before merging
2021-12-01T07:22:27.6730504Z Merging documentation models
2021-12-01T07:22:27.6731279Z Transforming documentation model after merging
2021-12-01T07:22:27.6731911Z Creating pages
2021-12-01T07:22:27.8730423Z Transforming pages
2021-12-01T07:22:30.9735811Z 
2021-12-01T07:22:30.9738064Z Daemon will be stopped at the end of the build after running out of JVM memory
2021-12-01T07:22:32.6730416Z 
2021-12-01T07:22:32.6732881Z > Task :ibmq-provider:dokkaHtmlPartial FAILED

@TheNewJavaman
Copy link
Author

Increasing gradle's memory fixed the issue:

gradle.properties

kotlin.code.style=official
org.gradle.jvmargs=-Xms2g

@TheNewJavaman
Copy link
Author

Leaving this open as a bug because no useful error message was outputted. Maybe add a logging message that suggests increasing gradle JVM memory?

@vmishenev
Copy link
Member

This is a known bug #1405 that will be fixed soon.

@yalishevant yalishevant added this to the Stable milestone Mar 24, 2022
@yalishevant
Copy link

Hi @TheNewJavaman, have you migrated to 1.7.20 Dokka? If so, could you please check if the issue still exists? We have done some optimisations in memory consumption.

@TheNewJavaman
Copy link
Author

@yalishevant I no longer work on the project that used Dokka, so I'm not sure if I'll have time to go back and test this. If verifying the fix is important to you, please feel free to fork github.com/TheNewJavaman/brac-kt, remove org.gradle.jvmargs=-Xms2g from gradle.properties, and trigger the "Publish Docs (Dokka)" workflow in GitHub Actions.

@yalishevant
Copy link

сс @IgnatBeresnev

@atyrin
Copy link
Contributor

atyrin commented Dec 12, 2022

I've forked the project and migrated it to Dokka 1.7.20. The relevant GitHub action still fails/hangs on the default Gradle memory settings.

But more performance improvements will arrive in the 1.8.0 release: #2678

@IgnatBeresnev IgnatBeresnev removed this from the Stable milestone Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants