Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Latest commit

 

History

History
118 lines (92 loc) · 3.67 KB

getting_started.md

File metadata and controls

118 lines (92 loc) · 3.67 KB

Move back to documentation homepage

Contents

Build

Step 1: A 64 bit Python 3 installation is required by PyTorch.

Step 2: To install PyTorch head over to https://pytorch.org/ and follow the quick start guide based on your operating system.

# versions used in development 
torch==1.6.0  --find-links https://download.pytorch.org/whl/torch_stable.html
torchvision==0.7.0  --find-links https://download.pytorch.org/whl/torch_stable.html

Step 3: Clone the repository to your development machine.

$ git clone https://github.com/rucio/donkeybot.git
$ cd donkeybot

Step 4: For additional requirements run :

$ pip install -r requirements.txt

Step 5: Build and populate Donkeybot's data storage :

$ python scripts/build_donkeybot -t <GITHUB_API_TOKEN>

To generate a GitHub token visit Personal Access Tokens and follow Creating a Personal Access Token.

Contributing

For aspiring contributors make sure you've forked Donkeybot on your account.

Step 1: Fork the repository on Github.

Step 2: Clone the repository to your development machine and configure it :

$ git clone https://github.com/<YOUR_USER>/donkeybot/
$ cd donkeybot
$ git remote add upstream https://github.com/rucio/donkeybot.git

Developer mode

For development and testing purposes you need to have the bot installed as a package under a virtual environment (venv).

Step 1: Creating a virtual enviroment

# virt is the name of the virtual environment, you can change it.
$ python -m venv virt 

Step 2: Activate the enviroment

# on Linux/macOS
$ source virt/bin/activate
# on Windows
$ virt/Scripts/activate

Step 3: Run setuptools

# make sure setuptools exists inside this venv
$(virt) python -c 'import setuptools'
# create distribution package
$(virt) python setup.py sdist 
# developer mode
$(virt) python setup.py develop

Step 4 (Optional) : Check package contents

$(virt) tar --list -f .\dist\donkeybot-0.1.0.tar.gz

You're now able to develop and run donkeybot/scripts and donkeybot/tests correctly.

Testing

Make sure to run any tests before pushing your code. The testing module used is pytest.

Run tests :

# Recommended if pytest isn't installed 
$(virt) python setup.py test

or

# if not installed
$(virt) pip install pytest 
# then
$(virt) py.test tests

and see everything turn green 🟢!

Running the example notebooks

If you want to run the notebooks yourself you need to have a 'developer mode' installation of Donkeybot on your machine.

Inside a Jupyter notebook cell:
Step 1. Check the directory you are in with os.getcwd() .

Step 2. If you're inside \examples run os.chdir('..')
Which moves us back to the top level directory.

Step 3. Run pip install -e .
That will look for setup.py in the current directory and install Donkeybot in developer mode :)

See the official docs for more info on the the pip install -e option.

Move back to documentation homepage