-
Notifications
You must be signed in to change notification settings - Fork 54
Cloning sources
- About
- Prepare source code directory
- Create Python virtual environment
- Install reana-dev helper script
- Fork all repositories
- Clone all repositories
- Next steps
REANA uses 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.
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
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.12. (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.12 as the Python version to use for
the reana
virtual environment.
To create a virtual environment named reana
with Python 3.12, follow these
steps:
$ pip install virtualenvwrapper
Find the location of virtualenvwrapper.sh
and add it to your shell configuration file (~/.bashrc
or ~/.zshrc
). You can use the which
command to locate it:
$ which virtualenvwrapper.sh
Once you have the path to virtualenvwrapper.sh
, add the following line to your shell configuration file and make sure to run it or open a new terminal to apply the changes:
$ source /path/to/virtualenvwrapper.sh
Replace /path/to/virtualenvwrapper.sh
with the actual path you obtained from the which
command.
Now, you can create the reana
virtual environment with Python 3.12 using
mkvirtualenv
:
$ mkvirtualenv reana -p python3.12
(reana) $ python -V
You should see output similar to this, indicating that Python 3.12 is in use:
Python 3.12.4
Now you have a Python virtual environment named "reana" with Python 3.12 set up and ready to use.
Let's install the reana-dev
helper script into the newly created environment:
(reana) $ pip install git+https://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
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.
For instance, you can run the following one-liner to open browser tabs in
Firefox for the manual forking. (You can pass your desired browser via -b
argument, or simply use open
for macOS.)
(reana) $ eval "$(reana-dev git-fork -c ALL -b firefox)"
Another option, if you have installed the gh command-line tool for GitHub, is to fork repositories fully automatically without any manual intervention:
(reana) $ reana-dev git-fork -c ALL --automatic
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 command clones the repositories from your personal fork and sets up
upstream
and origin
branches accordingly.
If you later want to sync your forks with the origin
, you can run:
reana-dev git-upgrade -c ALL
This will fetch the upstream
, merge, and push to your fork.
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.
REANA reproducible analysis platform
blog.reana.io | docs.reana.io | forum.reana.io | www.reana.io |
@gitter | @mattermost | @twitter
Introduction
Getting started
- Setting up your system
- Cloning sources
- Using production-like development mode
- Using live-code-reload and debug mode
Issue lifecycle
Understanding code base
Technology tips and tricks
- Tips for Docker
- Tips for Git
- Tips for GitLab
- Tips for Keycloak
- Tips for Kind
- Tips for Kubernetes
- Tips for OpenAPI
- Tips for PostgreSQL
- Tips for Python
- Tips for RabbitMQ
- Tips for SQLAlchemy