Skip to content

Latest commit

 

History

History
138 lines (96 loc) · 3.67 KB

devel-quick-start.md

File metadata and controls

138 lines (96 loc) · 3.67 KB

Ramen developer quick start guide

Contribution Flow

  1. Fork the repository on GitHub
  2. Create a branch from where you want to base your work (usually main).
  3. Make your changes and arrange them in readable commits.
  4. Make sure your commit messages are in the proper format.
  5. Make sure all tests pass, and add any new tests
  6. Push your changes to the branch in your fork of the repository. as appropriate.
  7. Submit a pull request to the original repository.

Getting the source

  1. Fork the Ramen repository on github

  2. Clone the source locally

    git clone git@github.com:my-github-user/ramen.git
  3. Add an upstream remote, to make it easy to sync your repo from upstream.

    git remote add upstream https://github.com/RamenDR/ramen.git
  4. Add the commit-msg hook to sign off your commits

    Ramen requires a Signed-off-by: My Name <myemail@example.com> footer in the commit message. To add it automatically to all commits, add this hook:

    cp hack/commit-msg .git/hooks/

Setting up the environment for development and testing

To set up a Ramen development environment you will need to run 3 Kubernetes clusters. Ramen makes this easy using minikube, but you need enough resources:

  • Bare metal or virtual machine with nested virtualization enabled
  • 8 CPUs or more
  • 16 GiB of free memory
  • 20 GiB of free disk space
  • Internet connection
  • Linux - tested on RHEL 8.6 and Fedora 37.

Create and activate python virtual environment

The Ramen project uses python tools to create and provision test environment and run tests. To create a virtual environment including the tools run:

make venv

This creates a virtual environment in ~/.venv/ramen and a symbolic link venv for activating the environment.

Activate the python virtual environment:

source venv

Create the environment

You can run the make target create-rdr-env to create a 3 cluster environment for suitable for Regional DR. This will create 3 minikube clusters, and install the necessary components for the Ramen operator to run.

This uses drenv tool to setup the environment. Refer to drenv readme for more details.

make create-rdr-env

Building the ramen operator image

Build the Ramen operator container image:

make docker-build

This builds the image quay.io/ramendr/ramen-operator:latest

Deploying the ramen operator

You can either deploy the Ramen operator using the make targets or use the ramenctl tool. For more info on the ramenctl tool see ramenctl/README.md.

  • Using ramenctl

    Ensure python virtual environment is active as ramenctl is a python tool. The default name-prefix in the make target create-rdr-env is rdr-, we will use the same in the ramenctl commands.

    • Deploy the Ramen operator in the environment using ramenctl.
    ramenctl deploy --name-prefix rdr- test/envs/regional-dr.yaml
    • Ramen needs to be configured to know about the managed clusters and the s3 endpoints. Configure the ramen operator for environment.
    ramenctl config --name-prefix rdr- test/envs/regional-dr.yaml

Testing Ramen

  • Read the testing guide for test instructions.

Undeploying the ramen operator

If you want to clean up your environment, you can unconfigure Ramen and undeploy it.

ramenctl unconfig --name-prefix rdr- test/envs/regional-dr.yaml
ramenctl undeploy --name-prefix rdr- test/envs/regional-dr.yaml