Skip to content

Cloning sources

Tibor Šimko edited this page Apr 27, 2022 · 11 revisions

Contents

  1. About
  2. Prepare source code directory
  3. Create Python virtual environment
  4. Install reana-dev helper script
  5. Fork all repositories
  6. Clone all repositories
  7. Next steps

About

REANA uses [github.com/reanahub(https://github.com/reanahub) organisation. The source code is organised in many different repositories. In order to do full-scale REANA development, we should fork all the repositories and clone them locally. This page explains how to facilitate this work.

Prepare source code directory

We start by preparing a new directory that will hold the sources. We'll assume ~/project/reana/src:

$ mkdir -p ~/project/reana/src
$ cd ~/project/reana/src

Create Python virtual environment

REANA comes with a reana-dev helper package for developers that automatise some of the processes across many different repositories. We can use it to facilitate forking sources as well.

We shall therefore start by preparing a Python virtual environment where we shall be working. We'll call it reana.

It is important to select an appropriate Python version to use. When developing REANA and using live code reloading and debugging features, it comes handy to use the same Python version locally as the one used in the REANA cluster components inside the containers. At the time of this writing, it is Python version 3.8. (Note that you can verify reana-server's Dockerfile to see whether this is still the current version.) Using the same version will help to ensure that any *.pyc or .eggs packages will be the same when mounting local file system into the containers, or that we compile proper container package dependencies when using pip-compile outside of the container.

We therefore specify Python 3.8 as the Python version to use for the reana virtual environment:

$ mkvirtualenv reana -p python3.8
(python) $ python -V
Python 3.8.12

Install reana-dev helper script

Let's install the reana-dev helper script into the newly created environment:

(reana) $ pip install git+git://github.com/reanahub/reana.git#egg=reana

In order to simplify the authentication with GitHub, we set up SSH keys for password-less access. We can run ssh-agent manually:

(reana) $ eval "$(ssh-agent -s)"
(reana) $ ssh-add ~/.ssh/id_rsa

Fork all repositories

We now use reana-dev helper script to assist in forking all repositories. Assuming our GitHub user name is johndoe, the REANA convention uses upstream for github.com/reanahub/some-package and origin for its github.com/johndoe/some-package fork.

Run the following one-liner to open browser tabs:

(reana) $ eval "$(reana-dev git-fork -c ALL) -b firefox"

You can pass the desired browser command via -b argument. For macOS, you can simply use open.

Clone all repositories

Now that you have forked all REANA repositories into your personal GitHub space, we can clone them locally using another reana-dev helper script command:

(reana) $ reana-dev git-clone -c ALL -u johndoe

This commands clones the repositories from your personal fork and sets up upstream and origin branches accordingly.

Next steps

We now have ~/project/reana/src directory populated with all the cloned source code repositories. We can proceed to building and deploying REANA cluster following Using production-like development mode.