Make UI module independent sub-project - #4650
Conversation
8157a60 to
d17d65e
Compare
dsmiley
left a comment
There was a problem hiding this comment.
I think we should use the same gradle wrapper, at least.
It's not clear how new master Solr build acquires the UI artifacts to serve.
It is not clear because it is not solved yet. 🫤 I haven't figured it out yet how to do that the proper way (e.g. where can we publish artifacts, how to build it in advance for a release, how to retrieve artifacts?). I wanted to look into the solution we use for lucene and see if it can be reliably used for the UI in releases as well. Another thing that I am unsure is all the licensing stuff. We would have to treat it completely different. I believe the best option we have is to display open-source licenses in the UI somewhere, but for that we would have to retrieve them first. All the project configurations are removed, which is both a blessing and a curse as you can see. If you have any input on how to solve specific issues, feel free to leave a comment or commit to this PR. Happy to colaborate on this one. :) |
|
Does this need to be a new top-level folder? The old prometheus-exporter was a separate build but lived under |
|
I like the convenience During a release the UI will need to be built before the main tarball and then included in the main tarball. But do we need to release the UI in downloads.apache.org as well? I don't think so, as long as it is evident that the embedded wasm UI was built from the same commit as the main server. Having a nightly CI job a pre-built UI assembly to nightlies for the common branches provides a nice default fallback for those who just want to play around with local build. If you do cutting edge UI dev or if you want to build a PR branch or an older commit than latest nightly, you may need to re-build UI locally anyway. |
I believe for the jvm standalone client it would make sense to publish it to downloads.apache.org. For the wasmJs that is included in the Solr distribution I would add a guard where the release manager is forced to build from source / same commit. This will avoid the need of managing just another release voting for UI publications, right?
Yeah, devs working on UI or people testing newest changes can always build from source. The rest can pick a commit that has been published on nightlies and bypass the build hassle. I haven't finished nor tested the changes yet, as I have to update the jenkins nightly build to see if the fetch works as expected. I will also update the directory if it is preferred to be placed under |
b0cc3bd to
ddb1933
Compare
ddb1933 to
ad5d83c
Compare
b5f0f61 to
051fb19
Compare
|
In another PR I will enable spotless checks on the UI module and address the indentation to change it to 2 spaces as it is configured project-wide. |
dsmiley
left a comment
There was a problem hiding this comment.
Can we publish a normal durable released version and reference that? The nighties hash references are going to need to be updated often maybe and will probably get purged.
de3544f to
d7ad502
Compare
48c7d59 to
03a446f
Compare
See discussion https://lists.apache.org/thread/onc0zyyp8tjoj3fdg3bmpnh9cqsgjhy6
Description
We have noticed slow build times and problems related to the Admin UI module that requires developers to disable the module entirely, which led to other dependency resolution issues.
This PR attempts to separate the module from the rest of the project by making it an independent sub-project.
Solution
The approach that was picked is a completely independent gradle project. Some important changes:
solrmodules are removed, allowing the UI module to use simpler buildsWe should evaluate before merging which of the configurations or routines we want to keep and apply to this module as well. We may also keep it as is since the Admin UI is still experimental.
The module is no longer included as a configuration or task dependency as implemented before. Instead, the webapp now has to fetch the UI artifacts from https://nightlies.apache.org/solr/ui/wasm/[commit-hash]/.
Developers can call
./gradlew dev -Psolr.ui.buildFromSource=trueto build the UI module locally and include the artifacts from the current state, or alternatively define a commit (and optionally a checksum for validation) in thegradle/solr-ui.propertiesto download the UI bundle from the nightlies server.A guard has been added for specific release tasks that prevents using a nightly build artifact, and forces the UI to be built from source.
The jenkins job https://ci-builds.apache.org/job/Solr/job/solr-ui-wasm-assemble/ is building and deploying a version of the project. Right now it is executed manually on this branch, but it can be updated once this is merged to run from main.
I chose running the jenkins job manually so that we can pin down a commit hash and avoid spamming the nightlies with bundles. But we can switch to daily builds too if we prefer that. THe zip size is about 5MB large.
Important Note: This PR introduces a new flag for building the UI module from source, replacing the previously configured
productionflag ingradle.properties. The flag defaults tofalserequiring the user to either set it totrueor provide a commit hash for download wasmJs. The PR uses the hash from the PR branch, which will no longer match a commit hash on main once this PR is squashed and merged.Tests
The changes can be tested by adding these lines to your
gradle.propertiesfile:And run
./gradlew dev. This should download the zip file from https://nightlies.apache.org/solr/ui/wasm/473a55ef64a9a1605e00eb6c1c386887d4cb7dac/ and build the webapp with a pre-built version of the new UI, while verifying the download with the provided checksum.Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.