Running the GTN website locally
OverviewQuestions:Objectives:
How to setup the infrastructure to build training webpages?
Installing packages needed for rendering the webpage
Running the GTN material website locally
Tracking changes to the content live in the webbrowser
Time estimation: 15 minutesSupporting Materials:Last modification: Oct 18, 2022
Introduction
If you want to run the entire GTN material website locally or test your new training material you can do this!
Currently, the website is generated from the metadata and the tutorials using Jekyll, a simple static site builder. We can use Jekyll to run a server to check if the tutorial is correctly added and rendered.
AgendaIn this tutorial, you will learn how to run a local instance of the GTN website:
Installation of the requirements
The first step is to install the needed tools inside a conda environment. A conda environment is a directory that contains a specific collection of packages. For example here to run the website, we need ruby, pandas, requests, etc. By creating a conda environment and installing the needed tools there, we do not affect your main installation.
This step has to be done once.
We also need to make sure that a couple of other utilities and build requirements are present: git, curl & make. The easiest way to install these is with your package manager of choice - i.e. yum, apt, brew etc.
Hands-on: Install the requirements
- Open a Terminal
Use your package manager to install
git
,curl
andmake
- For Debian/Ubuntu:
sudo apt update && sudo apt install git curl make
- For Fedora/CentOs/RedHat:
sudo yum install git curl make
- (If not done yet) Clone the training material GitHub repository:
git clone https://github.com/galaxyproject/training-material.git
- Navigate to the
training-material/
folder withcd
Set up the conda environment
It will install some needed tools (ruby, nodejs, etc) in a protected environment, without interfering with the existing tools or versions.
- Install conda (if not already installed):
make install-conda
- (You may need to exit the terminal and re-open for conda to be recognised. Navigate back to the same place.)
- Create the
galaxy_training_material
conda environment:make create-env
- Install Jekyll and related modules into the conda environment:
make install
If you encounter an error about libxml2 on Linux, please try to install
libxml2-dev
(executingsudo apt install libxml2-dev
) if on Debian/Ubuntu orlibxml2-devel
(executingsudo yum install libxml2-devel
) if on Fedora/RedHat/CentOS, and re-runmake install
.
Checking the website generation
Once Jekyll and its modules are installed in our conda environment, we can check the generation of the website locally:
Hands-on: Checking the website generation locally
- Run a local Jekyll server with
make serve-quick
- Visualize at http://localhost:4000/training-material/
- Edit one of the tutorials:
- For example, open
topics/introduction/tutorials/galaxy-intro-peaks2genes/tutorial.md
in a text editor of your choice.- Make some changes to the Introduction paragraph, and save the file.
- Refresh the tutorial page in your browser until you can see the changes you made.
- this may take a little bit of time; in the terminal you can monitor when the regeneration is complete
With make serve-quick
, a local Jekyll server will run in background. It will check the changes and regenerate the website accordingly. You may need to reload the page to see the changes (and sometimes to wait 1-2 minutes).
Use
make serve
instead ofmake serve-quick
to get all plugins, but also configure the post, host and pass additional flags. This however can be quite slow.Need to speed up the cloning step? You coud fetch only the latest commit of the main branch:
$ git clone https://github.com/galaxyproject/training-material.git --depth 1 --branch main
Running on a VM or remote machine?
If you are not running this on your local machine, but e.g. on a VM, you may need to configure a webserver to serve the website.
Below is an example NGINX configuration (e.g. in
/etc/nginx/sites-enabled/default
)location /training-material/ { root /home/ubuntu/training-material/_site/; }
Change the
root
path above to wherever you cloned the training material folder
Stopping the server
Once you are done, you can stop the server and clean your repository.
Hands-on: Stopping the server
- Stop the server with CTRL-C
- Clean the repository:
make clean
Conclusion
Key points
Checking the generated website can be done locally
Frequently Asked Questions
Have questions about this tutorial? Check out the tutorial FAQ page or the FAQ page for the Contributing to the Galaxy Training Material topic to see if your question is listed there. If not, please ask your question on the GTN Gitter Channel or the Galaxy Help ForumFeedback
Did you use this material as an instructor? Feel free to give us feedback on how it went.
Did you use this material as a learner or student? Click the form below to leave feedback.
Citing this Tutorial
- Bérénice Batut, Björn Grüning, Saskia Hiltemann, 2022 Running the GTN website locally (Galaxy Training Materials). https://training.galaxyproject.org/training-material/topics/contributing/tutorials/running-jekyll/tutorial.html Online; accessed TODAY
- Batut et al., 2018 Community-Driven Data Analysis Training for Biology Cell Systems 10.1016/j.cels.2018.05.012
Congratulations on successfully completing this tutorial!@misc{contributing-running-jekyll, author = "Bérénice Batut and Björn Grüning and Saskia Hiltemann", title = "Running the GTN website locally (Galaxy Training Materials)", year = "2022", month = "10", day = "18" url = "\url{https://training.galaxyproject.org/training-material/topics/contributing/tutorials/running-jekyll/tutorial.html}", note = "[Online; accessed TODAY]" } @article{Batut_2018, doi = {10.1016/j.cels.2018.05.012}, url = {https://doi.org/10.1016%2Fj.cels.2018.05.012}, year = 2018, month = {jun}, publisher = {Elsevier {BV}}, volume = {6}, number = {6}, pages = {752--758.e1}, author = {B{\'{e}}r{\'{e}}nice Batut and Saskia Hiltemann and Andrea Bagnacani and Dannon Baker and Vivek Bhardwaj and Clemens Blank and Anthony Bretaudeau and Loraine Brillet-Gu{\'{e}}guen and Martin {\v{C}}ech and John Chilton and Dave Clements and Olivia Doppelt-Azeroual and Anika Erxleben and Mallory Ann Freeberg and Simon Gladman and Youri Hoogstrate and Hans-Rudolf Hotz and Torsten Houwaart and Pratik Jagtap and Delphine Larivi{\`{e}}re and Gildas Le Corguill{\'{e}} and Thomas Manke and Fabien Mareuil and Fidel Ram{\'{\i}}rez and Devon Ryan and Florian Christoph Sigloch and Nicola Soranzo and Joachim Wolff and Pavankumar Videm and Markus Wolfien and Aisanjiang Wubuli and Dilmurat Yusuf and James Taylor and Rolf Backofen and Anton Nekrutenko and Björn Grüning}, title = {Community-Driven Data Analysis Training for Biology}, journal = {Cell Systems} }
Developing GTN training materialThis tutorial is part of a series to develop GTN training material, feel free to also look at:
- Overview of the Galaxy Training Material
- Adding auto-generated video to your slides
- Adding Quizzes to your Tutorial
- Contributing with GitHub via command-line
- Contributing with GitHub via its interface
- Creating a new tutorial
- Creating content in Markdown
- Creating Interactive Galaxy Tours
- Creating Slides
- Design and plan session, course, materials
- Generating PDF artefacts of the website
- GTN Metadata
- Including a new topic
- Principles of learning and how they apply to training and teaching
- Running the GTN website locally
- Running the GTN website online using GitPod
- Teaching Python
- Tools, Data, and Workflows for tutorials
- Updating diffs in admin training