Skip to content

Commit e4345fe

Browse files
committed
Remove unnecessary feature
1 parent dc5ec36 commit e4345fe

File tree

25 files changed

+122
-335
lines changed

25 files changed

+122
-335
lines changed

common/scala/src/main/scala/org/apache/openwhisk/common/TransactionId.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ case class TransactionId private (meta: TransactionMetadata) extends AnyVal {
191191
case Some(parent) => findRoot(parent)
192192
case _ => meta
193193
}
194-
195-
def serialize = TransactionId.serdes.write(this).compactPrint
196194
}
197195

198196
/**

common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/Container.scala

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ trait Container {
135135
transid.failed(this, start, s"initializiation failed with $t")
136136
}
137137
.flatMap { result =>
138-
// if runtime container is shutting down, reschedule the activation message
139-
result.response.right.map { res =>
140-
if (res.shuttingDown) {
141-
throw ContainerHealthError(transid, containerId.asString)
142-
}
143-
}
144-
145138
if (result.ok) {
146139
Future.successful(result.interval)
147140
} else if (result.interval.duration >= timeout) {
@@ -187,13 +180,6 @@ trait Container {
187180
transid.failed(this, start, s"run failed with $t")
188181
}
189182
.map { result =>
190-
// if runtime container is shutting down, reschedule the activation message
191-
result.response.right.map { res =>
192-
if (res.shuttingDown) {
193-
throw ContainerHealthError(transid, containerId.asString)
194-
}
195-
}
196-
197183
val response = if (result.interval.duration >= timeout) {
198184
ActivationResponse.developerError(Messages.timedoutActivation(timeout, false))
199185
} else {

common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,16 @@ trait ContainerFactory {
114114
userProvidedImage: Boolean,
115115
memory: ByteSize,
116116
cpuShares: Int,
117-
action: Option[ExecutableWhiskAction],
118-
resourceTags: Option[List[String]] = None)(implicit config: WhiskConfig, logging: Logging): Future[Container]
117+
action: Option[ExecutableWhiskAction])(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
118+
createContainer(tid, name, actionImage, userProvidedImage, memory, cpuShares)
119+
}
120+
121+
def createContainer(tid: TransactionId,
122+
name: String,
123+
actionImage: ExecManifest.ImageName,
124+
userProvidedImage: Boolean,
125+
memory: ByteSize,
126+
cpuShares: Int)(implicit config: WhiskConfig, logging: Logging): Future[Container]
119127

120128
/** perform any initialization */
121129
def init(): Unit

common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
package org.apache.openwhisk.core.entity
1919

2020
import scala.util.Try
21-
import akka.http.scaladsl.model.StatusCodes.{OK, ServiceUnavailable}
21+
22+
import akka.http.scaladsl.model.StatusCodes.OK
23+
2224
import spray.json._
2325
import spray.json.DefaultJsonProtocol
24-
import org.apache.openwhisk.common.{Logging, TransactionId}
26+
27+
import org.apache.openwhisk.common.Logging
2528
import org.apache.openwhisk.http.Messages._
2629

2730
protected[core] case class ActivationResponse private (statusCode: Int,
@@ -136,10 +139,6 @@ protected[core] object ActivationResponse extends DefaultJsonProtocol {
136139
/** true iff status code is OK (HTTP 200 status code), anything else is considered an error. **/
137140
val okStatus = statusCode == OK.intValue
138141
val ok = okStatus && truncated.isEmpty
139-
140-
/** true iff status code is ServiceUnavailable (HTTP 503 status code) */
141-
val shuttingDown = statusCode == ServiceUnavailable.intValue
142-
143142
override def toString = {
144143
val base = if (okStatus) "ok" else "not ok"
145144
val rest = truncated.map(e => s", truncated ${e.toString}").getOrElse("")
@@ -196,9 +195,8 @@ protected[core] object ActivationResponse extends DefaultJsonProtocol {
196195
* @param response an Option (HTTP Status Code, HTTP response bytes as String)
197196
* @return appropriate ActivationResponse representing run result
198197
*/
199-
protected[core] def processRunResponseContent(
200-
response: Either[ContainerConnectionError, ContainerResponse],
201-
logger: Logging)(implicit id: TransactionId = TransactionId.unknown): ActivationResponse = {
198+
protected[core] def processRunResponseContent(response: Either[ContainerConnectionError, ContainerResponse],
199+
logger: Logging): ActivationResponse = {
202200
response match {
203201
case Right(res @ ContainerResponse(_, str, truncated)) =>
204202
truncated match {
@@ -242,7 +240,6 @@ protected[core] object ActivationResponse extends DefaultJsonProtocol {
242240

243241
case Left(e) =>
244242
// This indicates a terminal failure in the container (it exited prematurely).
245-
logger.error(this, abnormalRun)
246243
developerError(abnormalRun)
247244
}
248245
}

common/scala/src/main/scala/org/apache/openwhisk/core/mesos/MesosContainerFactory.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ import org.apache.openwhisk.common.TransactionId
4545
import org.apache.openwhisk.core.ConfigKeys
4646
import org.apache.openwhisk.core.WhiskConfig
4747
import org.apache.openwhisk.core.containerpool._
48-
import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, ExecutableWhiskAction, InvokerInstanceId, UUID}
48+
import org.apache.openwhisk.core.entity.ByteSize
49+
import org.apache.openwhisk.core.entity.ExecManifest
50+
import org.apache.openwhisk.core.entity.InvokerInstanceId
51+
import org.apache.openwhisk.core.entity.UUID
4952

5053
/**
5154
* Configuration for mesos timeouts
@@ -122,15 +125,12 @@ class MesosContainerFactory(config: WhiskConfig,
122125
}
123126
}
124127

125-
override def createContainer(
126-
tid: TransactionId,
127-
name: String,
128-
actionImage: ExecManifest.ImageName,
129-
userProvidedImage: Boolean,
130-
memory: ByteSize,
131-
cpuShares: Int,
132-
action: Option[ExecutableWhiskAction] = None,
133-
resourceTags: Option[List[String]] = None)(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
128+
override def createContainer(tid: TransactionId,
129+
name: String,
130+
actionImage: ExecManifest.ImageName,
131+
userProvidedImage: Boolean,
132+
memory: ByteSize,
133+
cpuShares: Int)(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
134134
implicit val transid = tid
135135
val image = actionImage.resolveImageName(Some(
136136
ContainerFactory.resolveRegistryConfig(userProvidedImage, runtimesRegistryConfig, userImagesRegistryConfig).url))

common/scala/src/main/scala/org/apache/openwhisk/core/yarn/YARNContainerFactory.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import akka.util.Timeout
2424
import org.apache.openwhisk.common.{Logging, TransactionId}
2525
import org.apache.openwhisk.core.containerpool._
2626
import org.apache.openwhisk.core.entity.ExecManifest.ImageName
27-
import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, ExecutableWhiskAction, InvokerInstanceId}
27+
import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, InvokerInstanceId}
2828
import org.apache.openwhisk.core.yarn.YARNComponentActor.CreateContainerAsync
2929
import org.apache.openwhisk.core.{ConfigKeys, WhiskConfig}
3030
import pureconfig._
@@ -125,9 +125,7 @@ class YARNContainerFactory(actorSystem: ActorSystem,
125125
actionImage: ExecManifest.ImageName,
126126
unuseduserProvidedImage: Boolean,
127127
unusedmemory: ByteSize,
128-
unusedcpuShares: Int,
129-
action: Option[ExecutableWhiskAction] = None,
130-
resourceTags: Option[List[String]] = None)(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
128+
unusedcpuShares: Int)(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
131129
implicit val timeout: Timeout = Timeout(containerStartTimeoutMS.milliseconds)
132130

133131
//First send the create command to YARN, then with a different actor, wait for the container to be ready

core/invoker/src/main/resources/application.conf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ whisk {
155155
#aka 'How long should a container sit idle until we kill it?'
156156
idle-container = 10 minutes
157157
pause-grace = 50 milliseconds
158-
lease-grace = 5 seconds
159-
keeping-duration = 60 minutes
160158
}
161159
action-health-check {
162160
enabled = false # if true, prewarm containers will be pinged periodically and warm containers will be pinged once after resumed
@@ -180,6 +178,4 @@ whisk {
180178
protocol: http
181179
}
182180
runtime.delete.timeout = "30 seconds"
183-
184-
runtime.resource.role = "openwhisk-runtime-resource-role"
185181
}

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerProxy.scala

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ class ContainerProxy(factory: (TransactionId,
251251
Boolean,
252252
ByteSize,
253253
Int,
254-
Option[ExecutableWhiskAction],
255-
Option[List[String]]) => Future[Container],
254+
Option[ExecutableWhiskAction]) => Future[Container],
256255
sendActiveAck: ActiveAck,
257256
storeActivation: (TransactionId, WhiskActivation, Boolean, UserContext) => Future[Any],
258257
collectLogs: LogsCollector,
@@ -291,7 +290,6 @@ class ContainerProxy(factory: (TransactionId,
291290
job.exec.pull,
292291
job.memoryLimit,
293292
poolConfig.cpuShare(job.memoryLimit),
294-
None,
295293
None)
296294
.map(container =>
297295
PreWarmCompleted(PreWarmedData(container, job.exec.kind, job.memoryLimit, expires = job.ttl.map(_.fromNow))))
@@ -311,8 +309,7 @@ class ContainerProxy(factory: (TransactionId,
311309
job.action.exec.pull,
312310
job.action.limits.memory.megabytes.MB,
313311
poolConfig.cpuShare(job.action.limits.memory.megabytes.MB),
314-
Some(job.action),
315-
job.action.annotations.get(Annotations.InvokerResourcesAnnotationName).map(_.convertTo[List[String]]))
312+
Some(job.action))
316313

317314
// container factory will either yield a new container ready to execute the action, or
318315
// starting up the container failed; for the latter, it's either an internal error starting
@@ -966,9 +963,7 @@ class ContainerProxy(factory: (TransactionId,
966963
}
967964
}
968965

969-
final case class ContainerProxyTimeoutConfig(idleContainer: FiniteDuration,
970-
pauseGrace: FiniteDuration,
971-
keepingDuration: FiniteDuration)
966+
final case class ContainerProxyTimeoutConfig(idleContainer: FiniteDuration, pauseGrace: FiniteDuration)
972967
final case class ContainerProxyHealthCheckConfig(enabled: Boolean, checkPeriod: FiniteDuration, maxFails: Int)
973968
final case class ContainerProxyActivationErrorLogConfig(applicationErrors: Boolean,
974969
developerErrors: Boolean,
@@ -981,8 +976,7 @@ object ContainerProxy {
981976
Boolean,
982977
ByteSize,
983978
Int,
984-
Option[ExecutableWhiskAction],
985-
Option[List[String]]) => Future[Container],
979+
Option[ExecutableWhiskAction]) => Future[Container],
986980
ack: ActiveAck,
987981
store: (TransactionId, WhiskActivation, Boolean, UserContext) => Future[Any],
988982
collectLogs: LogsCollector,

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainerFactory.scala

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ import org.apache.openwhisk.common.Logging
2626
import org.apache.openwhisk.common.TransactionId
2727
import org.apache.openwhisk.core.WhiskConfig
2828
import org.apache.openwhisk.core.containerpool._
29-
import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, ExecutableWhiskAction, InvokerInstanceId}
29+
import org.apache.openwhisk.core.entity.ByteSize
30+
import org.apache.openwhisk.core.entity.ExecManifest
31+
import org.apache.openwhisk.core.entity.InvokerInstanceId
3032

3133
import scala.concurrent.duration._
3234
import java.util.concurrent.TimeoutException
@@ -55,15 +57,12 @@ class DockerContainerFactory(instance: InvokerInstanceId,
5557
extends ContainerFactory {
5658

5759
/** Create a container using docker cli */
58-
override def createContainer(
59-
tid: TransactionId,
60-
name: String,
61-
actionImage: ExecManifest.ImageName,
62-
userProvidedImage: Boolean,
63-
memory: ByteSize,
64-
cpuShares: Int,
65-
action: Option[ExecutableWhiskAction] = None,
66-
resourceTags: Option[List[String]] = None)(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
60+
override def createContainer(tid: TransactionId,
61+
name: String,
62+
actionImage: ExecManifest.ImageName,
63+
userProvidedImage: Boolean,
64+
memory: ByteSize,
65+
cpuShares: Int)(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
6766
val registryConfig =
6867
ContainerFactory.resolveRegistryConfig(userProvidedImage, runtimesRegistryConfig, userImagesRegistryConfig)
6968
val image = if (userProvidedImage) Left(actionImage) else Right(actionImage)

core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/StandaloneDockerContainerFactory.scala

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import org.apache.commons.lang3.SystemUtils
2222
import org.apache.openwhisk.common.{Logging, TransactionId}
2323
import org.apache.openwhisk.core.{ConfigKeys, WhiskConfig}
2424
import org.apache.openwhisk.core.containerpool.{Container, ContainerFactory, ContainerFactoryProvider}
25-
import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, ExecutableWhiskAction, InvokerInstanceId}
25+
import org.apache.openwhisk.core.entity.{ByteSize, ExecManifest, InvokerInstanceId}
2626
import pureconfig._
2727
import pureconfig.generic.auto._
2828

@@ -61,15 +61,12 @@ class StandaloneDockerContainerFactory(instance: InvokerInstanceId, parameters:
6161
private val pulledImages = new TrieMap[String, Boolean]()
6262
private val factoryConfig = loadConfigOrThrow[StandaloneDockerConfig](ConfigKeys.standaloneDockerContainerFactory)
6363

64-
override def createContainer(
65-
tid: TransactionId,
66-
name: String,
67-
actionImage: ExecManifest.ImageName,
68-
userProvidedImage: Boolean,
69-
memory: ByteSize,
70-
cpuShares: Int,
71-
action: Option[ExecutableWhiskAction] = None,
72-
resourceTags: Option[List[String]] = None)(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
64+
override def createContainer(tid: TransactionId,
65+
name: String,
66+
actionImage: ExecManifest.ImageName,
67+
userProvidedImage: Boolean,
68+
memory: ByteSize,
69+
cpuShares: Int)(implicit config: WhiskConfig, logging: Logging): Future[Container] = {
7370

7471
//For standalone server usage we would also want to pull the OpenWhisk provided image so as to ensure if
7572
//local setup does not have the image then it pulls it down

0 commit comments

Comments
 (0)