From 4235618522f0d4524f57233b6e02dec2f6c985ef Mon Sep 17 00:00:00 2001 From: muawiakh Date: Mon, 18 Sep 2017 15:59:49 +0200 Subject: [PATCH] Addressing comments - support public_network for vagrant box - using python3-5 for centos based installations - Revisiting docs. - More changes will be incorporated in another PR. - Parameterize MongoDB host mount path for docker deployments --- docs/server/source/introduction.md | 1 - docs/server/source/quickstart.md | 8 +------- pkg/Vagrantfile | 10 ++++++++-- pkg/ansible/roles/bigchaindb-driver/defaults/main.yml | 5 +++-- pkg/ansible/roles/bigchaindb-driver/tasks/centos.yml | 4 ++-- pkg/ansible/roles/bigchaindb/defaults/main.yml | 5 +++-- pkg/ansible/roles/bigchaindb/tasks/centos.yml | 6 +++++- pkg/ansible/roles/mongodb/defaults/main.yml | 10 ++++++---- pkg/config/bdb-config.yaml | 4 +++- pkg/scripts/bootstrap_helper.sh | 1 + 10 files changed, 32 insertions(+), 22 deletions(-) diff --git a/docs/server/source/introduction.md b/docs/server/source/introduction.md index 58d7de16..5c48a8fe 100644 --- a/docs/server/source/introduction.md +++ b/docs/server/source/introduction.md @@ -22,7 +22,6 @@ Note that there are a few kinds of nodes: There are some old RethinkDB-based deployment instructions as well: * [Deploy a bare-bones RethinkDB-based node on Azure](appendices/azure-quickstart-template.html) -* [Deploy a bare-bones RethinkDB-based node on any Ubuntu machine with Ansible](appendices/template-ansible.html) * [Deploy a RethinkDB-based testing cluster on AWS](appendices/aws-testing-cluster.html) Instructions for setting up a client will be provided once there's a public test net. diff --git a/docs/server/source/quickstart.md b/docs/server/source/quickstart.md index ba755a7a..62a31fb9 100644 --- a/docs/server/source/quickstart.md +++ b/docs/server/source/quickstart.md @@ -1,12 +1,6 @@ # Quickstart -This page has instructions to set up a single stand-alone BigchainDB node manually for learning or experimenting. Instructions for other cases are [elsewhere](introduction.html). You might try one of the following deployment methods -as well, depending on your choice: -- [BigchainDB with Docker](appendices/run-with-docker.html). -- [BigchainDB with Vagrant](appendices/run-with-vagrant.html). -- [BigchainDB with Ansible](appendices/run-with-ansible.html). - -For manual installation, We will assume you're using Ubuntu 16.04 or similar. +This page has instructions to set up a single stand-alone BigchainDB node for learning or experimenting. Instructions for other cases are [elsewhere](introduction.html). We will assume you're using Ubuntu 16.04 or similar. If you're not using Linux, then you might try [running BigchainDB with Docker](appendices/run-with-docker.html). A. Install MongoDB as the database backend. (There are other options but you can ignore them for now.) diff --git a/pkg/Vagrantfile b/pkg/Vagrantfile index e998b4af..b8720016 100644 --- a/pkg/Vagrantfile +++ b/pkg/Vagrantfile @@ -33,7 +33,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end end bdb.vm.hostname = instance["name"] - bdb.vm.network instance["network"]["type"], ip: instance["network"]["ip"] + if instance["network"]["type"] == "private_network" + bdb.vm.network instance["network"]["type"], ip: instance["network"]["ip"] + elsif instance["network"]["type"] == "public_network" + bdb.vm.network instance["network"]["type"], use_dhcp_assigned_default_route: true, bridge: instance["network"]["bridge"] + else + raise "Invalid network type: Please specify one of the following: [private_network, public_network]" + end bdb.vm.box = instance["box"]["name"] bdb.vm.synced_folder ".", "/bigchaindb" bdb.vm.provision :shell, inline: "cd /bigchaindb/scripts;/bin/bash #{instance["upstart"]}" @@ -53,4 +59,4 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end end end -end \ No newline at end of file +end diff --git a/pkg/ansible/roles/bigchaindb-driver/defaults/main.yml b/pkg/ansible/roles/bigchaindb-driver/defaults/main.yml index bf1297bf..63485cce 100644 --- a/pkg/ansible/roles/bigchaindb-driver/defaults/main.yml +++ b/pkg/ansible/roles/bigchaindb-driver/defaults/main.yml @@ -8,10 +8,10 @@ dependencies_deb: dependencies_yum: - gcc-c++ - "@Development Tools" - - python34-devel + - python35u-devel - libffi-devel - openssl-devel - - python34-setuptools + - python35u-setuptools dependencies_dnf: - gcc-c++ @@ -20,6 +20,7 @@ dependencies_dnf: - python3-devel - libffi-devel - openssl-devel + - python3-pip python_pip_upgrade: true python_setuptools_upgrade: true \ No newline at end of file diff --git a/pkg/ansible/roles/bigchaindb-driver/tasks/centos.yml b/pkg/ansible/roles/bigchaindb-driver/tasks/centos.yml index e6014e4b..0eb69356 100644 --- a/pkg/ansible/roles/bigchaindb-driver/tasks/centos.yml +++ b/pkg/ansible/roles/bigchaindb-driver/tasks/centos.yml @@ -6,7 +6,7 @@ update_cache: yes with_items: "{{ dependencies_yum }}" tags: [bigchaindb-driver] - + - name: Install pip - shell: "easy_install-3.4 pip" + shell: "easy_install-3.5 pip" tags: [bigchaindb-driver] \ No newline at end of file diff --git a/pkg/ansible/roles/bigchaindb/defaults/main.yml b/pkg/ansible/roles/bigchaindb/defaults/main.yml index 3b75ae42..83058813 100644 --- a/pkg/ansible/roles/bigchaindb/defaults/main.yml +++ b/pkg/ansible/roles/bigchaindb/defaults/main.yml @@ -10,10 +10,10 @@ dependencies_deb: dependencies_yum: - gcc-c++ - "@Development Tools" - - python34-devel + - python35u-devel - libffi-devel - openssl-devel - - python34-setuptools + - python35u-setuptools dependencies_dnf: - gcc-c++ @@ -22,6 +22,7 @@ dependencies_dnf: - python3-devel - libffi-devel - openssl-devel + - python3-pip python_pip_upgrade: true python_setuptools_upgrade: true diff --git a/pkg/ansible/roles/bigchaindb/tasks/centos.yml b/pkg/ansible/roles/bigchaindb/tasks/centos.yml index e8ca5cd8..912d0f74 100644 --- a/pkg/ansible/roles/bigchaindb/tasks/centos.yml +++ b/pkg/ansible/roles/bigchaindb/tasks/centos.yml @@ -13,4 +13,8 @@ state: present update_cache: yes with_items: "{{ dependencies_yum }}" - tags: [bigchaindb] \ No newline at end of file + tags: [bigchaindb] + +- name: Install pip + shell: "easy_install-3.5 pip" + tags: [bigchaindb-driver] \ No newline at end of file diff --git a/pkg/ansible/roles/mongodb/defaults/main.yml b/pkg/ansible/roles/mongodb/defaults/main.yml index ea4656df..950b4a18 100644 --- a/pkg/ansible/roles/mongodb/defaults/main.yml +++ b/pkg/ansible/roles/mongodb/defaults/main.yml @@ -14,7 +14,7 @@ mongodb_yum_base_url: "https://repo.mongodb.org/yum/{{ ansible_os_family|lower } mongodb_dnf_base_url: "https://repo.mongodb.org/yum/{{ ansible_os_family|lower }}/7/{{ mongodb_package }}/{{ mongodb_version }}/{{ ansible_architecture }}" # MongoDB running config -mongodb_storage_path: /data/db +mongodb_storage_path: /data/db/main mongodb_log_path: /var/log/mongodb mongodb_config_path: /data/configdb se_linux: "TODO: (muawiakh)" @@ -25,10 +25,12 @@ directories: # Docker configuration mongodb_default_port: 27017 -mongodb_docker_image: "mongo:3.4.1" +mongodb_docker_image: "mongo:3.4.4" mongodb_docker_name: "mongodb" mongodb_docker_published_ports: - 172.17.0.1:27017:27017 +mongodb_host_mount_dir_db: /tmp/mongodb_docker/db +mongodb_host_mount_dir_config: /tmp/mongodb_docker/configdb mongodb_docker_volumes: - - "/tmp/mongodb_docker/db:{{ mongodb_storage_path }}" - - "/tmp/mongodb_docker/configdb:{{ mongodb_config_path }}" \ No newline at end of file + - "{{ mongodb_host_mount_dir_db }}:{{ mongodb_storage_path }}" + - "{{ mongodb_host_mount_dir_config }}:{{ mongodb_config_path }}" \ No newline at end of file diff --git a/pkg/config/bdb-config.yaml b/pkg/config/bdb-config.yaml index de9d1fce..86acac56 100644 --- a/pkg/config/bdb-config.yaml +++ b/pkg/config/bdb-config.yaml @@ -8,5 +8,7 @@ deploy_docker: true # [true, false] network: ip: "10.20.30.50" - type: "private_network" # Currently, only private network is supported. + type: "private_network" + # Active network interface on host, Only required for public network e.g "en0: Wi-Fi (AirPort)" + bridge: "" upstart: "/bigchaindb/scripts/bootstrap.sh" # Path to upstart script diff --git a/pkg/scripts/bootstrap_helper.sh b/pkg/scripts/bootstrap_helper.sh index 9d4633ea..2c8abd32 100755 --- a/pkg/scripts/bootstrap_helper.sh +++ b/pkg/scripts/bootstrap_helper.sh @@ -79,6 +79,7 @@ install_deps_deb() { install_deps_centos() { echo "Installing Dependencies..." yum install epel-release -y + yum install -y https://centos7.iuscommunity.org/ius-release.rpm yum install ansible -y } install_deps_fedora() {