[GitHub] dubeejw commented on issue #259: Move Feed Update Test
dubeejw commented on issue #259: Move Feed Update Test URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/259#issuecomment-370682978 After this is merged, let's create a new tag. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action
dubeejw commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action URL: https://github.com/apache/incubator-openwhisk/pull/3388#discussion_r172421073 ## File path: common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala ## @@ -313,6 +313,9 @@ object WhiskAction extends DocumentFactory[WhiskAction] with WhiskEntityQueries[ override val cacheEnabled = true + val requireWhiskAuthAnnotation = "require-whisk-auth" Review comment: I don't think these values belong here since `WhiskAction` does not know what a Web Action is, and `WhiskAction` does not use this annotation or header. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action
dubeejw commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action URL: https://github.com/apache/incubator-openwhisk/pull/3388#discussion_r172421073 ## File path: common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala ## @@ -313,6 +313,9 @@ object WhiskAction extends DocumentFactory[WhiskAction] with WhiskEntityQueries[ override val cacheEnabled = true + val requireWhiskAuthAnnotation = "require-whisk-auth" Review comment: I don't think these values belong here since `WhiskAction` does not know what a Web Action is, and `WhiskAction` does not use these annotations. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action
dubeejw commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action URL: https://github.com/apache/incubator-openwhisk/pull/3388#discussion_r172421073 ## File path: common/scala/src/main/scala/whisk/core/entity/WhiskAction.scala ## @@ -313,6 +313,9 @@ object WhiskAction extends DocumentFactory[WhiskAction] with WhiskEntityQueries[ override val cacheEnabled = true + val requireWhiskAuthAnnotation = "require-whisk-auth" Review comment: I don't think these values belong here since `WhiskAction` does not know what a Web Action is. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] Param-S commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action
Param-S commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/22#issuecomment-370670621 Yes, this PR is for Java 8. Using the community build AdoptOpenJDK. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] Param-S commented on issue #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime
Param-S commented on issue #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime URL: https://github.com/apache/incubator-openwhisk-runtime-java/pull/24#issuecomment-370670215 Please refer the tags section https://hub.docker.com/r/adoptopenjdk/openjdk8-openj9/tags/ x86_64-ubuntu-jdk8u152-b16 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on a change in pull request #256: perform credentials check before creating consumer
abaruni commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172407394 ## File path: provider/service.py ## @@ -145,17 +152,48 @@ def stopChangesFeed(self): def createAndRunConsumer(self, doc): triggerFQN = doc['_id'] +if doc['isMessageHub']: +retries = 0 +max_retries = 5 +url = '{}/admin/topics'.format(doc['kafka_admin_url']) +username = doc['username'] +password = doc['password'] +topic = doc['topic'] + +while retries < max_retries: Review comment: yeah i'm afraid i'm going to have to change a doc in cloudant for that. need to get that figured out This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on a change in pull request #256: perform credentials check before creating consumer
abaruni commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172406603 ## File path: provider/service.py ## @@ -145,17 +152,48 @@ def stopChangesFeed(self): def createAndRunConsumer(self, doc): triggerFQN = doc['_id'] +if doc['isMessageHub']: +retries = 0 +max_retries = 5 +url = '{}/admin/topics'.format(doc['kafka_admin_url']) +username = doc['username'] +password = doc['password'] +topic = doc['topic'] + +while retries < max_retries: +headers = {'X-Auth-Token': '{}{}'.format(username, password)} +response = self.session.get(url, headers=headers, stream=False, timeout=10.0, verify=check_ssl) +status_code = response.status_code + +if status_code == 200: +topics = json.loads(response.content) + +if topic in [t['name'] for t in topics]: +break +else: +logging.warn('Topic {} for trigger {} no longer exists. This consumer will not be created and trigger will be disabled'.format(topic, triggerFQN)) +reason = 'Topic does not exist. You must create the topic first: {}.'.format(url, topic) +self.database.disableTrigger(triggerFQN, 404, reason) +return +elif status_code == 403: +logging.warn('[{}] Invalid authKey. This consumer will not be created and trigger will be disabled'.format(triggerFQN)) +reason = 'Invalid authKey. {} returned 403 using authKey {}{}.'.format(url, username, password) +self.database.disableTrigger(triggerFQN, 403, reason) +return +else: +sleepyTime = pow(2, retries) +logging.info('Received status code {} for {} while validating authKey. Retrying in {} second(s)'.format(status_code, triggerFQN, sleepyTime)) +time.sleep(sleepyTime) +retries += 1 + # Create a representation for this trigger, even if it is disabled # This allows it to appear in /health as well as allow it to be deleted # Creating this object is lightweight and does not initialize any connections consumer = Consumer(triggerFQN, doc) self.consumers.addConsumerForTrigger(triggerFQN, consumer) -if self.__isTriggerDocActive(doc): -logging.info('[{}] Trigger was determined to be active, starting...'.format(triggerFQN)) -consumer.start() -else: -logging.info('[{}] Trigger was determined to be disabled, not starting...'.format(triggerFQN)) +logging.info('[{}] Starting consumer...'.format(triggerFQN)) Review comment: we **do** have that consumer in memory is when we disable a trigger for reasons like client errors. doing that is something that may likely change in the future. so that whole logic would need reworking This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on a change in pull request #256: perform credentials check before creating consumer
abaruni commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172406386 ## File path: provider/service.py ## @@ -145,17 +152,48 @@ def stopChangesFeed(self): def createAndRunConsumer(self, doc): triggerFQN = doc['_id'] +if doc['isMessageHub']: +retries = 0 +max_retries = 5 +url = '{}/admin/topics'.format(doc['kafka_admin_url']) +username = doc['username'] +password = doc['password'] +topic = doc['topic'] + +while retries < max_retries: +headers = {'X-Auth-Token': '{}{}'.format(username, password)} +response = self.session.get(url, headers=headers, stream=False, timeout=10.0, verify=check_ssl) +status_code = response.status_code + +if status_code == 200: +topics = json.loads(response.content) + +if topic in [t['name'] for t in topics]: +break +else: +logging.warn('Topic {} for trigger {} no longer exists. This consumer will not be created and trigger will be disabled'.format(topic, triggerFQN)) +reason = 'Topic does not exist. You must create the topic first: {}.'.format(url, topic) +self.database.disableTrigger(triggerFQN, 404, reason) +return +elif status_code == 403: +logging.warn('[{}] Invalid authKey. This consumer will not be created and trigger will be disabled'.format(triggerFQN)) +reason = 'Invalid authKey. {} returned 403 using authKey {}{}.'.format(url, username, password) +self.database.disableTrigger(triggerFQN, 403, reason) +return +else: +sleepyTime = pow(2, retries) +logging.info('Received status code {} for {} while validating authKey. Retrying in {} second(s)'.format(status_code, triggerFQN, sleepyTime)) +time.sleep(sleepyTime) +retries += 1 + # Create a representation for this trigger, even if it is disabled # This allows it to appear in /health as well as allow it to be deleted # Creating this object is lightweight and does not initialize any connections consumer = Consumer(triggerFQN, doc) self.consumers.addConsumerForTrigger(triggerFQN, consumer) -if self.__isTriggerDocActive(doc): -logging.info('[{}] Trigger was determined to be active, starting...'.format(triggerFQN)) -consumer.start() -else: -logging.info('[{}] Trigger was determined to be disabled, not starting...'.format(triggerFQN)) +logging.info('[{}] Starting consumer...'.format(triggerFQN)) Review comment: yes. currently we detect a change in the changes feed and check whether that consumer is in our in-memory cache. this is still the case, however, since we will not be creating disabled consumers. the only time we'll hit the code path where we are going from inactive -> active **and** This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on a change in pull request #256: perform credentials check before creating consumer
abaruni commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172406011 ## File path: provider/service.py ## @@ -145,17 +152,48 @@ def stopChangesFeed(self): def createAndRunConsumer(self, doc): triggerFQN = doc['_id'] +if doc['isMessageHub']: +retries = 0 +max_retries = 5 +url = '{}/admin/topics'.format(doc['kafka_admin_url']) +username = doc['username'] +password = doc['password'] +topic = doc['topic'] + +while retries < max_retries: +headers = {'X-Auth-Token': '{}{}'.format(username, password)} +response = self.session.get(url, headers=headers, stream=False, timeout=10.0, verify=check_ssl) +status_code = response.status_code + +if status_code == 200: +topics = json.loads(response.content) + +if topic in [t['name'] for t in topics]: +break +else: +logging.warn('Topic {} for trigger {} no longer exists. This consumer will not be created and trigger will be disabled'.format(topic, triggerFQN)) +reason = 'Topic does not exist. You must create the topic first: {}.'.format(url, topic) +self.database.disableTrigger(triggerFQN, 404, reason) +return +elif status_code == 403: +logging.warn('[{}] Invalid authKey. This consumer will not be created and trigger will be disabled'.format(triggerFQN)) +reason = 'Invalid authKey. {} returned 403 using authKey {}{}.'.format(url, username, password) +self.database.disableTrigger(triggerFQN, 403, reason) +return +else: +sleepyTime = pow(2, retries) +logging.info('Received status code {} for {} while validating authKey. Retrying in {} second(s)'.format(status_code, triggerFQN, sleepyTime)) +time.sleep(sleepyTime) +retries += 1 + # Create a representation for this trigger, even if it is disabled Review comment: i need to update this comment as well This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on a change in pull request #256: perform credentials check before creating consumer
abaruni commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172405821 ## File path: provider/service.py ## @@ -145,17 +152,48 @@ def stopChangesFeed(self): def createAndRunConsumer(self, doc): triggerFQN = doc['_id'] +if doc['isMessageHub']: +retries = 0 +max_retries = 5 +url = '{}/admin/topics'.format(doc['kafka_admin_url']) Review comment: haven't experienced throttling in my own testing, but i will have to double check on the official answer This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on a change in pull request #256: perform credentials check before creating consumer
abaruni commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172405741 ## File path: provider/service.py ## @@ -106,7 +113,7 @@ def run(self): # running trigger should become disabled # this should be done regardless of which worker the document claims to be assigned to logging.info('[{}] Existing running trigger should become disabled'.format(change["id"])) -existingConsumer.disable() +existingConsumer.shutdown() Review comment: good catch This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on a change in pull request #256: perform credentials check before creating consumer
dubeejw commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172404722 ## File path: provider/service.py ## @@ -145,17 +152,48 @@ def stopChangesFeed(self): def createAndRunConsumer(self, doc): triggerFQN = doc['_id'] +if doc['isMessageHub']: +retries = 0 +max_retries = 5 +url = '{}/admin/topics'.format(doc['kafka_admin_url']) +username = doc['username'] +password = doc['password'] +topic = doc['topic'] + +while retries < max_retries: Review comment: Seems like we could have a test here for invalid auth. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on a change in pull request #256: perform credentials check before creating consumer
dubeejw commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172403960 ## File path: provider/service.py ## @@ -145,17 +152,48 @@ def stopChangesFeed(self): def createAndRunConsumer(self, doc): triggerFQN = doc['_id'] +if doc['isMessageHub']: +retries = 0 +max_retries = 5 +url = '{}/admin/topics'.format(doc['kafka_admin_url']) Review comment: Will the admin URL throttle requests? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on a change in pull request #256: perform credentials check before creating consumer
dubeejw commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172404606 ## File path: provider/service.py ## @@ -145,17 +152,48 @@ def stopChangesFeed(self): def createAndRunConsumer(self, doc): triggerFQN = doc['_id'] +if doc['isMessageHub']: +retries = 0 +max_retries = 5 +url = '{}/admin/topics'.format(doc['kafka_admin_url']) +username = doc['username'] +password = doc['password'] +topic = doc['topic'] + +while retries < max_retries: +headers = {'X-Auth-Token': '{}{}'.format(username, password)} +response = self.session.get(url, headers=headers, stream=False, timeout=10.0, verify=check_ssl) +status_code = response.status_code + +if status_code == 200: +topics = json.loads(response.content) + +if topic in [t['name'] for t in topics]: +break +else: +logging.warn('Topic {} for trigger {} no longer exists. This consumer will not be created and trigger will be disabled'.format(topic, triggerFQN)) +reason = 'Topic does not exist. You must create the topic first: {}.'.format(url, topic) +self.database.disableTrigger(triggerFQN, 404, reason) +return +elif status_code == 403: +logging.warn('[{}] Invalid authKey. This consumer will not be created and trigger will be disabled'.format(triggerFQN)) +reason = 'Invalid authKey. {} returned 403 using authKey {}{}.'.format(url, username, password) +self.database.disableTrigger(triggerFQN, 403, reason) +return +else: +sleepyTime = pow(2, retries) +logging.info('Received status code {} for {} while validating authKey. Retrying in {} second(s)'.format(status_code, triggerFQN, sleepyTime)) +time.sleep(sleepyTime) +retries += 1 + # Create a representation for this trigger, even if it is disabled # This allows it to appear in /health as well as allow it to be deleted # Creating this object is lightweight and does not initialize any connections consumer = Consumer(triggerFQN, doc) self.consumers.addConsumerForTrigger(triggerFQN, consumer) -if self.__isTriggerDocActive(doc): -logging.info('[{}] Trigger was determined to be active, starting...'.format(triggerFQN)) -consumer.start() -else: -logging.info('[{}] Trigger was determined to be disabled, not starting...'.format(triggerFQN)) +logging.info('[{}] Starting consumer...'.format(triggerFQN)) Review comment: Do these changes affect the other occurrence of the call to `__isTriggerDocActive` in this file? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on a change in pull request #256: perform credentials check before creating consumer
dubeejw commented on a change in pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#discussion_r172403904 ## File path: provider/service.py ## @@ -106,7 +113,7 @@ def run(self): # running trigger should become disabled # this should be done regardless of which worker the document claims to be assigned to logging.info('[{}] Existing running trigger should become disabled'.format(change["id"])) -existingConsumer.disable() +existingConsumer.shutdown() Review comment: Need to update doc above that mentions that the consumer should be disabled. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dgrove-oss commented on issue #3378: LogStoreProvider using invokerAgent for KubernetesContainerPool
dgrove-oss commented on issue #3378: LogStoreProvider using invokerAgent for KubernetesContainerPool URL: https://github.com/apache/incubator-openwhisk/pull/3378#issuecomment-370654898 PG4 / 1440 ? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw closed pull request #257: fail to create feed trigger on explicit 403
dubeejw closed pull request #257: fail to create feed trigger on explicit 403 URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/257 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/action/messageHubFeedWeb.js b/action/messageHubFeedWeb.js index d22507d..0ad270b 100644 --- a/action/messageHubFeedWeb.js +++ b/action/messageHubFeedWeb.js @@ -234,9 +234,12 @@ function checkMessageHubCredentials(params) { if (topicNames.indexOf(params.topic) < 0) { return Promise.reject( 'Topic does not exist. You must create the topic first: ' + params.topic ); } -}, function (authError) { -console.log(`authError: ${JSON.stringify(authError)}`); -return Promise.reject( 'Could not authenticate with Message Hub. Please check your credentials.' ); +}, function (err) { +console.log(`Error: ${JSON.stringify(err)}`); + +if (err.statusCode === 403) { +return Promise.reject( 'Could not authenticate with Message Hub. Please check your credentials.' ); +} }); } This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw closed pull request #255: check for 204 before attempting to fetch response json
dubeejw closed pull request #255: check for 204 before attempting to fetch response json URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/255 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/provider/consumer.py b/provider/consumer.py index a8427d0..f9aaef2 100644 --- a/provider/consumer.py +++ b/provider/consumer.py @@ -354,11 +354,15 @@ def __fireTrigger(self, messages): # Manually commit offset if the trigger was fired successfully. Retry firing the trigger # for a select set of status codes if status_code in range(200, 300): -response_json = response.json() -if 'activationId' in response_json and response_json['activationId'] is not None: -logging.info("[{}] Fired trigger with activation {}".format(self.trigger, response_json['activationId'])) -else: +if status_code == 204: logging.info("[{}] Successfully fired trigger".format(self.trigger)) +else: +response_json = response.json() +if 'activationId' in response_json and response_json['activationId'] is not None: +logging.info("[{}] Fired trigger with activation {}".format(self.trigger, response_json['activationId'])) +else: +logging.info("[{}] Successfully fired trigger".format(self.trigger)) +# the consumer may have consumed messages that did not make it into the messages array. # the consumer may have consumed messages that did not make it into the messages array. # be sure to only commit to the messages that were actually fired. self.consumer.commit(offsets=self.__getOffsetList(messages), async=False) diff --git a/tests/src/test/scala/system/packages/MessageHubFeedTests.scala b/tests/src/test/scala/system/packages/MessageHubFeedTests.scala index 9cd1e2f..1b8db83 100644 --- a/tests/src/test/scala/system/packages/MessageHubFeedTests.scala +++ b/tests/src/test/scala/system/packages/MessageHubFeedTests.scala @@ -44,7 +44,6 @@ import ActionHelper._ import java.util.Base64 import java.nio.charset.StandardCharsets -import java.time.{Clock, Instant} import whisk.utils.retry @@ -414,8 +413,6 @@ class MessageHubFeedTests println("Giving the consumer a moment to get ready") Thread.sleep(consumerInitTime) - val first = Instant.now(Clock.systemUTC()) - println("Producing a message") withActivation(wsk.activation, wsk.action.invoke(s"$messagingPackage/$messageHubProduce", Map( "user" -> kafkaUtils.getAsJson("user"), @@ -428,7 +425,7 @@ class MessageHubFeedTests _.response.success shouldBe true } - checkForActivations(triggerName, first, topic, key, currentTime) + checkForActivations(1, triggerName, topic, key, currentTime) println("Updating trigger") @@ -446,7 +443,6 @@ class MessageHubFeedTests println("Giving the consumer a moment to get ready") Thread.sleep(consumerInitTime) - val second = Instant.now(Clock.systemUTC()) val encodedCurrentTime = Base64.getEncoder.encodeToString(currentTime.getBytes(StandardCharsets.UTF_8)) println("Producing a message") @@ -461,7 +457,7 @@ class MessageHubFeedTests _.response.success shouldBe true } - checkForActivations(triggerName, second, topic, key, encodedCurrentTime) + checkForActivations(2, triggerName, topic, key, encodedCurrentTime) } def createTrigger(assetHelper: AssetCleaner, name: String, parameters: Map[String, spray.json.JsValue]) = { @@ -477,10 +473,10 @@ class MessageHubFeedTests } } - def checkForActivations(triggerName: String, since: Instant, topic: String, key: String, value: String) = { + def checkForActivations(numActivations: Int, triggerName: String, topic: String, key: String, value: String) = { retry({ println("Polling for activations") - val activations = wsk.activation.pollFor(N = 1, Some(triggerName), since = Some(since), retries = maxRetries) + val activations = wsk.activation.pollFor(N = numActivations, Some(triggerName), retries = maxRetries) assert(activations.nonEmpty) println("Validating content of activation(s)") This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the
[GitHub] kameshsampath commented on issue #18: Rebase OW JavaRuntime to use OpenJDK 8
kameshsampath commented on issue #18: Rebase OW JavaRuntime to use OpenJDK 8 URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/18#issuecomment-370643096 yes it does have some auto-classpath settings, some standard directories where the jars are stored and finally the most important one of running as non-root user. I can rebase it once we have #24 merged. WDYT ? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on issue #258: Move Feed Test from BasicHealthTest to MessageHubFeedTests
dubeejw commented on issue #258: Move Feed Test from BasicHealthTest to MessageHubFeedTests URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/258#issuecomment-370640965 @abaruni, can you review? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on issue #259: Move Feed Update Test
dubeejw commented on issue #259: Move Feed Update Test URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/259#issuecomment-370641050 @abaruni, can you review? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw commented on issue #258: Move Feed Test from BasicHealthTest to MessageHubFeedTests
dubeejw commented on issue #258: Move Feed Test from BasicHealthTest to MessageHubFeedTests URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/258#issuecomment-370640965 @abaruni, can you review? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw opened a new pull request #259: Move Feed Update Test
dubeejw opened a new pull request #259: Move Feed Update Test URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/259 Closes https://github.com/apache/incubator-openwhisk-package-kafka/issues/258 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw opened a new issue #258: Move Feed Test from BasicHealthTest to MessageHubFeedTests
dubeejw opened a new issue #258: Move Feed Test from BasicHealthTest to MessageHubFeedTests URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/258 BasicHealthTest suite contains a test entitled: `correctly update isJSONData, isBinaryValue, and isBinaryKey`. It does not seem like this should be a health test, but instead be moved to the MessageHubFeedTests suite. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on issue #257: fail to create feed trigger on explicit 403
abaruni commented on issue #257: fail to create feed trigger on explicit 403 URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/257#issuecomment-370630432 the error returned when checking messagehub credentials may not necessarily be due to a 403. this add an explicit check for 403. if the error is not a 403, then continue on as if though we'd received a 200 and let the provider disable the trigger if, when it does its check before creating the consumer, it fails with 403 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on issue #255: check for 204 before attempting to fetch response json
abaruni commented on issue #255: check for 204 before attempting to fetch response json URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/255#issuecomment-370629997 this is a fix needed for the removal of activation records for triggers that aren't bound to an action via a rule. when fetching the response json for the trigger fire, the python-requests library will raise an exception when there is no content. added a check for 204 explicitly and log a successful fire This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni commented on issue #256: perform credentials check before creating consumer
abaruni commented on issue #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256#issuecomment-370627739 there are two changes here: 1) Perform a check of the messagehub credentials (if it is messagehub) and topic. This is to ensure that the authkey and topic provide when the trigger was originally created are still valid. there is the possibility that credentials and/or a topic could be deleted without the trigger being deleted. this leaves around zombie consumers who never stop attempting to connect to a broker. the idea here is to do the check when creating a consumer for an active trigger. if the authkey and topic are valid, then we will create the consumer as usual. if either are invalid. then the consumer will not be created and the trigger will be disabled in the db. if encounter any errors while trying to validate, then we'll retry. if at the end of the alloted retries, we don't succeed in getting either a 200 or 403, then we'll treat it as though we did get a 200. the motivation being that we'll eventually catch it on subsequent deploys. better to err on the side of caution than to mistakenly disable a valid trigger 2) do not create consumers for disabled triggers This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni opened a new pull request #257: fail to create feed trigger on explicit 403
abaruni opened a new pull request #257: fail to create feed trigger on explicit 403 URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/257 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw closed pull request #135: only update monitor status for the current monitored trigger
dubeejw closed pull request #135: only update monitor status for the current monitored trigger URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/135 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/provider/lib/utils.js b/provider/lib/utils.js index 3200189..75125d8 100644 --- a/provider/lib/utils.js +++ b/provider/lib/utils.js @@ -164,7 +164,7 @@ module.exports = function(logger, triggerDB, redisClient) { this.handleFiredTrigger = function(dataTrigger, isMonitorTrigger) { var method = 'handleFiredTrigger'; -if (isMonitorTrigger) { +if (isMonitorTrigger && utils.monitorStatus.triggerName === dataTrigger.name) { utils.monitorStatus.triggerFired = "success"; } @@ -344,7 +344,7 @@ module.exports = function(logger, triggerDB, redisClient) { if (utils.triggers[triggerIdentifier]) { if (doc.status && doc.status.active === false) { utils.stopTrigger(triggerIdentifier); -if (doc.monitor && doc.monitor === utils.host) { +if (doc.monitor && doc.monitor === utils.host && utils.monitorStatus.triggerName === doc.name) { utils.monitorStatus.triggerStopped = "success"; } } @@ -357,7 +357,7 @@ module.exports = function(logger, triggerDB, redisClient) { utils.triggers[triggerIdentifier] = cachedTrigger; logger.info(method, triggerIdentifier, 'created successfully'); -if (doc.monitor && doc.monitor === utils.host) { +if (doc.monitor && doc.monitor === utils.host && utils.monitorStatus.triggerName === cachedTrigger.name) { utils.monitorStatus.triggerStarted = "success"; } This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] pritidesai commented on issue #690: Bump Go version to 1.8
pritidesai commented on issue #690: Bump Go version to 1.8 URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/690#issuecomment-370609233 how about [YAML Go library](https://github.com/go-yaml/yaml)? We are using quite older version of YAML library: ``` { "ImportPath": "gopkg.in/yaml.v2", "Rev": "eb3733d160e74a9c7e442f435eb3bea458e1d19f" }, ``` https://github.com/go-yaml/yaml/tree/eb3733d160e74a9c7e442f435eb3bea458e1d19f was updated August 2017. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jasonpet opened a new pull request #135: only update monitor status for the current monitored trigger
jasonpet opened a new pull request #135: only update monitor status for the current monitored trigger URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/135 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mrutkows opened a new issue #767: wskdeploy does not display version using "version" command
mrutkows opened a new issue #767: wskdeploy does not display version using "version" command URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/767 The injection of a version would have to be done as part of the build process. currently here is what you see: ``` $ ./wskdeploy version wskdeploy build-version: unset--unset ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] tysonnorris commented on issue #3211: implement ContainerFactory.cpuShare to fix #3110
tysonnorris commented on issue #3211: implement ContainerFactory.cpuShare to fix #3110 URL: https://github.com/apache/incubator-openwhisk/pull/3211#issuecomment-370603276 @rabbah let me know if you have comments on this? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] pritidesai closed issue #574: Cloudant test case failed in travis CI
pritidesai closed issue #574: Cloudant test case failed in travis CI URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/574 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] pritidesai commented on issue #574: Cloudant test case failed in travis CI
pritidesai commented on issue #574: Cloudant test case failed in travis CI URL: https://github.com/apache/incubator-openwhisk-wskdeploy/issues/574#issuecomment-370597136 Cloudant test is enabled and already running in Travis: https://travis-ci.org/apache/incubator-openwhisk-wskdeploy/builds/349049804#L2296 ``` === RUN TestCloudant ==> Executing: wskdeploy -m /home/travis/gopath/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/cloudant/manifest.yaml -d --auth [secure] --namespace [secure] --apihost openwhisk.ng.bluemix.net --apiversion v1 ==> Output: Info: The API host is [openwhisk.ng.bluemix.net], from wskdeploy command line. Info: The auth key is set, from wskdeploy command line. Info: The namespace is [[secure]], from wskdeploy command line. Info: The apigw access token is set, from wskdeploy default. Info: Unmarshal OpenWhisk runtimes from internet at https://openwhisk.ng.bluemix.net. Warning: The mandatory key [package version] should be set. Using default value [0.0.1]... Warning: The value for key [package version] is not saved in the current version of wskdeploy. Warning: The mandatory key [package license] should be set. Using default value [unlicensed]... Warning: The value for key [package version] is not saved in the current version of wskdeploy. Warning: The [source] key in the manifest file will soon be deprecated, please use the [feed] key instead. Info: Deploying package [cloudant-sample] ... Info: package [cloudant-sample] has been successfully deployed. Info: Deploying package binding [sample-openwhisk-cloudant] ... Info: package binding [sample-openwhisk-cloudant] has been successfully deployed. Info: Deploying action [cloudant-sample/process-change] ... Info: action [cloudant-sample/process-change] has been successfully deployed. Info: Deploying action [cloudant-sample/process-change-cloudant-sequence] ... Info: action [cloudant-sample/process-change-cloudant-sequence] has been successfully deployed. Info: Deploying trigger feed [sample-data-inserted-trigger] ... Info: trigger feed [sample-data-inserted-trigger] has been successfully deployed. Info: Deploying rule [sample-log-change-rule] ... Info: rule [sample-log-change-rule] has been successfully deployed. Success: Deployment completed successfully. . ==> Executing: wskdeploy undeploy -m /home/travis/gopath/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/cloudant/manifest.yaml -d --auth [secure] --namespace [secure] --apihost openwhisk.ng.bluemix.net --apiversion v1 ==> Output: Info: The API host is [openwhisk.ng.bluemix.net], from wskdeploy command line. Info: The auth key is set, from wskdeploy command line. Info: The namespace is [[secure]], from wskdeploy command line. Info: The apigw access token is set, from wskdeploy default. Info: Unmarshal OpenWhisk runtimes from internet at https://openwhisk.ng.bluemix.net. Warning: The mandatory key [package version] should be set. Using default value [0.0.1]... Warning: The value for key [package version] is not saved in the current version of wskdeploy. Warning: The mandatory key [package license] should be set. Using default value [unlicensed]... Warning: The value for key [package version] is not saved in the current version of wskdeploy. Warning: The [source] key in the manifest file will soon be deprecated, please use the [feed] key instead. Info: Undeploying rule [sample-log-change-rule] ... Info: rule [sample-log-change-rule] has been successfully undeployed. Info: Undeploying action [cloudant-sample/process-change-cloudant-sequence] ... Info: action [cloudant-sample/process-change-cloudant-sequence] has been successfully undeployed. Info: Undeploying action [cloudant-sample/process-change] ... Info: action [cloudant-sample/process-change] has been successfully undeployed. Info: Undeploying package [cloudant-sample] ... Info: package [cloudant-sample] has been successfully undeployed. Success: Undeployment completed successfully. . --- PASS: TestCloudant (4.17s) PASS ok github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/cloudant 4.185s ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #23: Publish npm for the nodejsv8 image
csantanapr commented on issue #23: Publish npm for the nodejsv8 image URL: https://github.com/apache/incubator-openwhisk-runtime-nodejs/issues/23#issuecomment-370559477 Ok thanks both @ieb and @alexkli for the explanation. I have some more questions. Could share a hello work example on how a developer would configure its package.json and configure webpack? npm supports npm dependencies hosted on github would that be enough to configure users package.json and webpack? Are any of you using IBM Functions hosted solution? I offer nodejs:8 and includes a large set of dependencies and the runtime is on github maybe something similar there would help? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] dubeejw closed pull request #134: fix random test failure and other minor cleanup
dubeejw closed pull request #134: fix random test failure and other minor cleanup URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/134 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/provider/lib/health.js b/provider/lib/health.js index 9157e82..5255a5a 100644 --- a/provider/lib/health.js +++ b/provider/lib/health.js @@ -11,6 +11,8 @@ module.exports = function(logger, utils) { var triggerName; var monitorStatus; var alarmTypes = ['interval', 'date', 'cron']; +var alarmTypeIndex = 0; +var monitorStages = ['triggerStarted', 'triggerFired', 'triggerStopped']; var healthMonitor = this; // Health Logic @@ -49,6 +51,14 @@ module.exports = function(logger, utils) { if (triggerName) { monitorStatus = Object.assign({}, utils.monitorStatus); +utils.monitorStatus = {}; + +var monitorStatusSize = Object.keys(monitorStatus).length; +if (monitorStatusSize < 5) { +//we have a failure in one of the stages +var stageFailed = monitorStages[monitorStatusSize - 2]; +monitorStatus[stageFailed] = 'failed'; +} var existingID = `${apikey}/_/${triggerName}`; //delete trigger feed from database @@ -60,46 +70,41 @@ module.exports = function(logger, utils) { triggerID: existingID }; utils.sanitizer.deleteTrigger(dataTrigger, auth, 0) -.then((info) => { -logger.info(method, existingID, info); -}) -.catch(err => { -logger.error(method, existingID, err); -}); +.then((info) => { +logger.info(method, existingID, info); +}) +.catch(err => { +logger.error(method, existingID, err); +}); + +var existingAlarmIndex = alarmTypes.indexOf(monitorStatus.triggerType); +alarmTypeIndex = existingAlarmIndex !== 2 ? existingAlarmIndex + 1 : 0; } //create new alarm trigger triggerName = 'alarms_' + utils.worker + utils.host + '_' + Date.now(); +var alarmType = alarmTypes[alarmTypeIndex]; + +//update status monitor object +utils.monitorStatus.triggerName = triggerName; +utils.monitorStatus.triggerType = alarmType; var triggerURL = utils.uriHost + '/api/v1/namespaces/_/triggers/' + triggerName; var triggerID = `${apikey}/_/${triggerName}`; healthMonitor.createTrigger(triggerURL, auth) -.then((info) => { -logger.info(method, triggerID, info); -var newTrigger = healthMonitor.createAlarmTrigger(triggerID, triggerName, apikey); -healthMonitor.createTriggerInDB(triggerID, newTrigger); -}) -.catch(err => { -logger.error(method, triggerID, err); -}); +.then((info) => { +logger.info(method, triggerID, info); +var newTrigger = healthMonitor.createAlarmTrigger(triggerID, apikey, alarmType); +healthMonitor.createTriggerInDB(triggerID, newTrigger); +}) +.catch(err => { +logger.error(method, triggerID, err); +}); }; -this.createAlarmTrigger = function(triggerID, triggerName, apikey) { +this.createAlarmTrigger = function(triggerID, apikey, alarmType) { var method = 'createAlarmTrigger'; -var existingTypeIndex = -1; -if (monitorStatus && alarmTypes.indexOf(monitorStatus.triggerType) !== 2) { -existingTypeIndex = alarmTypes.indexOf(monitorStatus.triggerType); -} -var alarmType = alarmTypes[existingTypeIndex + 1]; - -//update status monitor object -utils.monitorStatus.triggerName = triggerName; -utils.monitorStatus.triggerType = alarmType; -utils.monitorStatus.triggerStarted = false; -utils.monitorStatus.triggerFired = false; -utils.monitorStatus.triggerUpdated = false; - var newTrigger = { apikey: apikey, name: triggerName, diff --git a/provider/lib/utils.js b/provider/lib/utils.js index a428a46..3200189 100644 --- a/provider/lib/utils.js +++ b/provider/lib/utils.js @@ -165,7 +165,7 @@ module.exports = function(logger, triggerDB, redisClient) { var method = 'handleFiredTrigger'; if (isMonitorTrigger) { -utils.monitorStatus.triggerFired = true; +utils.monitorStatus.triggerFired = "success"; } var triggerIdentifier = dataTrigger.triggerID; @@ -343,10 +343,10 @@ module.exports =
[GitHub] mdeuser commented on a change in pull request #67: Additional HTTP Headers
mdeuser commented on a change in pull request #67: Additional HTTP Headers URL: https://github.com/apache/incubator-openwhisk-client-go/pull/67#discussion_r172303704 ## File path: whisk/client_test.go ## @@ -140,3 +140,31 @@ func TestProxyHost(t *testing.T) { assert.Contains(t, err.Error(), proxyhost, "Setting HTTPS_PROXY to '"+proxyhost+"' did not cause the CLI to use that proxy URL.") } } + +func TestAdditionalHeaders(t *testing.T) { + config := GetValidConfigTest() + config.AdditionalHeaders = make(map[string]string) + config.AdditionalHeaders["Key1"] = "Value1" + config.AdditionalHeaders["Key2"] = "Value2" + + client, _ := NewClient(nil, config) + assert.NotNil(t, client) + + newRequest, newRequestErr := client.NewRequest("GET", config.BaseURL.String(), nil, false) + assert.Nil(t, newRequestErr, "NewRequest for proxy test failed.") + if newRequestErr != nil { + fmt.Printf("NewRequest() error: %s\n", newRequestErr.Error()) + } + + assert.Equal(t, []string([]string{"Value1"}), newRequest.Header["Key1"]) + assert.Equal(t, []string([]string{"Value2"}), newRequest.Header["Key2"]) Review comment: use Http instance in asserts? here and below (lins 168,169) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #67: Additional HTTP Headers
mdeuser commented on a change in pull request #67: Additional HTTP Headers URL: https://github.com/apache/incubator-openwhisk-client-go/pull/67#discussion_r172273252 ## File path: whisk/client.go ## @@ -74,18 +74,19 @@ type Client struct { } type Config struct { - Namespacestring // NOTE :: Default is "_" - Cert string - Key string - AuthTokenstring - Host string - BaseURL *url.URL // NOTE :: Default is "openwhisk.ng.bluemix.net" - Version string - Verbose bool - Debugbool // For detailed tracing - Insecure bool - UserAgentstring - ApigwAccessToken string + Namespace string // NOTE :: Default is "_" + Cert string + Key string + AuthToken string + Host string + BaseURL *url.URL // NOTE :: Default is "openwhisk.ng.bluemix.net" + Version string + Verbose bool + Debug bool // For detailed tracing + Insecure bool + UserAgent string + ApigwAccessToken string + AdditionalHeaders map[string]string Review comment: how about using the net.http.Header GO type https://golang.org/src/net/http/header.go?s=349:380#L9 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #67: Additional HTTP Headers
mdeuser commented on a change in pull request #67: Additional HTTP Headers URL: https://github.com/apache/incubator-openwhisk-client-go/pull/67#discussion_r172302968 ## File path: whisk/client_test.go ## @@ -140,3 +140,31 @@ func TestProxyHost(t *testing.T) { assert.Contains(t, err.Error(), proxyhost, "Setting HTTPS_PROXY to '"+proxyhost+"' did not cause the CLI to use that proxy URL.") } } + +func TestAdditionalHeaders(t *testing.T) { + config := GetValidConfigTest() + config.AdditionalHeaders = make(map[string]string) Review comment: Go http.Header type This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] pritidesai opened a new pull request #766: adding support for using env. variables in inputs JSON
pritidesai opened a new pull request #766: adding support for using env. variables in inputs JSON URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/766 Closes #705 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #18: Rebase OW JavaRuntime to use OpenJDK 8
csantanapr commented on issue #18: Rebase OW JavaRuntime to use OpenJDK 8 URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/18#issuecomment-370537018 I think you have other changes beyond moving to OpenJDK no? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] kameshsampath commented on issue #18: Rebase OW JavaRuntime to use OpenJDK 8
kameshsampath commented on issue #18: Rebase OW JavaRuntime to use OpenJDK 8 URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/18#issuecomment-370531604 since https://github.com/apache/incubator-openwhisk-runtime-java/pull/24 takes care of moving JDK to openjdk we shall close this PR . @csantanapr ??? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] kameshsampath commented on a change in pull request #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime
kameshsampath commented on a change in pull request #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime URL: https://github.com/apache/incubator-openwhisk-runtime-java/pull/24#discussion_r172297643 ## File path: core/javaAction/Dockerfile.OpenJ9 ## @@ -0,0 +1,10 @@ +FROM adoptopenjdk/openjdk8-openj9:x86_64-ubuntu-jdk8u152-b16 Review comment: then we can close the other PR as this takes care of it ??? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] kameshsampath commented on a change in pull request #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime
kameshsampath commented on a change in pull request #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime URL: https://github.com/apache/incubator-openwhisk-runtime-java/pull/24#discussion_r172297224 ## File path: core/javaAction/Dockerfile.OpenJ9 ## @@ -0,0 +1,10 @@ +FROM adoptopenjdk/openjdk8-openj9:x86_64-ubuntu-jdk8u152-b16 Review comment: +1 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] alexkli commented on issue #23: Publish npm for the nodejsv8 image
alexkli commented on issue #23: Publish npm for the nodejsv8 image URL: https://github.com/apache/incubator-openwhisk-runtime-nodejs/issues/23#issuecomment-370528641 @csantanapr it's not about _inclusion_ but about _exclusion_ of modules that are provided on the target environment, i.e. the nodejs container. This is critical if `action.zip` files are size limited on the openwhisk installation (say 1 or 5 MB), and your average npm module tree quickly exceeds those limits. Using an npm module for this allows for a detailed sharing of the list of "provided' dependencies between the provider (this repository) and action authors, including the exact versions of these dependencies. The npm module can be versioned itself to correspond with new versions of the nodejs action docker images. That npm module would not include any own javascript - just a `package.json` with the depdendencies. This is especially interesting for the nodejs6 container which has a [lot of useful dependencies](https://github.com/apache/incubator-openwhisk-runtime-nodejs/blob/5c7fd31af362e364116be06729004eecebf33f73/core/nodejs6Action/Dockerfile#L21-L75). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] alexkli commented on issue #23: Publish npm for the nodejsv8 image
alexkli commented on issue #23: Publish npm for the nodejsv8 image URL: https://github.com/apache/incubator-openwhisk-runtime-nodejs/issues/23#issuecomment-370528641 @csantanapr it's not about _inclusion_ but about _exclusion_ of modules that are provided on the target environment, i.e. the nodejs container. This is critical if `action.zip` files are size limited on the openwhisk installation (say 1 or 5 MB), and your average npm module tree quickly exceeds those limits. Using an npm module for this allows for a detailed sharing of the list of "provided' dependencies, including their exact versions. The npm module can be versioned itself to correspond with new versions of the nodejs action docker images. That npm module would not include any own javascript - just a `package.json` with the depdendencies. This is especially interesting for the nodejs6 container which has a [lot of useful dependencies](https://github.com/apache/incubator-openwhisk-runtime-nodejs/blob/5c7fd31af362e364116be06729004eecebf33f73/core/nodejs6Action/Dockerfile#L21-L75). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] alexkli commented on issue #23: Publish npm for the nodejsv8 image
alexkli commented on issue #23: Publish npm for the nodejsv8 image URL: https://github.com/apache/incubator-openwhisk-runtime-nodejs/issues/23#issuecomment-370528641 @csantanapr it's not about "inclusion" but about "exclusion" of modules that are provided on the target environment, i.e. the nodejs container. This is critical if `action.zip` files are size limited on the openwhisk installation (say 1 or 5 MB), and your average npm module tree quickly exceeds those limits. Using an npm module for this allows for a detailed sharing of the list of "provided' dependencies, including their exact versions. The npm module can be versioned itself to correspond with new versions of the nodejs action docker images. That npm module would not include any own javascript - just a `package.json` with the depdendencies. This is especially interesting for the v6 image which has a [lot of useful dependencies](https://github.com/apache/incubator-openwhisk-runtime-nodejs/blob/5c7fd31af362e364116be06729004eecebf33f73/core/nodejs6Action/Dockerfile#L21-L75). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action
markusthoemmes commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action URL: https://github.com/apache/incubator-openwhisk/pull/3388#discussion_r172274254 ## File path: core/controller/src/main/scala/whisk/core/controller/WebActions.scala ## @@ -483,7 +483,20 @@ trait WhiskWebActionsApi extends Directives with ValidateRequestSize with PostAc provide(fullyQualifiedActionName(actionName)) { fullActionName => onComplete(verifyWebAction(fullActionName, onBehalfOf.isDefined)) { case Success((actionOwnerIdentity, action)) => -if (!action.annotations.getAs[Boolean]("web-custom-options").exists(identity)) { +val requireWebAuthIsBool = (action.annotations.getAs[Boolean](WhiskAction.requireWhiskAuthAnnotation) != None) +val annotationRequireWebAuth = action.annotations + .getAs[Int](WhiskAction.requireWhiskAuthAnnotation).map(_.toString) + .orElse(action.annotations.getAs[String](WhiskAction.requireWhiskAuthAnnotation)) +val enforceWhiskAuthHdr = (!requireWebAuthIsBool && annotationRequireWebAuth.isDefined) Review comment: Please rename to `enforceWhiskAuthHdr`, took me a full 10 seconds to figure out it's supposed to mean "header" vs. High Dynamic Range. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] jasonpet opened a new pull request #134: fix random test failure and other minor cleanup
jasonpet opened a new pull request #134: fix random test failure and other minor cleanup URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/134 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action
csantanapr commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/22#issuecomment-370521552 This PR is for java 8 is my understanding This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni opened a new pull request #256: perform credentials check before creating consumer
abaruni opened a new pull request #256: perform credentials check before creating consumer URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/256 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] abaruni opened a new pull request #255: check for 204 before attempting to fetch response json
abaruni opened a new pull request #255: check for 204 before attempting to fetch response json URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/255 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action
markusthoemmes commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action URL: https://github.com/apache/incubator-openwhisk/pull/3388#discussion_r172274254 ## File path: core/controller/src/main/scala/whisk/core/controller/WebActions.scala ## @@ -483,7 +483,20 @@ trait WhiskWebActionsApi extends Directives with ValidateRequestSize with PostAc provide(fullyQualifiedActionName(actionName)) { fullActionName => onComplete(verifyWebAction(fullActionName, onBehalfOf.isDefined)) { case Success((actionOwnerIdentity, action)) => -if (!action.annotations.getAs[Boolean]("web-custom-options").exists(identity)) { +val requireWebAuthIsBool = (action.annotations.getAs[Boolean](WhiskAction.requireWhiskAuthAnnotation) != None) +val annotationRequireWebAuth = action.annotations + .getAs[Int](WhiskAction.requireWhiskAuthAnnotation).map(_.toString) + .orElse(action.annotations.getAs[String](WhiskAction.requireWhiskAuthAnnotation)) +val enforceWhiskAuthHdr = (!requireWebAuthIsBool && annotationRequireWebAuth.isDefined) Review comment: Please rename to `enforceWhiskAuthHdr`, took me a full 10 seconds to figure out it's supposed to mean "header" vs. High Dynamic Range. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes commented on a change in pull request #3371: Make AuthKey parsing leaner.
markusthoemmes commented on a change in pull request #3371: Make AuthKey parsing leaner. URL: https://github.com/apache/incubator-openwhisk/pull/3371#discussion_r172273307 ## File path: common/scala/src/main/scala/whisk/core/entity/Secret.scala ## @@ -33,12 +30,12 @@ import spray.json.deserializationError * @param key the secret key, required not null or empty */ protected[core] class Secret private (val key: String) extends AnyVal { - protected[core] def asString = toString - protected[entity] def toJson = JsString(toString) - override def toString = key + protected[core] def asString: String = toString + protected[entity] def toJson: JsString = JsString(toString) + override def toString: String = key } -protected[core] object Secret extends ArgNormalizer[Secret] { Review comment: I think it's okay to do it lazily/when it gets in the way. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes commented on a change in pull request #3371: Make AuthKey parsing leaner.
markusthoemmes commented on a change in pull request #3371: Make AuthKey parsing leaner. URL: https://github.com/apache/incubator-openwhisk/pull/3371#discussion_r172273184 ## File path: common/scala/src/main/scala/whisk/core/entity/AuthKey.scala ## @@ -31,14 +27,14 @@ import spray.json.deserializationError * The constructor is private so that argument requirements are checked and normalized * before creating a new instance. * - * @param (uuid, key) the uuid and key, assured to be non-null because both types are values + * @param k (uuid, key) the uuid and key, assured to be non-null because both types are values */ protected[core] class AuthKey private (private val k: (UUID, Secret)) extends AnyVal { - def uuid = k._1 - def key = k._2 + def uuid: UUID = k._1 + def key: Secret = k._2 def revoke = new AuthKey(uuid, Secret()) - def compact = s"$uuid:$key" - override def toString = uuid.toString + def compact: String = s"$uuid:$key" Review comment: IntelliJ complains about no signature on public members, so I lazily fix files throughout. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] kameshsampath commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action
kameshsampath commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/22#issuecomment-370500195 @csantanapr, I am fine. As discussed we should `java-ubuntu:8` and `java-centos:8` kind of distros. A question here is these are JDK 9 ones, are we planning to have AdoptOpenJDK 8 as well ? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action
csantanapr commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/22#issuecomment-370497873 @kameshsampath I prefer to replace the runtime with opnejdk//ubuntu PR #24 and not replace with centos based one from PR #18 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on a change in pull request #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime
csantanapr commented on a change in pull request #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime URL: https://github.com/apache/incubator-openwhisk-runtime-java/pull/24#discussion_r172265647 ## File path: core/javaAction/Dockerfile.OpenJ9 ## @@ -0,0 +1,10 @@ +FROM adoptopenjdk/openjdk8-openj9:x86_64-ubuntu-jdk8u152-b16 Review comment: We should replace the current image using oracle jdk and replcae the current java8action one with with this openjdk which uses ubuntu/debian based, transparent transition This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] chetanmeh commented on issue #3366: Adds method deleteAttachments to ArtifactStore
chetanmeh commented on issue #3366: Adds method deleteAttachments to ArtifactStore URL: https://github.com/apache/incubator-openwhisk/pull/3366#issuecomment-370495350 @rabbah has the PG passed for this PR? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on issue #20: [WIP] Java Improvements
csantanapr commented on issue #20: [WIP] Java Improvements URL: https://github.com/apache/incubator-openwhisk-runtime-java/pull/20#issuecomment-370494793 @Param-S could you help review this PR? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr commented on a change in pull request #20: [WIP] Java Improvements
csantanapr commented on a change in pull request #20: [WIP] Java Improvements URL: https://github.com/apache/incubator-openwhisk-runtime-java/pull/20#discussion_r172262540 ## File path: core/javaAction/Dockerfile ## @@ -1,38 +1,10 @@ -FROM buildpack-deps:trusty-curl +FROM docker.io/fabric8/java-jboss-openjdk8-jdk Review comment: I disagree to move to centos base image This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] hsane2001 commented on issue #994: Discussion: Keep containers warm as first-class primitive/option
hsane2001 commented on issue #994: Discussion: Keep containers warm as first-class primitive/option URL: https://github.com/apache/incubator-openwhisk/issues/994#issuecomment-370493928 Can we consider this enhancement at this time? There is a real need to either keep containers alive with neural network models loaded so that inference actions can be launched quite quickly. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner.
rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner. URL: https://github.com/apache/incubator-openwhisk/pull/3371#discussion_r172241948 ## File path: common/scala/src/main/scala/whisk/core/entity/AuthKey.scala ## @@ -64,37 +60,22 @@ protected[core] object AuthKey { * the first two hence "k:v*" produces ("k","v"). * * @param str the string containing uuid and key separated by colon - * @return AuthKey if argument is properly formated + * @return AuthKey if argument is properly formatted * @throws IllegalArgumentException if argument is not well formed */ @throws[IllegalArgumentException] protected[core] def apply(str: String): AuthKey = { -val (k, v) = split(str) -new AuthKey(UUID(k), Secret(v)) - } +val (uuid, secret) = str.split(':').toList match { + case k :: v :: _ => (k, v) Review comment: trim `k` and `v` (preserve existing split) or treat pedantically (new split)? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner.
rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner. URL: https://github.com/apache/incubator-openwhisk/pull/3371#discussion_r172242407 ## File path: common/scala/src/main/scala/whisk/core/entity/Secret.scala ## @@ -33,12 +30,12 @@ import spray.json.deserializationError * @param key the secret key, required not null or empty */ protected[core] class Secret private (val key: String) extends AnyVal { - protected[core] def asString = toString - protected[entity] def toJson = JsString(toString) - override def toString = key + protected[core] def asString: String = toString + protected[entity] def toJson: JsString = JsString(toString) + override def toString: String = key } -protected[core] object Secret extends ArgNormalizer[Secret] { Review comment: should we open an issue to remove arg normalizer? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner.
rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner. URL: https://github.com/apache/incubator-openwhisk/pull/3371#discussion_r172241948 ## File path: common/scala/src/main/scala/whisk/core/entity/AuthKey.scala ## @@ -64,37 +60,22 @@ protected[core] object AuthKey { * the first two hence "k:v*" produces ("k","v"). * * @param str the string containing uuid and key separated by colon - * @return AuthKey if argument is properly formated + * @return AuthKey if argument is properly formatted * @throws IllegalArgumentException if argument is not well formed */ @throws[IllegalArgumentException] protected[core] def apply(str: String): AuthKey = { -val (k, v) = split(str) -new AuthKey(UUID(k), Secret(v)) - } +val (uuid, secret) = str.split(':').toList match { + case k :: v :: _ => (k, v) Review comment: trim `k` and `v` (preserve existing split) or treat pedantically (new split)? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner.
rabbah commented on a change in pull request #3371: Make AuthKey parsing leaner. URL: https://github.com/apache/incubator-openwhisk/pull/3371#discussion_r172241593 ## File path: common/scala/src/main/scala/whisk/core/entity/AuthKey.scala ## @@ -31,14 +27,14 @@ import spray.json.deserializationError * The constructor is private so that argument requirements are checked and normalized * before creating a new instance. * - * @param (uuid, key) the uuid and key, assured to be non-null because both types are values + * @param k (uuid, key) the uuid and key, assured to be non-null because both types are values */ protected[core] class AuthKey private (private val k: (UUID, Secret)) extends AnyVal { - def uuid = k._1 - def key = k._2 + def uuid: UUID = k._1 + def key: Secret = k._2 def revoke = new AuthKey(uuid, Secret()) - def compact = s"$uuid:$key" - override def toString = uuid.toString + def compact: String = s"$uuid:$key" Review comment: fwiw i tend to skip the signature where it's obvious (ie one liners, here .toString, or s"") but OK for uniformity. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action
mdeuser commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action URL: https://github.com/apache/incubator-openwhisk/pull/3388#discussion_r172235982 ## File path: core/controller/src/main/scala/whisk/core/controller/WebActions.scala ## @@ -483,7 +483,24 @@ trait WhiskWebActionsApi extends Directives with ValidateRequestSize with PostAc provide(fullyQualifiedActionName(actionName)) { fullActionName => onComplete(verifyWebAction(fullActionName, onBehalfOf.isDefined)) { case Success((actionOwnerIdentity, action)) => -if (!action.annotations.getAs[Boolean]("web-custom-options").exists(identity)) { +val requireWebAuthIsBool = (action.annotations.getAs[Boolean]("require-whisk-auth") != None) +val annotationRequireWebAuthIsIntOrString = ((action.annotations + .getAs[String]("require-whisk-auth") != None) || (action.annotations + .getAs[Int]("require-whisk-auth") != None)) +val annotationRequireWebAuth = (action.annotations + .getAs[Int]("require-whisk-auth") + .getOrElse(action.annotations.getAs[String]("require-whisk-auth").getOrElse(""))) + .toString +val enforceWhiskAuthHdr = (!requireWebAuthIsBool && annotationRequireWebAuthIsIntOrString) +val headerWhiskAuthSeq = context.headers.filter(_.lowercaseName == "x-require-whisk-auth") Review comment: yes, that works much better. thanks! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mhaack commented on issue #2008: Support Default Parameters for Sequences
mhaack commented on issue #2008: Support Default Parameters for Sequences URL: https://github.com/apache/incubator-openwhisk/issues/2008#issuecomment-370464413 @jthomas, @rabbah any update on that? We ran into this as well. The work around to use a package binding with parameters does not really for us, since we have an action which we re-use in different sequences with different default parameter values. That would require multiple bindings then. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mhaack commented on issue #2008: Support Default Parameters for Sequences
mhaack commented on issue #2008: Support Default Parameters for Sequences URL: https://github.com/apache/incubator-openwhisk/issues/2008#issuecomment-370464413 @jthomas, @rabbah any update on that? We ran into this as well. The work around to use a package binding with parameters does not really for us, since we have an actions which we re-use in different sequences with different default parameter values. That would require multiple bindings then. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mhaack commented on issue #2008: Support Default Parameters for Sequences
mhaack commented on issue #2008: Support Default Parameters for Sequences URL: https://github.com/apache/incubator-openwhisk/issues/2008#issuecomment-370464413 @jthomas, @rabbah any updates on that? We ran into this as well. The work around to use a package binding with parameters does not really for us, since we have an actions which we re-use in different sequences with different default parameter values. That would require multiple bindings then. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ieb commented on issue #23: Publish npm for the nodejsv8 image
ieb commented on issue #23: Publish npm for the nodejsv8 image URL: https://github.com/apache/incubator-openwhisk-runtime-nodejs/issues/23#issuecomment-370449924 I am suggesting that there is a npm that defines all the dependencies already deployed into the nodejs8Action docker container so that, those who are developing functions can include that in their own project.json files and get the current list of provided dependencies, without having to try and work out what they are by trial and error or reading GitHub. For those that are using webpack or some other npm packager in their own package, they can also mark the container npm as external and reduce the size of their deployment bundle. All you need to do to achieve this is publish https://github.com/apache/incubator-openwhisk-runtime-nodejs/blob/master/core/nodejs8Action as a npm using its package.json file as the descriptor. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes opened a new pull request #3393: Turn off Kafka auto-commits.
markusthoemmes opened a new pull request #3393: Turn off Kafka auto-commits. URL: https://github.com/apache/incubator-openwhisk/pull/3393 We commit manually everywhere in our code. Some tests also rely on the manual commits to be the only ones around. We should be able to turn this off safely. If not we have a bug. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action
mdeuser commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action URL: https://github.com/apache/incubator-openwhisk/pull/3388#discussion_r172191333 ## File path: core/controller/src/main/scala/whisk/core/controller/WebActions.scala ## @@ -483,7 +483,24 @@ trait WhiskWebActionsApi extends Directives with ValidateRequestSize with PostAc provide(fullyQualifiedActionName(actionName)) { fullActionName => onComplete(verifyWebAction(fullActionName, onBehalfOf.isDefined)) { case Success((actionOwnerIdentity, action)) => -if (!action.annotations.getAs[Boolean]("web-custom-options").exists(identity)) { +val requireWebAuthIsBool = (action.annotations.getAs[Boolean]("require-whisk-auth") != None) Review comment: @markusthoemmes that is correct. i've updated the description to make this more clear. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action
mdeuser commented on a change in pull request #3388: Update require-whisk-auth behavior to secure web action URL: https://github.com/apache/incubator-openwhisk/pull/3388#discussion_r172189903 ## File path: core/controller/src/main/scala/whisk/core/controller/WebActions.scala ## @@ -483,7 +483,24 @@ trait WhiskWebActionsApi extends Directives with ValidateRequestSize with PostAc provide(fullyQualifiedActionName(actionName)) { fullActionName => onComplete(verifyWebAction(fullActionName, onBehalfOf.isDefined)) { case Success((actionOwnerIdentity, action)) => -if (!action.annotations.getAs[Boolean]("web-custom-options").exists(identity)) { +val requireWebAuthIsBool = (action.annotations.getAs[Boolean]("require-whisk-auth") != None) +val annotationRequireWebAuthIsIntOrString = ((action.annotations + .getAs[String]("require-whisk-auth") != None) || (action.annotations + .getAs[Int]("require-whisk-auth") != None)) +val annotationRequireWebAuth = (action.annotations + .getAs[Int]("require-whisk-auth") + .getOrElse(action.annotations.getAs[String]("require-whisk-auth").getOrElse(""))) + .toString Review comment: i like it :+1: This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] mdeuser commented on a change in pull request #3391: Add namespace-blacklist to invoker.
mdeuser commented on a change in pull request #3391: Add namespace-blacklist to invoker. URL: https://github.com/apache/incubator-openwhisk/pull/3391#discussion_r172187930 ## File path: core/invoker/src/main/scala/whisk/core/invoker/NamespaceBlacklist.scala ## @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package whisk.core.invoker + +import whisk.common.TransactionId +import whisk.core.database.StaleParameter +import whisk.core.entity.{Identity, View} +import whisk.core.entity.types.AuthStore + +import scala.concurrent.{ExecutionContext, Future} +import spray.json.DefaultJsonProtocol._ + +/** + * The Namespace blacklist gets all namespaces that are throttled to 0 from the database. + * The caller is responsible for a periodically update of the blacklist with `refreshBlacklist`. + * + * @param authStore Subjects database with the limit-documents. + */ +class NamespaceBlacklist(authStore: AuthStore) { Review comment: might this functionality be also used by the controller (i.e. belong under the `common` package)? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] Param-S commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action
Param-S commented on issue #22: Provide Eclipse OpenJ9 as alternative Java runtime for OW java action URL: https://github.com/apache/incubator-openwhisk-runtime-java/issues/22#issuecomment-370415813 PR #24 created to enable AdoptOpenJDK Eclipse OpenJ9 runtime for OW Java actions. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] Param-S opened a new pull request #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime
Param-S opened a new pull request #24: AdoptOpenJDK Eclipse OpenJ9 as alternative Java runtime URL: https://github.com/apache/incubator-openwhisk-runtime-java/pull/24 Eclipse OpenJ9 runtime for Java is opensource runtime which is available as binary through AdoptOpenJDK community builds. By making available of the Eclipse OpenJ9 for OW Java actions, it gives the developers the option to choose between different Java runtime implementations. Signed-off-by: Parameswaran SelvamThis is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes commented on issue #3391: Add namespace-blacklist to invoker.
markusthoemmes commented on issue #3391: Add namespace-blacklist to invoker. URL: https://github.com/apache/incubator-openwhisk/pull/3391#issuecomment-370413068 @mdeuser there is no procedure, you use the same tools as today (setting the namespace limits). The view will pick those up who are throttled down to 0 and handle them accordingly. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes commented on issue #3369: Use pureconfig for CouchDbRestStore
markusthoemmes commented on issue #3369: Use pureconfig for CouchDbRestStore URL: https://github.com/apache/incubator-openwhisk/pull/3369#issuecomment-370412835 PG1 2677 running. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] cjelger opened a new issue #3392: Sequence marked "final" can override action parameters
cjelger opened a new issue #3392: Sequence marked "final" can override action parameters URL: https://github.com/apache/incubator-openwhisk/issues/3392 When a web action sequence is marked `final`, it is still possible to override the parameters of its internal actions. To reproduce: create a `final` web action sequence using some action with a bound parameter. Check that it is possible to override that parameter when calling the web action. @rabbah as discussed on Slack. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #3391: Add namespace-blacklist to invoker.
rabbah commented on a change in pull request #3391: Add namespace-blacklist to invoker. URL: https://github.com/apache/incubator-openwhisk/pull/3391#discussion_r172170503 ## File path: ansible/files/namespace_throttlings_design_document_for_subjects_db.json ## @@ -0,0 +1,10 @@ +{ + "_id": "_design/namespaceThrottlings", + "views": { +"blockedNamespaces": { + "map": "function (doc) {\n if (doc._id.indexOf(\"/limits\") >= 0) {\n if (doc.concurrentInvocations === 0 || doc.invocationsPerMinute === 0) {\n var namespace = doc._id.replace(\"/limits\", \"\");\n emit(namespace, 1);\n}\n }\n}", + "reduce": "_sum" Review comment: How about also checking if the subject is blocked entirely? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #3391: Add namespace-blacklist to invoker.
rabbah commented on a change in pull request #3391: Add namespace-blacklist to invoker. URL: https://github.com/apache/incubator-openwhisk/pull/3391#discussion_r172170787 ## File path: core/invoker/src/main/scala/whisk/core/invoker/InvokerReactive.scala ## @@ -87,6 +86,17 @@ class InvokerReactive(config: WhiskConfig, instance: InstanceId, producer: Messa /** Initialize needed databases */ private val entityStore = WhiskEntityStore.datastore(config) private val activationStore = WhiskActivationStore.datastore(config) + private val authStore = WhiskAuthStore.datastore(config) + + private val namespaceBlacklist = new NamespaceBlacklist(authStore) + + Scheduler.scheduleWaitAtMost(5.minutes) { () => Review comment: Consider moving poll interval to a pure config deployment setting. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] rabbah commented on a change in pull request #3391: Add namespace-blacklist to invoker.
rabbah commented on a change in pull request #3391: Add namespace-blacklist to invoker. URL: https://github.com/apache/incubator-openwhisk/pull/3391#discussion_r172170844 ## File path: core/invoker/src/main/scala/whisk/core/invoker/InvokerReactive.scala ## @@ -87,6 +86,17 @@ class InvokerReactive(config: WhiskConfig, instance: InstanceId, producer: Messa /** Initialize needed databases */ private val entityStore = WhiskEntityStore.datastore(config) private val activationStore = WhiskActivationStore.datastore(config) + private val authStore = WhiskAuthStore.datastore(config) + + private val namespaceBlacklist = new NamespaceBlacklist(authStore) + + Scheduler.scheduleWaitAtMost(5.minutes) { () => +logging.info(this, "running background job to update blacklist") Review comment: Debug level? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] davidbreitgand commented on a change in pull request #375: Make interative mode able to set to false
davidbreitgand commented on a change in pull request #375: Make interative mode able to set to false URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/375#discussion_r172169733 ## File path: deployers/servicedeployer.go ## @@ -119,7 +119,7 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() error { manifestReader.InitRootPackage(manifestParser, manifest) - if deployer.IsDefault == true && !utils.Flags.WithinOpenWhisk { Review comment: With the new "export" capability added by @kpavel, the directory structure will be exported to the FS of the container, in which the action runs. The use case would be: "export" assets from one OW instance and "import" into another one via running wskdeploy from within an action. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] davidbreitgand commented on a change in pull request #375: Make interative mode able to set to false
davidbreitgand commented on a change in pull request #375: Make interative mode able to set to false URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/375#discussion_r172169617 ## File path: deployers/servicedeployer.go ## @@ -119,7 +119,7 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() error { manifestReader.InitRootPackage(manifestParser, manifest) - if deployer.IsDefault == true && !utils.Flags.WithinOpenWhisk { Review comment: With the new "export" capability added by @kpavel, the directory structure will be exported to the FS of the container, in which the action runs. The use case would be: "export" assets from one OW instance and "import" into another one via running wskdeploy from within an action. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] davidbreitgand commented on a change in pull request #375: Make interative mode able to set to false
davidbreitgand commented on a change in pull request #375: Make interative mode able to set to false URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/375#discussion_r172169617 ## File path: deployers/servicedeployer.go ## @@ -119,7 +119,7 @@ func (deployer *ServiceDeployer) ConstructDeploymentPlan() error { manifestReader.InitRootPackage(manifestParser, manifest) - if deployer.IsDefault == true && !utils.Flags.WithinOpenWhisk { Review comment: With the new "export" capability added by @kpavel, the directory structure will be exported to the FS of the container, in which the action runs. The use case would be: "export" assets from one OW instance and "import" into another one via running wskdeploy from within an action. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] cbickel opened a new pull request #3391: Add namespace-blacklist to invoker.
cbickel opened a new pull request #3391: Add namespace-blacklist to invoker. URL: https://github.com/apache/incubator-openwhisk/pull/3391 This commit adds a check to the invoker, if the current namespace is allowed to execute actions. This check is already done in the controller, but if the action is already in the queue and throttled afterwards, there is no chance to get this action out of the queue. With this commit, the invoker checks as well if the action is allowed to be executed. If it is not, it will be refused immediately. This will clean up the queue very fast. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] csantanapr closed pull request #3374: Use Docker ADD command to untar
csantanapr closed pull request #3374: Use Docker ADD command to untar URL: https://github.com/apache/incubator-openwhisk/pull/3374 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core/controller/Dockerfile b/core/controller/Dockerfile index 60d92237ce..ce772b497d 100644 --- a/core/controller/Dockerfile +++ b/core/controller/Dockerfile @@ -9,11 +9,10 @@ RUN curl -sSL -o swagger-ui-v3.6.0.tar.gz --no-verbose https://github.com/swagge # # Copy app jars -COPY build/distributions/controller.tar / -RUN tar xf controller.tar +ADD build/distributions/controller.tar / COPY init.sh / RUN chmod +x init.sh EXPOSE 8080 -CMD ["init.sh", "0"] \ No newline at end of file +CMD ["./init.sh", "0"] \ No newline at end of file diff --git a/core/invoker/Dockerfile b/core/invoker/Dockerfile index 1bc2164e45..0dbe11ac93 100644 --- a/core/invoker/Dockerfile +++ b/core/invoker/Dockerfile @@ -19,12 +19,10 @@ RUN wget --no-verbose https://storage.googleapis.com/kubernetes-release/release/ chmod +x kubectl && \ mv kubectl /usr/bin/kubectl -COPY build/distributions/invoker.tar ./ -RUN tar xf invoker.tar && \ -rm -f invoker.tar +ADD build/distributions/invoker.tar ./ COPY init.sh / RUN chmod +x init.sh EXPOSE 8080 -CMD ["init.sh", "0"] +CMD ["./init.sh", "0"] This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] chetanmeh commented on issue #3369: Use pureconfig for CouchDbRestStore
chetanmeh commented on issue #3369: Use pureconfig for CouchDbRestStore URL: https://github.com/apache/incubator-openwhisk/pull/3369#issuecomment-370372388 Last build failed due to low memory. Triggered a rebuild ``` # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 139984896 bytes for committing reserved memory. # An error report file with more information is saved as: Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0xd0b8, 139984896, 0) failed; error='Cannot allocate memory' (errno=12) # /home/travis/build/apache/incubator-openwhisk/tests/hs_err_pid19764.log ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] imesh commented on issue #319: plugable model for adding action language support
imesh commented on issue #319: plugable model for adding action language support URL: https://github.com/apache/incubator-openwhisk/issues/319#issuecomment-370368873 @rabbah @markusthoemmes It's nice to see this feature has been added to OpenWhisk for extending the language support. I checked in documentation and other online resources but I couldn't find much information on how to do that. Would you mind pointing me to any resources available for adding a new language to OpenWhisk using this model without using a native action? Thanks! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] daisy-ycguo commented on issue #52: Add license verification document
daisy-ycguo commented on issue #52: Add license verification document URL: https://github.com/apache/incubator-openwhisk-release/pull/52#issuecomment-370362179 I'm testing the verification of ASF header short form. The document needs update. Add tag "wip" This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] daisy-ycguo opened a new pull request #53: [WIP] add rat-excludes file
daisy-ycguo opened a new pull request #53: [WIP] add rat-excludes file URL: https://github.com/apache/incubator-openwhisk-release/pull/53 This pr is to add `.rat-excludes` file. Working in progress. The file `.rat-excludes` is under continued perfection. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ningyougang commented on issue #3380: Generate build relative files local
ningyougang commented on issue #3380: Generate build relative files local URL: https://github.com/apache/incubator-openwhisk/pull/3380#issuecomment-370359966 @markusthoemmes ,can you look at this, if `deployment node and target node are in same machine`, below ansible task will have no problem ``` - name: "Copy expanded archive to final configuration directory" copy: # WARNING: The trailing slash is significant, signalling to copy contents src: "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}/" dest: "{{ openwhisk_cli.nginxdir.name }}" ``` but if deployment node and target node are in different machines, will report `report Unable to find '{}' in expected paths error.` So submit a patch to solve the problem. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ningyougang commented on issue #3380: Generate build relative files local
ningyougang commented on issue #3380: Generate build relative files local URL: https://github.com/apache/incubator-openwhisk/pull/3380#issuecomment-370359966 @markusthoemmes ,can you look at this, if `deployment node and target node are in same machine`, below ansible task will has problem ``` - name: "Copy expanded archive to final configuration directory" copy: # WARNING: The trailing slash is significant, signalling to copy contents src: "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}/" dest: "{{ openwhisk_cli.nginxdir.name }}" ``` but if deployment node and target node are in different machines, will report `report Unable to find '{}' in expected paths error.` So submit a patch to solve the problem. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] ningyougang commented on issue #3380: Generate build relative files local
ningyougang commented on issue #3380: Generate build relative files local URL: https://github.com/apache/incubator-openwhisk/pull/3380#issuecomment-370359966 @markusthoemmes ,can you look at this, if `deployment node and target node are in same machine`, below ansible task has no problem ``` - name: "Copy expanded archive to final configuration directory" copy: # WARNING: The trailing slash is significant, signalling to copy contents src: "{{ openwhisk_build_dir }}/{{ openwhisk_cli.archive_name }}/" dest: "{{ openwhisk_cli.nginxdir.name }}" ``` but if deployment node and target node are in different machines, will report `report Unable to find '{}' in expected paths error.` So submit a patch to solve the problem. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes commented on a change in pull request #3369: Use pureconfig for CouchDbRestStore
markusthoemmes commented on a change in pull request #3369: Use pureconfig for CouchDbRestStore URL: https://github.com/apache/incubator-openwhisk/pull/3369#discussion_r172118723 ## File path: tests/src/test/scala/whisk/core/controller/test/ActivationsApiTests.scala ## @@ -526,18 +526,33 @@ class ActivationsApiTests extends ControllerTestCommon with WhiskActivationsApi implicit val materializer = ActorMaterializer() val activationStore = SpiLoader .get[ArtifactStoreProvider] - .makeStore[WhiskEntity](whiskConfig, _.dbActivations)( -classTag[WhiskEntity], -WhiskEntityJsonFormat, + .makeStore[WhiskActivation]()( +classTag[WhiskActivation], +WhiskActivation.serdes, WhiskDocumentReader, system, logging, materializer) implicit val tid = transid() -val entity = BadEntity(namespace, EntityName(ActivationId().toString)) -put(activationStore, entity) -Get(s"$collectionPath/${entity.name}") ~> Route.seal(routes(creds)) ~> check { +class BadActivation(override val namespace: EntityPath, Review comment: Ah got it, could you add a comment to the `toJson` method stating that it breaks the deserialization by removing the subject entry? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] markusthoemmes closed pull request #3348: Allow wskadmin user block/unblock to accept a list of subject to block
markusthoemmes closed pull request #3348: Allow wskadmin user block/unblock to accept a list of subject to block URL: https://github.com/apache/incubator-openwhisk/pull/3348 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tests/src/test/scala/whisk/core/admin/WskAdminTests.scala b/tests/src/test/scala/whisk/core/admin/WskAdminTests.scala index 482bb5c43b..58b1def910 100644 --- a/tests/src/test/scala/whisk/core/admin/WskAdminTests.scala +++ b/tests/src/test/scala/whisk/core/admin/WskAdminTests.scala @@ -151,6 +151,32 @@ class WskAdminTests extends TestHelpers with Matchers { } } + it should "block and unblock should accept more than a single subject" in { +val wskadmin = new RunWskAdminCmd {} +val subject1 = Subject().asString +val subject2 = Subject().asString +try { + wskadmin.cli(Seq("user", "create", subject1)) + wskadmin.cli(Seq("user", "create", subject2)) + + // empty subjects are expected to be ignored + wskadmin.cli(Seq("user", "block", subject1, subject2, "", " ")).stdout shouldBe { +s"""|"$subject1" blocked successfully +|"$subject2" blocked successfully +|""".stripMargin + } + + wskadmin.cli(Seq("user", "unblock", subject1, subject2, "", " ")).stdout shouldBe { +s"""|"$subject1" unblocked successfully +|"$subject2" unblocked successfully +|""".stripMargin + } +} finally { + wskadmin.cli(Seq("user", "delete", subject1)).stdout should include("Subject deleted") + wskadmin.cli(Seq("user", "delete", subject2)).stdout should include("Subject deleted") +} + } + it should "not allow edits on a blocked subject" in { val wskadmin = new RunWskAdminCmd {} val subject = Subject().asString diff --git a/tools/admin/wskadmin b/tools/admin/wskadmin index 861c9a9496..d5c579916a 100755 --- a/tools/admin/wskadmin +++ b/tools/admin/wskadmin @@ -108,11 +108,11 @@ def parseArgs(): subcmd = subparser.add_parser('whois', help='identify user from an authorization key') subcmd.add_argument('authkey', help='the credentials to look up') -subcmd = subparser.add_parser('block', help='block a user') -subcmd.add_argument('subject', help='the user to block') +subcmd = subparser.add_parser('block', help='block one or more users') +subcmd.add_argument('subjects', nargs='+', help='one or more users to block') -subcmd = subparser.add_parser('unblock', help='unblock a user') -subcmd.add_argument('subject', help='the user to unblock') +subcmd = subparser.add_parser('unblock', help='unblock one or more users') +subcmd.add_argument('subjects', nargs='+', help='one or more users to unblock') subcmd = subparser.add_parser('list', help='list authorization keys associated with a namespace') subcmd.add_argument('namespace', help='the namespace to lookup') @@ -231,7 +231,7 @@ def createUserCmd(args, props): uid = str(uuid.uuid4()) key = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(64)) -(doc, res) = getSubjectFromDb(args, props) +(doc, res) = getDocumentFromDb(props, args.subject, args.verbose) if doc is None: doc = { '_id': subject, @@ -268,7 +268,7 @@ def createUserCmd(args, props): return 1 def getUserCmd(args, props): -(doc, res) = getSubjectFromDb(args, props) +(doc, res) = getDocumentFromDb(props, args.subject, args.verbose) if doc is not None: if args.all is True: @@ -307,13 +307,11 @@ def listUserCmd(args, props): return 0 else: print('no identities found for namespace "%s"' % args.namespace) +return 0 else: print('Failed to get namespace key (%s)' % res.read().strip()) return 1 -def getSubjectFromDb(args, props): -return getDocumentFromDb(props, args.subject, args.verbose) - def getDocumentFromDb(props, doc, verbose): protocol = props[DB_PROTOCOL] host = props[DB_HOST] @@ -389,7 +387,7 @@ def deleteUserCmd(args, props): print('Namespace must not be empty') return 2 -(prev, res) = getSubjectFromDb(args, props) +(prev, res) = getDocumentFromDb(props, args.subject, args.verbose) if prev is None: print('Failed to delete subject (%s)' % res.read().strip()) return 1 @@ -470,34 +468,44 @@ def whoisUserCmd(args, props): return 1 def blockUserCmd(args, props): -(doc, res) = getSubjectFromDb(args, props) - -if doc is not None: -doc['blocked'] = True -insertRes = insertIntoDatabase(props, doc, args.verbose) -if insertRes.status in [201, 202]: -print('"%s" blocked