19

Click here to load reader

SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

Embed Size (px)

DESCRIPTION

SahanaCamp NYC Day 2 PM session: Deploying Sahana Eden

Citation preview

Page 1: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

11SahanaSahanaCampCamp LALA

Deploying Sahana EdenFran Boon

[email protected]

Page 2: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Agenda

Deployment Options

Hardware Requirements

Skills required For Installation/Configuration

For Customization

Page 3: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

33SahanaSahanaCampCamp NYCNYC

Deployment Options

Host locally in the command center

on a Laptop

Host in the Cloud

Synchronize these 2 together...

Page 4: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Hardware RequirementsStandalone PC Windows or Mac

Server Virtual Server 512 Mb RAM, 4 Gb HDD:

Cloud Amazon EC2 (free tier available for 1 year)

Page 5: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Architecture

Operating System

Database

Programming Language

Web Framework

Sahana Eden

Web Server e.g. Apache

Application

Web2Py

Python

MySQL or PostgreSQL

Windows, Linux or Mac

Page 6: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Installation processWizard on Wiki to select correct instructions:http //eden.sahanafoundation.org/wiki/InstallationGuidelines:

End-User Installer for Windows: Local hard disk

Flash drive

Page 7: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Production ServerPhysical/Dedicated Server or Virtual Server

Base OS Debian Linux best-supported

Database MySQL

PostgreSQL

Pre-image Installation script

Post-Image Configuration script

Page 8: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Amazon EC2Sign-up with credit card

Select Data Center closest to you e.g. US East (Virginia)

EBS for free tier

Community AMIs Debian Squeeze:SSH key (private/public)

Grow Volume if 3Gb (hardest part)<Normal Server Scripts

Page 9: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Amazon EC2

Page 10: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Configurationeden/models/000 config.py_deployment settings_ Databasedatabase.db type mysql_ = " "database.host 10.14.6.3= " " Enable/Disable/Rename Modules("org", Storage( name_nice = T("Organizations"), Brandingsystem_name = T("Sahana Eden Emergency Portal")

Page 11: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

ConfigurationSecurity Policy

1 Simple (default) Global as Reader, Authenticated as Editor: : 2 Editor role required for Update/Delete, unless record owned :

by session 3 Apply Controller ACLs: 4 Apply both Controller & Function ACLs: 5 Apply Controller, Function & Table ACLs: 6 Apply Controller, Function, Table ACLs and Entity Realm: 7 Apply Controller, Function, Table ACLs and Entity Realm : +

Hierarchy 8 Apply Controller, Function, Table ACLs, Entity Realm : +

Hierarchy and Delegations

Page 12: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Configuration Authentication optionsself_registration = Trueregistration_requires_verification = Trueregistration_requires_approval = True

Facebook, Google, LDAPgoogle_id = "645861.apps.googleusercontent.com"google_secret = "1EZYxpRV4iMAVvv_pA"

Workflowsreq.use_commit = Falsereq.generate_req_number = False

Page 13: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Configuration Localization optionsdeployment_settings.L10n.languages = OrderedDict([

("ar", "العربية"), ("zh-cn", "中文 (简体 )"), ("zh-tw", "中文 (繁體 )"),

L10n.date_format = T("%m-%d-%Y")L10n.decimal_separator = "."L10n.thousands_separator = ","

Page 14: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Prepopulateprivate/prepopulate tasks.cfg

CSVs Lookup Lists

Assessment Templates

Roles

Test/Demo Data

Import after Installation Same CSVs

Page 15: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

MaintenanceBackups

Upgrades /usr/local/bin/clean /usr/local/bin/pull /usr/local/bin/compile Maintenance Mode

Disable Web Access Holding Page: Disable Scheduler

Page 16: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

DevelopmentCustomising Sahana Eden Python

JavaScript

Version Control Git: Get changes merged upstream

Page 17: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Testing

Manual Document Test Cases

Normal Workflows Exception Conditions Security

Automated Selenium (Browser-based)

Test-friendly code Suite of reusable libraries Run with different data sets Check preconditions directly as faster

Page 18: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

Release Process

Page 19: SahanaCamp NYC Day 2 PM: Deploying Sahana Eden

SahanaSahanaCampCamp NYCNYC

Summary

Flexible Deployment Options Laptop Windows or Mac: Server Linux: Cloud Amazon, Linux:Configuration Deployment Settings

Prepopulate CSVs

Customisation Development Python & JavaScript: Testing

Release Management