This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_demo(intent_request): | |
caller_id = get_call_id(intent_request['sessionAttributes']) | |
output_session_attributes = intent_request['sessionAttributes'] if intent_request[ | |
'sessionAttributes'] is not None else {} | |
content = "Sorry, we couldn't find your Darius MLOps platform demo." | |
if caller_id is not '': | |
response = table.query( | |
KeyConditionExpression=Key('phoneNumber').eq(caller_id) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build_response_card(title, subtitle, options): | |
buttons = None | |
if options is not None: | |
buttons = [] | |
for i in range(min(5, len(options))): | |
buttons.append(options[i]) | |
return { | |
'contentType': 'application/vnd.amazonaws.card.generic', | |
'version': 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def schedule_demo(intent_request): | |
date = intent_request['currentIntent']['slots']['Date'] | |
appointment_time = intent_request['currentIntent']['slots']['Time'] | |
source = intent_request['invocationSource'] | |
caller_id = get_call_id(intent_request['sessionAttributes']) | |
output_session_attributes = intent_request['sessionAttributes'] if intent_request['sessionAttributes'] is not None else {} | |
timeslot_map = json.loads(try_except_key_error(lambda: output_session_attributes['timeslotMap']) or '{}') | |
if source == 'DialogCodeHook': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dispatch(intent_request): | |
logger.debug( | |
'dispatch userId={}, intentName={}'.format(intent_request['userId'], intent_request['currentIntent']['name'])) | |
intent_name = intent_request['currentIntent']['name'] | |
if intent_name == 'ScheduleDemo': | |
return schedule_demo(intent_request) | |
elif intent_name == 'CheckDemo': | |
return check_demo(intent_request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lambda_handler(event, context): | |
os.environ['TZ'] = 'Europe/Amsterdam' | |
time.tzset() | |
logger.debug('event.bot.name={}'.format(event['bot']['name'])) | |
logger.debug('event={}'.format(event)) | |
return dispatch(event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mappings: | |
- match: '*.*.jvm.*.*' | |
name: jvm_memory_usage | |
labels: | |
application: $1 | |
executor_id: $2 | |
mem_type: $3 | |
qty: $4 | |
- match: '*.*.jvm.pools.*.*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.sink.graphite.class=org.apache.spark.metrics.sink.GraphiteSink | |
*.sink.graphite.host=$GRAPHITE_EXPORTER_HOSTNAME | |
*.sink.graphite.port=$GRAPHITE_EXPORTE_PORT | |
*.sink.graphite.period=10 | |
*.sink.graphite.unit=seconds | |
master.source.jvm.class=org.apache.spark.metrics.source.JvmSource | |
worker.source.jvm.class=org.apache.spark.metrics.source.JvmSource | |
driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource | |
executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
graphite_exporter: | |
image: prom/graphite-exporter | |
command: "--graphite.mapping-config=/tmp/graphite_mapping_spark.conf" | |
container_name: graphite_exporter | |
volumes: | |
- $GRAPHITE_MAPPING_PATH/graphite_mapping_spark.conf:/tmp/graphite_mapping_spark.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Changes": [ | |
{ | |
"Action": "UPSERT", | |
"ResourceRecordSet": { | |
"AliasTarget": { | |
"HostedZoneId": "Z2FDTNDATAQYW2", | |
"EvaluateTargetHealth": false, | |
"DNSName": "<CLOUDFRONT_URI>" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Comment": "My Hugo Static Hosting on S3", | |
"Logging": { | |
"Bucket": "<LOGGING-BUCKET>.s3.amazonaws.com", | |
"Prefix": "cdn-cf/", | |
"Enabled": true, | |
"IncludeCookies": false | |
}, | |
"Origins": { | |
"Quantity": 1, |
NewerOlder