I'm responsible for curating open source for a project that uses Elasticsearch and Kibana. My specific group requires us to start with source code for the product and ALL dependencies and build the final binaries OFFLINE.
I may have figured out how to build Elasticsearch. Download and archive source for Elasticsearch and Gradle, let Gradle download hundreds of Java modules (jar/pom) and archive them, then place it all into a single container and build away. I actually get installable packages in the end. Only have to process licenses for all the Java modules.
Kibana is easier in some regards but more difficult overall and likely the deal breaker.
-
Downloading Kibana source tarballs does not work in the build process. You need to clone the git repository since the build process runs some git commands and fails in an unclear manner. You can't use the tarball with a 'git init' method either. Must be a clone from what I can tell.
-
The CONTRIBUTING.md file steers users astray with unnecessary steps for starting Elasticsearch which discuss.elastic.co discussions clarify can be skipped, or populating Elasticsearch with data, or using a script for nvm to download node.js/npm. If the instructions said simple to a) download version x.y.z of node.js, b) cd to Kibana, c) run 'npm install', d) run 'npm update', e) ignore specific errors otherwise panic, then f) 'npm run build xxxxx' to get installable packages, I would have saved a few days. Bad instructions waste time and frustrate potential users/customers.
-
NPM installed cleanly, but the 'npm install' didn't install all dependencies without 'UNMET depencencies'. Even 'npm update' didn't resolve all the issues. The issue with grunt-angular-translate requiring grunt version 0.4.0 remains and the only discuss.elastic.co discussion suggested --force or ignoring the issue because some specific build target didn't hit the dependency. I wasted a lot of time here too thinking this grunt-angular-translate issue was the cause of all other issues. For curating open source software, npm is easy to work with for packages/versions/licenses.
- The instructions weren't clear what it takes to make an installable package. I guessed that it was 'npm run build -- --skip-os-packages'. During the build of that target with INTERNET connectivity, it appears to complete regardless of the error:
Loading "ui_framework.js" tasks...ERROR
Error: ENOENT: no such file or directory, scandir '/opt/kibana/git/kibana/node_modules/node-sass/vendor'
But it downloads more stuff!
Running "_build:downloadNodeBuilds" task
Downloading darwin-x86_64 and corresponding sha
Downloading linux-x86 and corresponding sha
Downloading windows-x86 and corresponding sha
Downloading linux-x86_64 and corresponding sha
darwin-x86_64 downloaded and verified
linux-x86 downloaded and verified
linux-x86_64 downloaded and verified
windows-x86 downloaded and verified
Where are my rpm/deb packages???
I've done a 'docker disable network bridge build_kibana' to keep the build from going to the Internet, but it fails. To me, this suggests NO support for building offline.
Running "_build:downloadNodeBuilds" task
Warning: Client request error: getaddrinfo EAI_AGAIN nodejs.org:443 Use --force to continue.
Using --force to see what else breaks, sure enough there is more Internet activity as these failures show:
Running "_build:downloadNodeBuilds" task
Warning: Client request error: getaddrinfo EAI_AGAIN nodejs.org:443 Used --force, continuing.
And:
Running "_build:installNpmDeps" task
Warning: Command failed: npm install --production --no-optional
npm ERR! git fetch -a origin (git://github.com/elastic/webpack.git) fatal: unable to connect to github.com:
npm ERR! git fetch -a origin (git://github.com/elastic/webpack.git) github.com: Temporary failure in name resolution
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git@github.com:elastic/webpack.git /root/.npm/_git-remotes/git-github-com-elastic-webpack-git-fix-query-params-for-aliased-loaders-696abd51: Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-elastic-webpack-git-fix-query-params-for-aliased-loaders-696abd51'...
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git@github.com:elastic/webpack.git /root/.npm/_git-remotes/git-github-com-elastic-webpack-git-fix-query-params-for-aliased-loaders-696abd51: error: cannot run ssh: No such file or directory
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror git@github.com:elastic/webpack.git /root/.npm/_git-remotes/git-github-com-elastic-webpack-git-fix-query-params-for-aliased-loaders-696abd51: fatal: unable to fork
In the end, it's still not clear how to make installable packages for Kibana. They are included in the official version of Kibana, so I assume there is a make option for them somewhere, but can't find it anywhere in the source distribution.
My take away is that by Elastic forcing the use of gradle/npm they move the responsibility of maintaining packages/versions/licenses to me, but with the added mess of a complicated build environment and lack of specific package/version manifests. We couldn't use the binary distribute before due to group policy, but now the binary distribution is out because the npm packages included in it are not identified clearly.
I don't mind doing a little work to benefit from a great product, but Elasticsearch and Kibana don't build or test cleanly due to the dynamic nature of these package eco-systems. I found little support for building these products after reading through CONTRIBUTING.md, included docs, web searches, Stack Exchange, and discuss.elastic.co.
Someone, please tell me I got it wrong...