Hi All,
We want to extend the functionality of the Builder in Eclipse Che. and contribute it to the community.
This is needed for the cloud foundry environment, where there can be several builders across different spaces.
Currently Che allows registering builders by the access criteria
"builderServerAccessCriteria":
{
"project":
"",
"workspace":
""
}
And by matching this criteria together with default builder on project type the match is done. This is not enough and hence the motivation for contribution.
We thought of two options to extend this behavior, we’ll appreciate your feedback and help, later we will provide a pull request according to the feedback and discussion.
Option1:
Add another criteria to builder registration which will be a list of name-value , that later this will be used in builder selection logic
On registration add another criteria – list of name-value attributes
This DTO will be extended with a list of attributes:
https://github.com/codenvy/platform-api/blob/master/codenvy-api-builder/src/main/java/org/eclipse/che/api/builder/dto/BuilderServerRegistration.java
on build selection
https://github.com/codenvy/platform-api/blob/master/codenvy-api-builder/src/main/java/org/eclipse/che/api/builder/BuildQueue.java#L509
instead of using the current method of getBuilderList as is – we will enhance it (strategy) so different implementation can be injected by Guice
to allow different selection methods.
the current implementation for the general use will remain as today (select by workspace/project), but then we can add additional implementation that will deal with our specific
use case and attributes we passed in the registration step.
Option 2:
Che already has a BuilderSelectionStrategy class, that select a builder when it detects that there are more than one builder available
However the data in which the selection can be done seems limited to the data in the RemoteBuilder class
https://github.com/codenvy/che-core/blob/5c0c82c9defd2c08f52ee72126481f833c8718be/platform-api/che-core-api-builder/src/main/java/org/eclipse/che/api/builder/RemoteBuilder.java
so we probably need to extend the Remote Builder with a list of attributes
also the getEnvironment() method on the Builder class might help, so it will allow filter by Environment properties, but I didn’t exactly understand how it works, if anyone can
elaborate on this it will be great
Appreciate any input and help
Regards
Roy