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

Alternative installation method? #1630

Open
erikgb opened this issue Jul 27, 2021 · 8 comments
Open

Alternative installation method? #1630

erikgb opened this issue Jul 27, 2021 · 8 comments

Comments

@erikgb
Copy link

erikgb commented Jul 27, 2021

I am trying to build a container image for cruise-control based on a multi-stage Dockerfile build. Our CI-server (trying to build the image) does not have direct access to the Internet, but has to go through a corporate proxy (Artifactory). I have been trying to use the offical installation doc, but I seem to be hitting a missing feature in Gradle: gradle/gradle#1038 - as I am trying to override the (non-accessible) repositories from an init script.

Any tips? Have you ever considered providing a tar.gz assembly as part of your releases? It would have made my task of building a container image a lot easier. 😉

@tomncooper
Copy link
Contributor

tar.gz files are already produced as part of the releases?

@erikgb
Copy link
Author

erikgb commented Aug 6, 2021

@tomncooper Isn't it just the source code that is provided as part of the tar.gz and zip files? Or am I reading this wrong? I am looking for a tar.gz that contains everything I would need to run cruise-control.

@erikgb
Copy link
Author

erikgb commented Aug 6, 2021

It seems like circleci is used as CI tool in this project. Could the following blog post be used as a starting point for my wish? I'll be happy to contribute, but I think a project team member with elevated permissions is required to test/verify....

@erikgb
Copy link
Author

erikgb commented Aug 7, 2021

I have never used gradle before, but I tried to hack something that seems to create the distribution(s) I am looking for: erikgb@247ff70.

Running ./gradlew assembleDist creates build/distributions/cruise-control-2.0.181-SNAPSHOT.tar.gz (and also the equivalent zip variant - for Windows users). This is the artifact I would like to see produced as part of the releases.

There are some "broken" classpath-entries (ref. ./kafka-cruise-control-start.sh) , since I decided to put all jar files into the cruise-control/build/dependant-libs/ directory. I didn't want to modify the startup-script in this round, but this can of course be improved.

I have verified that I can unpack this archive (somewhere else), and start cruise-control with the normal ./kafka-cruise-control-start.sh config/cruisecontrol.properties.

I have neither used circleci before, but I could try to prepare a PR for building and attaching these distributions to the release build. But I will not be able to test and verify this - since it is only part of the release builds. WDYT @efeg?

@erikgb
Copy link
Author

erikgb commented Aug 8, 2021

For the record, this is what happens if I try to follow the documented installation:

  1. Initiate a multi-stage docker build; using gradle:6.9-jre11 as my build image
  2. Download the cruise-control release (source) tarball through our GitHub download proxy and "Initialize the local repo" as documented (0./ii.).
  3. Run an adjusted gradle-command to get the dependent libs: gradle --init-script /home/gradle/.gradle/init.gradle --no-daemon --info jar copyDependantLibs

The last step fails with the following error:

Compiling settings file '/cruise-control/settings.gradle' using SubsetScriptTransformer.
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all artifacts for configuration 'classpath'.
> Could not resolve org.apache.httpcomponents:httpclient:4.5.13.
  Required by:
      unspecified:unspecified:unspecified
   > Could not resolve org.apache.httpcomponents:httpclient:4.5.13.
      > Could not get resource 'https://plugins.gradle.org/m2/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.pom'.
         > Could not GET 'https://plugins.gradle.org/m2/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.pom'.
            > Connect to plugins.gradle.org:443 [plugins.gradle.org/104.18.191.9, plugins.gradle.org/104.18.190.9] failed: Connection refused (Connection refused)
> Could not resolve gradle.plugin.net.vivin:gradle-semantic-build-versioning:4.0.0.
  Required by:
      unspecified:unspecified:unspecified
   > Could not resolve gradle.plugin.net.vivin:gradle-semantic-build-versioning:4.0.0.
      > Could not get resource 'https://plugins.gradle.org/m2/gradle/plugin/net/vivin/gradle-semantic-build-versioning/4.0.0/gradle-semantic-build-versioning-4.0.0.pom'.
         > Could not GET 'https://plugins.gradle.org/m2/gradle/plugin/net/vivin/gradle-semantic-build-versioning/4.0.0/gradle-semantic-build-versioning-4.0.0.pom'.
            > Connect to plugins.gradle.org:443 [plugins.gradle.org/104.18.191.9, plugins.gradle.org/104.18.190.9] failed: Connection refused (Connection refused)
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org

Regarding init.gradle, I have been trying a lot of different things that people in the gradle-community are posting on the Internet. It seems like issues using enterprise proxies with gradle is quite common. 😓 But currently it looks like this:

allprojects {
    buildscript {
        repositories.clear()
        repositories {
            maven { url "<our company Maven proxy URL>" }
        }
    }

    repositories.clear()
    repositories {
        maven { url "<our company Maven proxy URL>" }
    }
}

settingsEvaluated { settings ->
    settings.buildscript {
        repositories.clear()
        repositories {
            maven { url "<our company Maven proxy URL>" }
        }
    }
    settings.pluginManagement {
        repositories.clear()
        repositories {
            maven { url "<our company Maven proxy URL>" }
        }
    }
}

If you have any suggestions or workarounds, please let me know!

@flyskywhy
Copy link

Can resolve it with dependencyResolutionManagement as described in https://stackoverflow.com/a/76337036/6318705 , in a word, just add below into settings.gradle:

// ref to https://docs.gradle.org/7.5.1/userguide/declaring_repositories.html#sub:centralized-repository-declaration
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        maven { url "<our company Maven proxy URL>" }
    }
}

@woile
Copy link

woile commented Oct 3, 2023

Any plans to provide a jar as part of the release? It would make it really easy to get started with cruise-control., whether it's creating a Dockerfile or running it locally, specially for non-java people.

@imans777
Copy link

any updates? I've been struggling for more than a week to get this built in an offilne environment, but I keep getting errors and errors and I'm advancing like turtle... 🐢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants