bbc/editorial-search-galileo-babel

Name: editorial-search-galileo-babel

Owner: BBC

Description: null

Created: 2018-03-09 20:50:36.0

Updated: 2018-05-16 10:22:14.0

Pushed: 2018-05-16 10:22:16.0

Homepage: null

Size: 69

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Editorial Search - Galileo Babel

This is the lambda function used to put galileo babel notifications into a bucket.

Fetch aws credentials

fetch-aws-creds 195048873603

Create virtual environment
 yum install python34-devel libcurl-devel
 pip3.4 install virtualenv
on3.4 -m virtualenv ~/galileo-babel
ce ~/galileo-babel/bin/activate

You will need to install troposhere and some other Python packages:

ip install pytest```
ip install boto3```

# Upload Lambda Function
reate a bucket to hold the lambda function. e.g```galileo-babel-lambda```. 
xecute the script ```deploy.sh``` to build and upload the zip file to the bucket

# Create the lambda stack

reate the stack template for an environment

In the directory  ```<APP_DIRECTORY>/infrastructure/src``` 

Type the following:
```python -m babel.environmentbuilder --lambda-function-bucket <s3-bucket-containing-zipped-lambda-function> --env <env> ```

eg:
```python -m babel.environmentbuilder --lambda-function-bucket galileo-babel-lambda --env int ```

NOTE: 
1. When you first run this, if the bucket does not exist it will create one. The name of the bucket created is extactly the same name as the lambda.
2. When you delete the stack if there is data in the bucket then it will not attempt to delete the bucket.
3. When you try to create the stack if the bucket already exist then the cloudformation script will not include the bucket creation component.
4. ```config.json``` contains the aws environment configurations used to create the stack
5. This is the link to the galileo bable documentationp page: https://confluence.dev.bbc.co.uk/display/mediatools/Galileo+Babel+User+Guide

# Test the lambda function

est the lambda function execute the following command: 

In the directory  ```<APP_DIRECTORY>/infrastructure``` 

Note: Make sure to change the name of the function in `setup.cfg`.

Development

After making changes to the lambda peform the following operations:

  1. “deploy.sh” This is used to put new code in to the bucket
  2. “update.sh” This is used to update the lambda to use the new code in the bucket

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.