 My name is Asinta. I'm a developer for Galaxy out of the Penn State University. And I'm Sergey and I'm a developer out of Johns Hopkins University. Today we're going to be walking you through the developer tutorial called Debugging Galaxy. You're going to want to have that open because there are some commands that you're going to want to simply copy and paste. In this tutorial we're going to demonstrate how to find and fix common issues that you might encounter as a contributor to Galaxy. We're going to step you through the process from finding them to locating where the issue is, developing a solution and then of course committing your fix. With the skills from this tutorial it's our hope that you're going to feel more paired to develop solutions for Galaxy and more confident to navigate any obstacles that may stand in your way. So we are going to start with local development environment setup. Many of you already know how to do it but nevertheless we'll walk through the just in case to introduce it to people who are doing it for the first time. So for almost every type of area you encounter there will be a relatively similar process. One, you locate the failing test or error on GitHub actions. You run the failing test locally. You identify the issue causing the failure. You develop a solution. You ensure the test passes locally and finally you commit and push the fixed branch to your local fork. Now the process for dealing with runtime errors will be somewhat different since there will be no failed tests to review initially. However in either case the first step is to set up your local development environment. In order to contribute to Galaxy you're going to need to do a couple of things. The first thing is you need a GitHub account. So if you don't have one go create one now. Changes are proposed via a pull request. This allows our project maintainers to review these changes and suggest solutions that can improve it. The general steps are to fork the Galaxy repository, clone your fork, make your changes in a new branch that you've named, commit your changes, push the branch to your fork and then open a pull request for that branch in the Galaxy repo. In this tutorial however we're not going to be using the main Galaxy repo. We're going to be using a branch that has been created just for this tutorial. It contains several bugs that you're going to need to identify and fix and you also won't be creating a pull request in the upstream Galaxy repository. That is for when you contribute later after you've successfully completed this tutorial. And now we are heading into the pulling the buggy branch section. So first of all as you may see from the tutorial, good news. All of the failing tests are in the same Galaxy branch and that means that you only need to download one branch. The downside is that the buggy branch will have issues all over the place. Tests are not mutually independent. So multiple tests, multiple bugs will be causing different test failures but we will help you along the way. So don't you worry. So heading into the hands-on section, setting up your local Galaxy instance. So point one, use github UI to fork Galaxy's repository at Galaxy project slash Galaxy. Once you've done, you are going to clone your fork repository to a local path, further referenced as Galaxy root. And with this, I'm going to share my screen and I will walk you through most of these items. So heading into the terminal. So we're going to start with cloning your repository. So we're going to do git clone, specifying the branch we need. We need the training branch, not the default dev branch, then HTTPS colon slash slash github.com slash your username. My username is ic4f and next Galaxy. And then we specify a directory name. I'm going to say Galaxy five because this is not the only Galaxy I have in that directory. And enter. This should take just a minute, maybe a little bit more depending on the speed of your connection. If you are on dial up, this might take an hour, but most likely you are not. Resolving deltas. Or at least hopefully they're not. Hopefully you're not. If you are, well, you will get there eventually. And here we are. So now we are going to change into your Galaxy root. In my case, it's Galaxy five. And this is the contents of the root director, which is exactly what it's supposed to be. So again, in the future, when you contribute to Galaxy, you'll need to clone the dev branch, which is short for development. And this is the default Galaxy branch. So you won't need to specify the dash B option in your git clone command. On to step three, before we can use Galaxy, we need to create a virtual environment and install the required dependencies. So first we create a virtual environment. And the command for that would be virtual and and we provide the name of the virtual environment. However, I'm going to stop right here because the requirement for Python is at least Python 3.6. And I know that my version of system Python is Python two. And I can check that by doing Python dash V capital V. And indeed, I have Python 2.7 point 16. So if I create the virtual environment using my default Python, which is my system Python, this is not going to work. Instead, I need to create a virtual environment specifying a path to an alternative Python interpreter, where that Python interpreter is on your environment. Well, it depends on your setup. I use a pi nth. So in my case, I would do virtual and and I'm going to pass the dash P or minus P option. And I will specify the path to my to my Python interpreter. And here I have Python 3.8.1 bin Python. So this is the path to the Python interpreter. And then I give the name of the virtual environment directory. And it's done. So the directory doesn't show up because it starts with a period. But if I show hidden files, you will see that's right there dot nth. So now I need to activate it. To do that, I do source or dot space dot then bin activate. And I know that my virtual environment has been activated because the name of the virtual environment is prepended to my command prompt in parentheses dot then on the left. In fact, if you are not sure, you can always check. So let's deactivate it for now. And let's check what Python I'm using, which Python. And I see that it's slash user slash bin slash Python. This is the system Python. This is the Python version 2.7.16. When I activate my virtual environment, it will be a different Python. It will be a Python, the Python, which lives in my dot then directory. So this is the virtual environment Python. And indeed, if I check its version, it's going to be 3.8.1. So we're safe now. On to the next step. So step four, activate your virtual environment. I've already done that once activated. Yes. So step five, now you are ready to install the dependencies. Since you will be doing development, you need to install the dependencies listed in lib slash galaxy slash dependencies slash dev requirements dot txt. So that file, it's just a file. It's a requirements file. And I need to install all the dependencies from that file. So what I'm going to do is I'll say pip install r and then I will and again, I am in Galaxy root. So lib is available. So I'm going to install lib slash galaxy slash dependencies slash dev requirements. And this will start a long process which is going to take several minutes. So I'm going to cancel it, cancel out of it. But this is going to install all the dependencies listed in that file into your virtual environment. So when you activate your virtual environment and work out of this virtual environment, all those dependencies will be available to your Python. So moving on to step five, finally, let's are running Galaxy for the first time. They'll write they should pause here maybe and let all those dependencies get installed. So if you are doing this for the first time, pause, let them install and then feel free to start us up again. Absolutely right. So now that hypothetically you've installed all of these dependencies, you check out a new branch. So right now, if you look at the available branches, let's see it branch, you have only the training branch. Now what you need to do is you need to create your own branch based on this branch. So we will do get check out minus B, and we'll call the branch my training or whatever you want to call it. And now when you say give branch, it will show you two branches and my training is going to be marked with an asterisk. And that means that it is currently the active branch. And with this, I believe your local environment is all set up. You're good to go and you can go ahead and fix those six extremely complicated bugs. Good luck. Good luck.