Giter VIP home page Giter VIP logo

rockstor-dev-env's Introduction

Rockstor Development Environment

Introduction

You can use this vagrant environment to build a vagrant box VM of a confirmed working specification with rockstor installed from source for testing.

It will use the ansible playbook and roles in this repository to perform the VM provisioning. However, Vagrant generates it's own host inventory since it operates using the vagrant user. eg.

ANSIBLE_GROUPS = {
  "all_groups" => ["rockstor"],
  "all_groups:vars" => {
        "rs_inst_set_root_pass" => "true"
    }
}

Prerequisites

It is assumped that you have the follow software packages install on you host machine:

All above packages are available on Linux, MacOS, and Windows.

You will also need one of the following virtualisation platforms:

  • Linux users: may prefer to use libvirt, qemu + kvm (see vagrant-libvirt)
  • Virtualbox is available on all platforms: Download

It is also assumed that you have a local copy of the core repository rockstor-core on your machine at the same level as this repo:

./rockstor-core
./rockstor-dev-env

You should also be currently within the vagrant_env directory in this repo, where the Vagrantfile is located.

Vagrant Boxes

This Vagrantfile uses a number of vagrant boxen:

Building an OpenSUSE Leap VM and installing Rockstor from source

On MacOS, Linux and Windows:

./build.sh

This will, by default, build and provision an OpenSUSE Leap 15.2 vagrant box in libvirt - including rsyncing the source to the VM in /root. It will then build and install Rockstor from source.

Should you prefer to use VirtualBox you can perform the following:

./build.sh leap virtualbox

The VM window should have popped up and show the usual Rockstor messages regarding how to reach the Web UI. e.g.

Rockstor is successfully installed.

web-ui is accessible with the following links:
https://127.0.0.1
https://10.0.2.15
https://172.28.128.101
https://172.28.128.100
rockstor login:

Note: your IPs may vary.

CAUTION: This command will ALWAYS do a clean build due to the nature of the vagrant rsync which uses the rsync option --delete.

To do subsequent builds see the Aliases section that follows on how to login as root and run further operations.

Accessing Rockstor on the VMs

Port forwarding is used to provide local access to the Rockstor Web UI. To allow you to have Rockstor built and running in each platform side by side port the ports are assigned as follows:

VM Name Host Port Guest Port Example URL
rockstor-leap 2443 443 https://172.28.128.101:2443
rockstor-tw 2444 443 https://172.28.128.101:2444
rockstor-pi 2445 443 https://172.28.128.101:2445

Aliases

Some aliases are defined in the file alias_rc to assist with some commands detailed in the developer contribution docs.

These are appended onto the file /root/.bashrc so that they are available when logged in as the root user.

Typically in the world of vagrant you login as the user vagrant and use sudo for privilege escalation. However, for ease in this case and in line with the instructions you can also log in as root in one of the following ways:

host> vagrant ssh
vm> su root
password: vagrant
vm> cd

or

host> ssh root@<vm IP>
password: vagrant

If you have set the ansible option rs_inst_set_root_pass: yes then the root password will be defined in ansible/roles/rockstor_installer/defaults/main.yml and defaults to password.

From here the aliases can be used. Here is a summary of them:

build_init
build_all
build_ui
make_mig_stadm
apply_migrations_stadm
make_mig_smtmgr
apply_migrations_smtmgr

See alias_rc for details

Deploy from Testing Channel

If you wish to deploy a VM from the Test Channel RPMs (rather than building from source) you need to update the ansible playbook ansible/Rockstor.yml to set the variable rs_inst_install_from_repo: yes as follows:

  roles:
    - role: rockstor_installer
      vars:
        rs_inst_install_from_repo: yes

Then simply bring up the VM using the command:

vagrant up

Do NOT run build.sh in this scenario.

Building for Tumbleweed and Aarch64

To build for Tumbleweed x86_64 in libvirt:

./build.sh tw

or for VirtualBox:

./build.sh tw virtualbox

To build for Tumbleweed Aarch64 in libvirt:

NOTE: Work in progress... only works on libvirt see vagrant libvirt plugin:

./build.sh pi

Managing the Virtual Machine

To manage the Vagrant box VM simply type the following from this directory...

  • Enable disk management to allow creation of data disks requires the enablement of the experimental disk feature. You can set these for the current shell, or enable them permanently by setting them in ~/.profile, ~/.bashrc, or likewise:

    export VAGRANT_EXPERIMENTAL="disks"
    export VAGRANT_DEFAULT_PROVIDER=kvm

    Note: This is enabled in build.sh but needs external enablement if you wish to use discrete vagrant calls below.

  • Bring up all vagrant box VMs in libvirt

    vagrant up --provider=libvirt

    or for VirtualBox

    vagrant up --provider=virtualbox

    Note: You can NOT manage boxes in both libvirt and VirtualBox at the same time.

  • Bring up a particular vagrant box VM

    vagrant up <box-name eg. rockstor-core> --provider=libvirt
  • Reconfigure the vagrant box VM following a change to the Vagrantfile:

    vagrant reload

    or

    vagrant reload <box-name eg. rockstor-core>
  • If you change the provisioner section of the Vagrantfile or update the ansible, you can rerun just that part as follows:

    vagrant provision

    or

    vagrant provision <box-name eg. rockstor-core>
  • Destroy the vagrant box VM:

    vagrant destroy

    or

    vagrant destroy <box-name eg. rockstor-core>
  • If you wish to ssh into the vagrant box VM to poke around, try this:

    vagrant ssh

    or

    vagrant ssh <box-name eg. rockstor-core>
  • If you wish to re-rsync your source files (warning this will have the effect of cleaning the build too due to using the --delete options):

    vagrant rsync

    or

    vagrant rsync <box-name eg. rockstor-core>

Debugging Ansible

If you need additional debug for the ansible configuration add additional v's to the ansible.verbose variable in the Vagrantfile. eg.

    config.vm.provision "rockstor", type: "ansible" do |ansible|
        ansible.config_file = "../ansible/ansible.cfg"
        ansible.playbook = "../ansible/Rockstor.yml"
        ansible.verbose = "vvvv"
        ansible.groups = ANSIBLE_GROUPS

rockstor-dev-env's People

Contributors

phillxnet avatar stephenbrown2 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rockstor-dev-env's Issues

Repo in Legacy status until updated

This repository is basically behind the times. Based on the now defunct openSUSE Leap 15.3 images etc.

It is to be considered legacy and likely will receive Archive status unless updated in a timely manner.

A link within the repo has been made to our official developer docs, which use our official installer downloads as a basis upon which to establish a development environment. Capable of source builds and rpm builds.

See also the following GitHub repository: https://github.com/rockstor/rockstor-rpmbuild

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.