/Solution-Starter-Kit-Disasters-2020

WORK IN PROGRESS - Materials for the Call for Code 2020 solution starter kit for natural disaster resiliency in the context of climate change.

Apache License 2.0Apache-2.0

Disaster resiliency in the context of climate change

This solution starter was created by at the United Nations Human Rights Office in Geneva, Switzerland on February 27-28, 2020. It features contributions by technologists from Unity, Johnson & Johnson, and Red Hat.

Authors

  • Scott Sewell - Unity
  • Jochen Bertels - JNJ 
  • DeveloperSteve Coochin - IBM 
  • Joshua Zheng - IBM

Contents

  1. Overview
  2. Video
  3. The idea
  4. How it works
  5. Diagrams
  6. Documents
  7. Datasets
  8. Technology
  9. Getting started
  10. Resources
  11. License

Overview

What's the problem?

Natural disasters kill an estimated 90,000 people and affect close to 160 million people worldwide every year, according to the World Health Organization. Severe weather events in particular have been increasing in frequency and intensity over the past decade and scientists believe climate change is a significant factor.

Read the Sendai Framework for Disaster Risk Reduction to see how we make our communities safer and more resilient to disasters.

How can technology help?

Whether it's third-party open source projects or IBM Cloud services, technologies like data analytics, Internet of Things, artificial intelligence, and blockchain can help address global environmental challenges such as water quantity and quality. Using water more efficiently will reduce greenhouse gases from treatment systems.

Video

Call for Code Solution Starter: Water sustainability in the context of climate change

The idea

The team tackled the challenges that come in the process of rebuilding after the impact of a disaster. Research has shown that rapid yet well-informed and well-orchestrated rebuilding measures can help to massively reduce the negative impact of disasters on the life, well-being, and health of individuals. An effective and efficient system of accessing information and contributing feedback in a way that can improve the foundation of future decisions is key to this cycle.

In order to leverage the benefits of such a system it must be designed to allow for simple ingestion of information, data, images along with a user-friendly way of drawing insights from it. The team created a platform-based solution that aggregates and analyzes historical and current data related to infrastructure, agriculture, weather, utility and more. It can then be used to derive key insights for future response and reconstruction plans.

How it works

The goal of the application to provide a end to end solution to help potential victims combat floods. The team approached the problem by breaking the problem into three phases: before the flood, during the flood, and after the flood.

Before the flood, the user is presented a checklist of best practices on how to prepare for the upcoming flood. The checklist is derived from the Sendak Framework for diaster preparedness, along with recommendations from seasoned search and rescue professionals. The application will also enable the local authories to communicate with the user to better enforce disaster preparedness.

In the event of a flood, the app will switch into emergency mode. This mode can be activated by either the user or the local authorities. While in this mode, the app displays a simple evacuation route to the nearest shelter that still has capacity.

After the flood, the app will provide post-flood best practices to help victims rebuild their homes. The app will also enable a community marketplace, providing a platform for residents to trade resources and help push the economy to recover.

By combining IBM's Data & AI offerings with HERE Technologies' location services, a developer can quickly get started building such a solution. The starter kit offers a React Native template that has integration with Watson Assistant and HERE Technolgies' location services prebuilt, helping developers jumpstart the development process.

Diagrams

Challenge 1 Architecture

This solution starter idea combines machine learning models with real-time information to get users the information they need to take action quickly.

  1. By managing a collection of models about how better to restore infrastructure, the system could store historical data, use that to predict trends, and therefore provide recommendations in the form of an assessment.
  2. These models could then be referenced by various applications to collect information about the current situation and provide end users with the assessments.
  3. By rating the success of the recommendation, users can provide information that will help others in turn during future situations to build back better.

Documents

Datasets

Technology

Getting started

Prerequisite

You should have a basic understanding of the OpenWhisk programming model. If not, try the action, trigger, and rule demo first.

Also, you'll need an IBM Cloud account and the latest OpenWhisk command line tool (ibmcloud fn) installed and on your PATH.

As an alternative to this end-to-end example, you might also consider the more basic "building block" version of this sample.

Steps

  1. Provision MySQL
  2. Create OpenWhisk actions and mappings
  3. Test API endpoints
  4. Delete actions and mappings
  5. Recreate deployment manually

1. Provision MySQL

Log into the IBM Cloud and provision a ClearDB or a Compose for MySQL database instance. ClearDB has a free tier for simple testing, while Compose has tiers for larger workloads.

  • For ClearDB, log into the ClearDB dashboard, and select the default database created for you. Get the user, password and host information under "Endpoint Information".

  • For Compose, get the information from the Service Credentials tab in the IBM Cloud console.

Copy template.local.env to a new file named local.env and update the MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD and MYSQL_DATABASE for your MySQL instance.

2. Create OpenWhisk actions and mappings

deploy.sh is a convenience script reads the environment variables from local.env and creates the OpenWhisk actions and API mappings on your behalf. Later you will run these commands yourself.

./deploy.sh --install

Note: If you see any error messages, refer to the Troubleshooting section below. You can also explore Alternative deployment methods.

3. Test API endpoints

There are four helper scripts that simulate HTTP API clients to create, get, update and delete entities against the /v1/cat endpoint.

# POST /v1/cat {"name": "Tarball", "color": "Black"}
client/cat-post.sh Tarball Black

# GET /v1/cat?id=1
client/cat-get.sh 1 # Or whatever integer ID was returned by the command above

# PUT /v1/cat {"id": 1, "name": "Tarball", "color": "Gray"}
client/cat-put.sh 1 Tarball Gray

# DELETE /v1/cat?id=1
client/cat-delete.sh 1

4. Delete actions and mappings

Use deploy.sh again to tear down the OpenWhisk actions and mappings. You will recreate them step-by-step in the next section.

./deploy.sh --uninstall

Resources

License

This solution starter is made available under the Apache 2 License.