Git Product home page Git Product logo

openattic-vagrant's Introduction

openattic-vagrant

This repository contains configuration files that simplify the setup of the development environment to work on openATTIC with a ceph cluster managed by DeepSea.

Vagrant will instantiate four VMs using an opensuse/openSUSE-42.2-x86_64 box:

VM IP Roles Description
salt 192.168.100.200 master, admin Run openattic-docker container or openattic (salt-master + salt-minion)
node1 192.168.100.201 mon, igw, rgw, mgr Run ceph (salt-minion)
node2 192.168.100.202 mon, igw, ganesha, mgr Run ceph (salt-minion)
node3 192.168.100.203 mon, rgw, ganesha Run ceph (salt-minion)

Requirements

Setup

Configuration resides in the settings.yml file that contains the custom configuration to spin up the cluster. See settings.sample.yml for an example of the settings.yml that you must create.

settings.yml

Option Type Default Description
openattic_repo string ~/openattic Path to the local copy of the openATTIC repository
deepsea_repo string ~/DeepSea Path to the local copy of the DeepSea repository
openattic_docker_repo string https://github.com/openattic/openattic-docker.git openattic-docker git url
openattic_docker_branch string master openattic-docker git branch
libvirt_host IP address none
libvirt_user string none
libvirt_use_ssl boolean none
vm_memory integer 4096 VM memory
vm_cpus integer 2 VM CPUs
vm_storage_pool string none VM storage pool
vm_num_volumes integer 2 VM volumes number
vm_volume_size binary size 8G VM volume size
nfs_auto_export boolean true Enables/disables vagrant from changing the contents of /etc/exports
build_openattic_docker_image boolean false Enables/disables the build of the openattic docker image during provisioning
create_openattic_node boolean false Creates a new node to test openATTIC installations through zypper/rpm
num_nodes integer 3 The number of nodes

Spin up cluster

  • Run vagrant up and wait a few minutes
  • Connect to salt VM: vagrant ssh salt
  • Now you should choose if you want to use docker (1) or not (2)
  1. Using docker

    You can execute oa-docker-bash.sh on salt VM to access openATTIC docker container Use oa-docker-log.sh on salt VM to follow the openattic.log (with colors)

  2. Without using docker

    • Install openattic: sudo bin/oa-install.sh
    • Activate virtual env: . env/bin/activate
    • Run server: python openattic/backend/manage.py runserver 0.0.0.0:8001
    • Access openATTIC at: http://192.168.100.200:8001

Running tests

E2E tests

This development environment is ready to run all ceph e2e tests. Follow the openATTIC Web UI Tests - E2E Test Suite documentation to install protractorand use the following configs.js file to run e2e tests:

'use strict';
(function(){
  module.exports = {
    urls: {
      base: 'http://192.168.100.200',
      ui: '/openattic/#/',
      api: '/openattic/api/'
    },
    username: 'openattic',
    password: 'openattic',
    sleep   : 2000,
    outDir: '/tmp',
    cephCluster: {
      cluster1: {
        name: 'ceph',
        pools: {
          cephPool1: {
            name    : 'rbd',
            size    : '5.91',
            unit    : 'GB',
            writable: true
          }
        }
      }
    }
  };
}());

Other settings

NFS sharing when running libvirt in a remote host

When using Vagrant to spin up a VM running in a remote libvirt host, Vagrant will have trouble exporting the NFS shared folders to the VM due to the way it changes the /etc/exports file.

In this case the best approach is for you to manually edit the /etc/exports file, and put the following lines:

"/home/vagrant-openattic-docker/openattic" *(rw,no_subtree_check,all_squash,insecure,anonuid=UID,anongid=GID)
"/home/vagrant-openattic-docker/DeepSea" *(rw,no_subtree_check,all_squash,insecure,anonuid=UID,anongid=GID)

Where UID and GID should be substituted by the values of the id -u and id -g commands respectively, and change the path of the directories to match your environment.

After manually edit the /etc/exports file, restart the nfs service, and change the option nfs_auto_export in your settings.yml to false.

Now you're ready to do vagrant up, and the openATTIC and DeepSea directories will be successfully shared inside your VMs.

openattic-vagrant's People

Contributors

ricardoasmarques avatar rjfd avatar votdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

openattic-vagrant's Issues

Django server: Port 8000 already in use

Hi Ricardo,

I'm getting this:

ssh://[email protected]:22/home/vagrant/env/bin/python -u /home/vagrant/openattic/backend/manage.py runserver 0.0.0.0:8000
..snip...
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Error: That port is already in use.

Process finished with exit code 1

Turns out, salt-api already uses port 8000.

What do you think of changing the salt-api port to something different? My workaround is of course changing the Django server's port.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.