Skip to content

Add SPI for invoker#4453

Merged
rabbah merged 1 commit into
apache:masterfrom
style95:invoker-spi
May 2, 2019
Merged

Add SPI for invoker#4453
rabbah merged 1 commit into
apache:masterfrom
style95:invoker-spi

Conversation

@style95

@style95 style95 commented Apr 22, 2019

Copy link
Copy Markdown
Member

This is to allow multiple invoker implementations.
This is also a starting point to add new scheduler implementations described in https://cwiki.apache.org/confluence/display/OPENWHISK/New+architecture+proposal

Description

Related issue and scope

  • I opened an issue to propose and discuss this change (#????)

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

val producer = msgProvider.getProducer(config, Some(ActivationEntityLimit.MAX_ACTIVATION_LIMIT))
val invoker = try {
new InvokerReactive(config, invokerInstance, producer, poolConfig)
SpiLoader.get[InvokerProvider].instance(config, invokerInstance, producer, poolConfig, limitConfig)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered many options to apply SPI in invoker.
For example, it would be possible to keep InvokerReactive and apply SPI to ContainerPool and ContainerProxy level.
But I noticed that they are also highly dependent on InvokerReactive.
So it would be more natural to apply SPI at the highest level of implementation.
It will abstract and hide the fundamental implementation such as ContainerPool and ContainerProxy from the top level Invoker implementation.

Also, there could be some dependent RestAPI implementations corresponding to the Invoker implementation.
So I added SPI provider for InvokerServer which provides REST API as well.

case e: Exception => abort(s"Failed to initialize reactive invoker: ${e.getMessage}")
}

Scheduler.scheduleWaitAtMost(1.seconds)(() => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some invoker implementations, health checking may not be performed via Kafka.
So I moved this to InvokerReactive.

@style95 style95 closed this Apr 22, 2019
@style95 style95 reopened this Apr 22, 2019
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #4453 into master will decrease coverage by 4.57%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4453      +/-   ##
==========================================
- Coverage   85.33%   80.75%   -4.58%     
==========================================
  Files         170      170              
  Lines        7929     7935       +6     
  Branches      552      550       -2     
==========================================
- Hits         6766     6408     -358     
- Misses       1163     1527     +364
Impacted Files Coverage Δ
...la/org/apache/openwhisk/core/invoker/Invoker.scala 72.13% <100%> (+0.46%) ⬆️
...pache/openwhisk/core/invoker/InvokerReactive.scala 81.25% <80%> (-0.06%) ⬇️
...core/database/cosmosdb/RxObservableImplicits.scala 0% <0%> (-100%) ⬇️
...core/database/cosmosdb/CosmosDBArtifactStore.scala 0% <0%> (-95.46%) ⬇️
...sk/core/database/cosmosdb/CosmosDBViewMapper.scala 0% <0%> (-92.67%) ⬇️
...whisk/core/database/cosmosdb/CosmosDBSupport.scala 0% <0%> (-84.62%) ⬇️
...abase/cosmosdb/CosmosDBArtifactStoreProvider.scala 4% <0%> (-52%) ⬇️
...in/scala/org/apache/openwhisk/common/Counter.scala 40% <0%> (-20%) ⬇️
...penwhisk/core/database/cosmosdb/CosmosDBUtil.scala 81.81% <0%> (-15.16%) ⬇️
...nwhisk/core/database/cosmosdb/CosmosDBConfig.scala 94.11% <0%> (-5.89%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ecae17...f627db0. Read the comment docs.

@ddragosd ddragosd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @style95
LGTM

@dgrove-oss

dgrove-oss commented Apr 22, 2019

Copy link
Copy Markdown
Member

PG1 - 4149. No issues.

@dgrove-oss dgrove-oss added the pgapproved Pipeline has approved this change. label Apr 22, 2019
@style95

style95 commented Apr 23, 2019

Copy link
Copy Markdown
Member Author

@dgrove-oss
Could you guide me what PG is and how can I check the status of it?
IIRC, I heard it is another Jenkins machine.

@rabbah rabbah merged commit 6982f46 into apache:master May 2, 2019
BillZong pushed a commit to BillZong/openwhisk that referenced this pull request Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pgapproved Pipeline has approved this change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants