-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/refactor and support dashboard for baker (#1304)
* - Renamed BakeryExecutorJava to BakerResultToHttpResponseMapper - For BakerService and BakerResultToHttpResponseMapper, the 'callBaker' method is renamed to 'toBakerResultResponseIO' and 'toBakerResult' respectively. This more accurately describes what the method does. - Renamed BakerService to Http4sBakerServer - Split up bakery-state into bakery-state and baker-http-server. The idea is that baker-http-server can be used to expose baker endpoints (which can be then used for bakery but also for non-bakery APIs to use for the dashboard for example). - Moved baker-client, baker-server and dashboard from the bakery directory to http. * - Refactor BakerResultToResponseMapper into a separate InstanceResponseMapper. * Update dashboard project: - Static files are now added as resources in new jar artifact. - Added com.ing.baler.http.Dashboard object to safely access these static files. - Updated Http4sBakerServer to use this new way of accessing the dashboard. - Replaced dashboard-path property with enable-dashboard to reflect these changes. - No longer separately copy dashboard files into docker image. * - Cache npm build. * - Added documentation for the caching of the npmBuildTask - Added the distDirectory as something to be cleaned with clean command. * - Refactored Http4sBakerServer to have a routes method available seperately from the resource. - Created Htpp4sBakerServerSpec to test routes - Created a dashboard_config endpoint, since the settings.json is no longer available (that is now configured in the baker.dashboard property). - Enable publishing of the source code. * - Fixed structure of versionJson. - Fixed serving static files not working. * - Seperated Http4sBakerServer configuration loading into Http4sBakerServerConfiguration class. - Adding server specific configuration in reference.conf in server project. - Created a java-friendly constructor for the Http4sBakerServer. * - Reverted the field name to what it was, since it sometimes is accessed through reflection, even though it is private. - Instead made a new accessor so that this is not required anymore. * - Added some documentation to the 3 main subdirectories * - Updated packages in configuration. * - Fixed data model of recipe response. - Added some comments for fixing test issues. * - Add all routes to http4sbakerserver * - Make matching scala.2.12 compatible. * - Updated code based on review comments. - Added example code to main project, so they are run and compiled after changes. - Fixed example projects not working correctly. - Fixed test cases in baker-example not closing actor system correctly, causing them to only be able to run separately. * - Add noPublish to examples. * Fixed the BuildExampleDocker command. * - Try with parallel execution off. * Changed WebShop recipe test to use inmemory baker to have more stable tests. * - Remove event sink from test resource conf. Co-authored-by: Wessel W. Bakker <[email protected]> Co-authored-by: XK00LJ <[email protected]>
- Loading branch information
1 parent
fad540e
commit 5bbcf00
Showing
141 changed files
with
1,075 additions
and
624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The `bakery` directory contains modules for setting up a bakery cluster. | ||
|
||
Bakery is a way to host a baker service using akka-runtime and expose it using API endpoints. This allows you to separate | ||
the running of an akka cluster and managing of the persistence from using baker for your business process. | ||
|
||
A bakery team can provide baker clusters as a service (which requires specific knowledge about akka clusters). | ||
A client team can focus on creating recipes based on actual business processes. | ||
|
||
The `bakery-state` module is the entry point for bakery. |
22 changes: 0 additions & 22 deletions
22
bakery/client/src/test/java/com/ing/bakery/client/JBakerClientSpec.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 7 additions & 10 deletions
17
...com/ing/bakery/baker/ClosableBakery.scala → ...scala/com/ing/bakery/ClosableBakery.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,31 @@ | ||
package com.ing.bakery.baker | ||
package com.ing.bakery | ||
|
||
import java.io.Closeable | ||
import akka.actor.ActorSystem | ||
import cats.effect.IO | ||
import com.ing.baker.runtime.model.InteractionManager | ||
import com.ing.baker.runtime.recipe_manager.RecipeManager | ||
import com.ing.baker.runtime.scaladsl.Baker | ||
import com.ing.bakery.baker.Bakery.resource | ||
import com.ing.bakery.Bakery.akkaBakery | ||
import com.typesafe.config.Config | ||
|
||
import scala.concurrent.ExecutionContext | ||
import java.io.Closeable | ||
|
||
class ClosableBakery(baker: Baker, | ||
executionContext: ExecutionContext, | ||
system: ActorSystem, | ||
close: IO[Unit]) extends Bakery(baker, executionContext, system) with Closeable { | ||
close: IO[Unit]) extends AkkaBakery(baker, system) with Closeable { | ||
override def close(): Unit = close.unsafeRunSync() | ||
} | ||
|
||
object ClosableBakery { | ||
/** | ||
* Create bakery instance as external context | ||
* @param externalContext optional external context in which Bakery is running, e.g. Spring context | ||
* @return | ||
*/ | ||
def instance(optionalConfig: Option[Config], | ||
externalContext: Option[Any], | ||
interactionManager: Option[InteractionManager[IO]] = None, | ||
recipeManager: Option[RecipeManager] = None): ClosableBakery = { | ||
val (baker: Bakery, close: IO[Unit]) = resource(optionalConfig, externalContext, interactionManager, recipeManager).allocated.unsafeRunSync() | ||
new ClosableBakery(baker.baker, baker.executionContext, baker.system, close) | ||
val (baker: AkkaBakery, close: IO[Unit]) = akkaBakery(optionalConfig, externalContext, interactionManager, recipeManager).allocated.unsafeRunSync() | ||
new ClosableBakery(baker.baker, baker.system, close) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.