Skip to content

Latest commit

 

History

History
143 lines (107 loc) · 4.22 KB

local-setup.adoc

File metadata and controls

143 lines (107 loc) · 4.22 KB

Local Setup

This walkthrough sets up a locally running OpenShift cluster for:

  • developing Mobile Services (via APBs)

  • developing the Mobile CLI

  • developing the Mobile specific UI in the OpenShift Web Console

Requirements

Hardware Requirements

  • Please make sure that you have at least 64GiB of free space on your filesystem

  • for smooth run have 16GiB of RAM

Tooling Requirements (Required)

Firewall Requirements (Required)

  1. Configure the Docker registry and ports required as part of the cluster setup:

    • Linux: Follow steps 2 and 3 here

    • Mac: Follow steps 2 and 3 here

  2. For Linux (Fedora) we also need to add an extra port to the dockerc zone:

    firewall-cmd --permanent --zone dockerc --add-port 443/tcp
    firewall-cmd --reload

Creating a Local Cluster

Clone this repository

git clone https://github.com/aerogear/mobile-core

Install the required ansible dependencies:

cd mobile-core
ansible-galaxy install -r ./installer/requirements.yml

Note: If you encounter a permission error for files under /etc/ansible/roles/ this is because non-root user does not have write access to the default ansible roles folder. You can either:

  • Allow write access to /etc/ansible/roles/

  • Run the above command with --roles-path ./installer/roles/

Run the Ansible Installer

The installer sets up your OpenShift environment with the service catalog and the OpenShift Ansible Broker (OAB). To run the ansible installer directly and specify any property values:

export DOCKERHUB_USERNAME=<my_dockerhub_username>
export DOCKERHUB_PASSWORD=<my_dockerhub_password>
ansible-playbook ./installer/playbook.yml -e "dockerhub_username=$DOCKERHUB_USERNAME" -e "dockerhub_password=$DOCKERHUB_PASSWORD" --ask-become-pass

Alternatively, to run a script that prompts for property values:

./installer/install.sh

A DockerHub username and password are currently required because the OpenShift Ansible Broker (OAB) calls Docker APIs to read/load Ansible Playbook Bundles from a Docker Hub organisation (defaults to aerogear).

Note
If the installer fails, run make clean in the repo home directory before running the installer again.
Note
If the installer hangs for a really long time or crashes on oc cluster up step, check free-space on your filesystem.

Optional

You can enable Hawkular metrics by passing -e 'hawkular_metrics=true' as part of your ansible-playbook command.

Local UI Development

cd ui
npm run grunt local

If you see an ENOSPC error, you may need to increase the number of files your user can watch by running this command:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Creating Mobile Apps

Once the installer is complete you should be able to access OpenShift at https://192.168.37.1:8443/console/. You will need to accept the self-signed certificate.

You can login using developer and any password.

Once logged in you should be presented with a catalog of services. To create your first Mobile App:

  1. Choose the Mobile category & Apps sub-category.

  2. Choose Android App

  3. Fill in the required information and continue through the wizard.

  4. The App should appear in the 'Mobile Applications' section of the Project Overview screen

Next Steps

  • To contribute , check out the Contributing section of the README.