-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Openwhisk in a standalone runnable jar #4516
Conversation
Refactor Controller such that actor system can be passed from outside
This ensures that standalone jar gets created as main artifact
This is an initial version to seek feedback on approach. Based on feedback we can decide what all aspects to support with this approach |
cool! |
Big +1 to this, great work! I do have a use case where we want to simulate OpenWhisk for local development of actions, looks like this would help a lot. |
This is required for test run to avoid launched server influenced by whisk.properties generated for the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! this is awesome.
@@ -285,8 +296,10 @@ class MemoryArtifactStore[DocumentAbstraction <: DocumentSerializer](dbName: Str | |||
} | |||
|
|||
override def shutdown(): Unit = { | |||
artifacts.clear() | |||
attachmentStore.shutdown() | |||
if (!ignoreShutdown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth commenting this - i dont understand why it would be necessary at face value.
Can we add a test for this in Jenkins? Like with lean - stand it up, create/run/delete a single action as a sniff test. |
This avoid superfluous log message about false inits
There are still some pending issues like getting log collection to work on Mac. For now implementing an approach which uses With that change the system test pass percentage improved
|
Yeah working on that. Its bit tricky to get it working in |
MemoryArtifactStore would always return same instance for same db name
Also ensure that a system property is only set if no existing value found. This ensures that in special case user can still supercede the value being set via explicitly providing a system property override
core/standalone/README.md
Outdated
$ ./gradlew :core:standalone:build | ||
``` | ||
|
||
This would create the runnable jar in `core/standalone/build/libs/` directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe gradle ...:run
to then start the built jar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Now you run the jar directly via $ ./gradlew :core:standalone:bootRun
Now it would show an error message like below
|
Now it marks it as warning |
…nerally named `whisk/` no pull would be done
Fixed that now by ensuring that eager pull is only done for |
Added |
…jar to bin directory
…n timeout failure
...nvoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerCliLogStore.scala
Show resolved
Hide resolved
A standalone controller, using the lean load balancer and an in memory store. * Use WhiskerControl port 3233 as default! * Allow disabling read of whisk.properties, required for test run to avoid launched server influenced by whisk.properties generated for the tests. Also ensure that a system property is only set if no existing value found. This ensures that in special case user can still supersede the value being set via explicitly providing a system property override. * Ensure that MemoryStore is only created when needed * Fetch logs via `docker logs` command on Mac * Add a OpenWhisk colored banner * Package the default runtimes.json * Include log timestamps and filter till sentinel * Use host.docker.internal as api host for Mac and Windows * Enable colored logging * Add support for --verbose flag to enable debug logging easily * Color transactionId and source also. Also support disabling color logging if needed * Expose extension point for format log message * Api host name is defined via system property * Add a set of pre flight checks to confirm if OpenWhisk can run properly on this host * Also check if docker is running * New StandaloneDockerContainerFactory which adapts as per OS * Only do pull for images having `openwhisk` prefix. For local image generally named `whisk/` no pull would be done * Add ./gradlew :core:standalone:bootRun command to run jar directly. Use Spring boot default bootRun target to run the jar. Also copy the jar to bin directory. * Make test run against standalone server * Support disabling pull of standard images all together. Required for test runs * Disable pause/resume support for non linux setups * Print the wsk and docker cli version * Update README with details on how to connect to db * Increase time allowed for server to start to 30 secs and log logs upon timeout failure * Enable verifySystemShutdown in Mesos tests
Enables running a minimal OpenWhisk (with in memory store) as a runnable jar outside of docker
Description
Currently users looking to explore OpenWhisk directly have few options like devtools docker compose, mini kube etc. This PR provides yet another option which enables launching a fully working OpenWhisk server via a runnable jar
This launches a fully functional OpenWhisk controller and invoker. You can run
wsk
commands against it and launch and execute actions etc.To try it out currently you can download a pre built jar from here
Design
This PR builds up on lean openwhisk support. It configures OpenWhisk to use a
MemoryArtifactStore
(thus avoiding nead of a separate CouchDB container) and enables executing the standardwsk
commands against itSee also the discussion thread
Key aspects
MemoryArtifactStore
Usage
First build the standalone module
In future
Launch the server
When to use
This mode may be benefical in cases like
Related issue and scope
My changes affect the following components
Types of changes
Checklist: