Skip to content

Setting up

Setting up Pods

Pods is our teaching platform for hands-on programming. It standardises the training workshop by giving everyone an identical Docker container and operating system, so we avoid the classic “this doesn’t work on my machine” problem. That said, if you run into any issues, please feel free to raise your hand. The steps for setup will be outlined in the early stages of the workshop, but they are included below too:

  1. Head to pods.acceleratescience.co.uk
  2. Username = [CRSid], password will be provided in the workshop

  1. You should see a screen like above. Click VSCode/JupyterLab to open the IDE in your browser!

Create a new branch

We are going to start by initialising a git repository in our directory

git init
We also need to create and set an origin for our git repository, that is a repository hosted on GitHub that we can push our changes to. The first step is to head to GitHub and create a new repository with the name:
cancer-prediction-<your-CRSId>
If we now return to our IDE and ask for the remote repository
git remote -v
nothing is returned. To set this to our newly created GitHub repository, simply run:
git remote add origin https://github.com/username/repository-name
Now, git remote -v should return:
origin  https://github.com/username/cancer-prediction-CRSId (fetch)
origin  https://github.com/username/cancer-prediction-CRSId (push)
It is good practice to do development work on a new branch, but first we should set up a virtual environment and install any dependencies.

Set up the new virtual environment with,

python3.11 -m venv venv
. venv/bin/activate

Note

If you are running this locally, you may not have python3.11. Just use whatever you have.

You can verify the path of the python version you are using by running

which python
and this should return something like:\ /workspaces/cancer-prediction/venv/bin/python

We install the dependencies using

python -m pip install -r requirements.txt

Notice that in the version control tab, we have over 1,000 unstaged changes!! If we have a look at these, they are mostly files from the virtual environment. We do NOT want to push these to our repo. So we create the three core files we need: a .gitignore, a LICENSE, and a README.md, either using the UI or by typing in the terminal:

touch .gitignore LICENSE README.md

and populate it with boiler plate text. If you have Copilot, it will do it for you, or you can copy the one here.

Once you update, all the additional files should vanish from the staging area. Once this is done, commit the changes, and sync the remote version with the local version.

When you see this symbol:


Dark Souls Bonfire

it means that you should commit and push your changes to the repository. They indicate key checkpoints in the workshop.

In the source control tab, hit "Publish Branch".

Now create a new branch using the UI or using the git CLI.

git checkout -b dev

This will automatically create and move over to a new branch called dev. The environment and all the packages we installed should also be moved along with it. We will use this for developing new features in the codebase. Publish this branch using the same method as before.

Further reading

Setting up Codespaces (Legacy)

Warning

We no longer use CodeSpaces in our workshops, and instead make use of our shiny new platform Pods. This is included here purely as a fallback option.

The first step is to fork this repository to your own GitHub account. This will allow you to make changes to the code without affecting the original repository.

Now head back over to your newly created repo. Everything in the main repo is not needed, so we do a few things:

Change the default branch

  • Head to the Repo Settings
  • There is a heading called "Default Branch"
  • Click on the two arrow icon and change the default branch to basic

Delete the main branch

  • Head back to the Code tab
  • Locate the branch dropdown and click on the thing to the right of it (it should say 4 branches)
  • Find the main branch and delete it

Rename the basic branch to main

  • In the same page for the basic branch, next to the trash can, click on the three dots
  • Click on "Rename branch"
  • Change the name to main

Rename the repo

  • Head back over to the Settings tab
  • At the top, you can change the name of the repo to whatever you want
  • Rename it to cancer-prediction-<your-crsid>

Now open Codespaces on main:

You should now be in the browser version of VSCode.

This is the absolute most basic version of code being submitted to GitHub. But we can do better...

Note

Even though we are using Codespaces, the general packaging process will still work with regular VSCode on your desktop.