-
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
When running Invoker on "Bare-Metal" it cannot read log files #3195
Comments
…d get the rootpath from it.
Containers is hardcoded, right, but the only thing that matters is that you mount the proper local container directory to that directory in the container. Why would you need to configure that? |
What if you're not running the invoker as a container? Why can't you just run it on the server directly? |
Ahhhhh, sorry. I misread your intro, my bad. Right in that case you'll need to tweak that value. Out of curiosity (and not necessarily related to your issue): If you're using docker compose in general and also install docker on the machine itself, why do you choose to run the invoker on the machine "natively". |
For my Dev environment. It lets me build and debug the invoker more
quickly.
On Wed, Jan 17, 2018 at 4:28 PM Markus Thömmes ***@***.***> wrote:
Ahhhhh, sorry. I misread your intro, my bad. Right in that case you'll
need to tweak that value. Out of curiosity (and not necessarily related to
your issue): If you're using docker compose in general and also install
docker on the machine itself, why do you choose to run the invoker on the
machine "natively".
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3195 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACHV52BzoSqhltWYhNtNvSB1wzxumuXks5tLmYOgaJpZM4Rhwrf>
.
--
snet from a itny keybaord
|
@mcdan I tried to track that down and it appears to be coming in collectLogs calling itself. Following rough patch demonstrates and fixes that. The issue appears to during materializing of the source in call to Index: core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala (revision 925500cf8d34bb75bebd077ea057af236eba0b01)
+++ core/invoker/src/main/scala/whisk/core/containerpool/ContainerProxy.scala (date 1516298930000)
@@ -38,6 +38,8 @@
import whisk.core.entity.ExecManifest.ImageName
import whisk.http.Messages
+import scala.util.Try
+
// States
sealed trait ContainerState
case object Uninitialized extends ContainerState
@@ -380,18 +382,25 @@
val activationWithLogs: Future[Either[ActivationLogReadingError, WhiskActivation]] = activation
.flatMap { activation =>
val start = tid.started(this, LoggingMarkers.INVOKER_COLLECT_LOGS)
- collectLogs(tid, job.msg.user, activation, container, job.action)
- .andThen {
- case Success(_) => tid.finished(this, start)
- case Failure(t) => tid.failed(this, start, s"reading logs failed: $t")
- }
- .map(logs => Right(activation.withLogs(logs)))
- .recover {
- case LogCollectingException(logs) =>
- Left(ActivationLogReadingError(activation.withLogs(logs)))
- case _ =>
- Left(ActivationLogReadingError(activation.withLogs(ActivationLogs(Vector(Messages.logFailure)))))
- }
+ Try(
+ collectLogs(tid, job.msg.user, activation, container, job.action)
+ .andThen {
+ case Success(_) => tid.finished(this, start)
+ case Failure(t) => tid.failed(this, start, s"reading logs failed: $t")
+ }
+ .map(logs => Right(activation.withLogs(logs)))
+ .recover {
+ case LogCollectingException(logs) =>
+ Left(ActivationLogReadingError(activation.withLogs(logs)))
+ case _ =>
+ Left(ActivationLogReadingError(activation.withLogs(ActivationLogs(Vector(Messages.logFailure)))))
+ }) match {
+ case Success(e) => e
+ case Failure(t) =>
+ tid.failed(this, start, s"reading logs failed: $t")
+ Future.successful(
+ Left(ActivationLogReadingError(activation.withLogs(ActivationLogs(Vector(Messages.logFailure))))))
+ }
}
// Storing the record. Entirely asynchronous and not waited upon.
Index: tests/src/test/scala/whisk/core/containerpool/test/ContainerProxyTests.scala
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/src/test/scala/whisk/core/containerpool/test/ContainerProxyTests.scala (revision 925500cf8d34bb75bebd077ea057af236eba0b01)
+++ tests/src/test/scala/whisk/core/containerpool/test/ContainerProxyTests.scala (date 1516299060000)
@@ -507,6 +507,41 @@
}
}
+ it should "complete the transaction and destroy the container if log reading failed terminally - v2" in {
+ val container = new TestContainer
+ val factory = createFactory(Future.successful(container))
+ val acker = createAcker
+ val store = createStore
+ val collector = LoggedFunction {
+ (transid: TransactionId,
+ user: Identity,
+ activation: WhiskActivation,
+ container: Container,
+ action: ExecutableWhiskAction) =>
+ throw new Exception
+ }
+
+ val machine =
+ childActorOf(ContainerProxy.props(factory, acker, store, collector, InstanceId(0), pauseGrace = timeout))
+ registerCallback(machine)
+ machine ! Run(action, message)
+ expectMsg(Transition(machine, Uninitialized, Running))
+ expectMsg(ContainerRemoved) // The message is sent as soon as the container decides to destroy itself
+ expectMsg(Transition(machine, Running, Removing))
+
+ awaitAssert {
+ factory.calls should have size 1
+ container.initializeCount shouldBe 1
+ container.runCount shouldBe 1
+ collector.calls should have size 1
+ container.destroyCount shouldBe 1
+ acker.calls should have size 1
+ acker.calls(0)._2.response shouldBe ActivationResponse.success()
+ store.calls should have size 1
+ store.calls(0)._2.logs shouldBe ActivationLogs(Vector(Messages.logFailure))
+ }
+ }
+
it should "resend the job to the parent if resuming a container fails" in within(timeout) {
val container = new TestContainer {
override def resume()(implicit transid: TransactionId) = { With this following log entry is seen
|
…d get the rootpath from it.
* Simplify error handling code * Change how data location is calculated to avoid performance issue
@mcdan This is because invoker tries to access So if you run your intelliJ IDE as a root user, you can run invoker as well. I hope this would be helpful. |
I'm taking another stance at this and I'm stuck at getting the invoker to communicate with action containers. More details here: docker/for-mac#171 . My current thinking is to provide a simple ContainerFactoryProvider that exposes action container's port The logging issue would still there, unless ... |
I've placed my changes in #4142 |
Closing as stale. |
Steps to reproduce the issue:
Open Whisk cannot read the log files as /containers is hardcoded into the invoker's docker container pool:
https://github.com/apache/incubator-openwhisk/blob/a6a782f7d3a409c542c157e4be46074ef69a67ce/core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainerFactory.scala#L43
and
https://github.com/apache/incubator-openwhisk/blob/a6a782f7d3a409c542c157e4be46074ef69a67ce/core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerClientWithFileAccess.scala#L41-L42
Additional information you deem important:
The text was updated successfully, but these errors were encountered: