This file contains hidden or 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
| import { Dictionary } from './utility/Dictionary' | |
| import { Secret } from '@aws-cdk/aws-secretsmanager' | |
| import { LogDriver } from '@aws-cdk/aws-ecs' | |
| import { LogGroup } from './constructs/LogGroup' | |
| import { Alarm } from '@aws-cdk/aws-cloudwatch' | |
| import { AwsAccount } from './OkraInfra' | |
| import cdk = require('@aws-cdk/core') | |
| import ec2 = require('@aws-cdk/aws-ec2') | |
| import ecs = require('@aws-cdk/aws-ecs') | |
| import ecs_patterns = require('@aws-cdk/aws-ecs-patterns') |
This file contains hidden or 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
| import pyarrow | |
| import pyarrow.parquet as pq | |
| import signal | |
| import tarfile | |
| import sys | |
| import boto3 | |
| import io | |
| import json | |
| import re | |
| import pandas as pd |
This file contains hidden or 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
| const grafanaService = new ecs_patterns.ApplicationLoadBalancedFargateService(this, 'Grafana', { | |
| cluster: this.props.ecsCluster, | |
| taskDefinition: taskdef, | |
| domainZone: this.props.hostedZone, | |
| domainName: this.grafanaDns, | |
| publicLoadBalancer: true | |
| }) | |
| const sslListener = grafanaService.loadBalancer.addListener('SSL', { | |
| port: 443, |
This file contains hidden or 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
| function setupAutoTripTagging(parentStack: BackendAPIStack) { | |
| const databaseUsernameSecret = new Secret(parentStack, 'databaseUsername'); | |
| const databasePasswordSecret = new Secret(parentStack, 'databasePassword'); | |
| const tripTaggingModelBucket = new Bucket(parentStack, 'gofar-auto-trip-tag-models'); | |
| // sklearn etc. are MASSIVE and therefore exceed the lambda | |
| // limit (250MB). We upload the dependencies to S3 instead and the lambda will pull it down | |
| const rebuildModelDependencies = new Asset(parentStack, 'rebuildAutoTaggingModelLambdaDependencies', { | |
| path: './handlers/auto_trip_tagging_model_builder/dist/lambda_dependencies.tar.gz' |
This file contains hidden or 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
| mkdir -p dist | |
| tar -czvf dist/build_tag_model_lambda.tar.gz build_tagging_model.py |
This file contains hidden or 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
| [[source]] | |
| url = "https://pypi.python.org/simple" | |
| verify_ssl = true | |
| name = "pypi" | |
| [packages] | |
| pandas = "*" | |
| sklearn = "*" | |
| xgboost = "*" | |
| "psycopg2_binary" = "*" |
This file contains hidden or 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
| from __future__ import unicode_literals | |
| import boto3 | |
| import importlib | |
| import inspect | |
| import json | |
| import logging | |
| import os | |
| import sys | |
| import tarfile |
This file contains hidden or 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
| !function(o) { | |
| var d = null | |
| , l = null; | |
| function n(e) { | |
| e = e || 10; | |
| for (var t = "", a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", i = 0; i < e; ) | |
| t += a.charAt(Math.floor(Math.random() * a.length)), | |
| i++; | |
| return t | |
| } |
This file contains hidden or 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
| info has_replied_before; | |
| if(has_replied_before.toString() == "false") | |
| { | |
| update_payload = {"Has_replied_before":true}; | |
| update_resp = zoho.crm.updateRecord("Leads",lead_id,update_payload); | |
| // now SMS the lead back | |
| lead_data = zoho.crm.getRecordById("Leads",lead_id); | |
| // From: the Twilio number you will use to send the message | |
| from_number = "+61 123 457 686"; | |
| // To: the number to which the SMS should be sent |
This file contains hidden or 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
| info lead_type; | |
| lead_id = lead_id_str.toLong(); | |
| lead_data = zoho.crm.getRecordById("Leads",lead_id); | |
| // From: the Twilio number you will use to send the message | |
| from_number = "+61429357123"; | |
| // To: the number to which the SMS should be sent | |
| to_number = lead_data.get("Phone"); | |
| // The To Name will appear in the SMS Message title, e.g. "Sent to John Smith on 23-Mar-2020" | |
| to_name = lead_data.get("First_Name") + " " + lead_data.get("Last_Name"); | |
| // get the template ID from the URL of a template record |