Skip to content

Commit

Permalink
Introduction to Gitpod (#49)
Browse files Browse the repository at this point in the history
* Add Gitpod qmd (#48)

* gitpod login instructions

* gitpod login

* remove names

* Update gitpod.qmd - Gitpod uses (#52)

* what is gitpod (#56)

* what is gitpod

* Update gitpod.qmd

Adding a sentence about the ".gitpod.yml" file

* Update section on configuration in gitpod.qmd (#60)

* edit_how_to_start_agitpod.qmd (#51)

* Update Schedule

* Update schedule

* Add Git cheetsheet (#43)

* Add quarto introduction lecture

* Add learner/review pairs

* Update Render vs Preview

* Update intro.qmd

* Add section on quarto computatations

* Apply code review fixes for Quarto syntax

* Add reference in figure example

* Update intro.qmd - The Quarto CLI

initial commit section: The Quarto CLI

* Add section on document formats

* Update quarto/intro.qmd

Co-authored-by: Mahesh Binzer-Panchal <[email protected]>

* Update quarto/intro.qmd

Co-authored-by: Mahesh Binzer-Panchal <[email protected]>

* apptainer.qmd rough lesson plan

* example.def

* Update apptainer.qmd

* add runscript to example .def file

* lesson notes

* Update apptainer.qmd

* add Mahesh notes

* Update Schedule (#65)

* Add chapter on pixi (#68)

* Add chapter on pixi

* incorporated the other changes suggested by mahesh-panchal

* Update Pixi lesson

* Move gitpod intro

* Organise chapters

* Update Gitpod Intro

* Remove extra space

---------

Co-authored-by: CormacKinsella <[email protected]>
Co-authored-by: Jason Hill <[email protected]>
Co-authored-by: Estelle PW <[email protected]>
Co-authored-by: Guilherme Borges Dias <[email protected]>
Co-authored-by: Miguel Ángel Redondo <[email protected]>
Co-authored-by: Per Unneberg <[email protected]>
Co-authored-by: Martin Pippel <[email protected]>
Co-authored-by: Amrei <[email protected]>
  • Loading branch information
9 people authored Feb 13, 2025
1 parent b8873b4 commit 61d32e7
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 33 deletions.
19 changes: 12 additions & 7 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,26 @@ book:
- schedule.qmd
- part: "Git"
chapters:
- git/git_intro.qmd
- git/git-intro.qmd
- part: "Github"
chapters:
- github/gh-collaboration.qmd
- part: "pixi"
- part: "Pixi"
chapters:
- pixi/pixi.qmd
- summary.qmd
- pixi/pixi-intro.qmd
- part: "Apptainer"
chapters:
- apptainer/apptainer-intro.qmd
- part: "Gitpod"
chapters:
- gitpod/gitpod-intro.qmd
- part: "Quarto"
chapters:
- quarto/quarto-intro.qmd
- references.qmd

bibliography: references.bib

format:
html:
theme: minty



33 changes: 10 additions & 23 deletions apptainer/apptainer.qmd → apptainer/apptainer-intro.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Lesson plan based around materials from [CodeRefinery](https://coderefinery.gith
## What are containers?

- Containers isolate software, dependencies, configurations, and system libraries from the host system
- The naming came from shipping containers (which are portable & standardized)
- The naming came from the idea of shipping containers (which are portable & standardized)
- Virtual machines are a similar concept, but these virtualise hardware, contain complete operating systems (including the kernel), and are managed by software known as a hypervisor
- Containers on the other hand share the host OS kernel, so they don't contain complete operating systems, just user space system libraries
- This makes them lightweight, portable, and fast to start up
Expand Down Expand Up @@ -56,18 +56,18 @@ Bootstrap: docker
From: debian:12.5-slim
%environment
export PATH=$PATH:/root/.pixi/bin
export PATH=$PATH:/root/.pixi/bin
%runscript
cat /etc/debian_version
cat /etc/debian_version
%post
export PATH=$PATH:/root/.pixi/bin
apt-get update && \
apt-get install -y curl && \
curl -fsSL https://pixi.sh/install.sh | bash && \
apt-get clean && \
pixi global install -c bioconda -c conda-forge minigraph
export PATH=$PATH:/root/.pixi/bin
apt-get update && \
apt-get install -y curl && \
curl -fsSL https://pixi.sh/install.sh | bash && \
apt-get clean && \
pixi global install -c bioconda -c conda-forge minigraph
```

Expand Down Expand Up @@ -113,18 +113,5 @@ It's advisable to use many small containers (minimal container for a single proc

## Seqera containers resource

- [Seqera containers resource](https://seqera.io/containers)
- Can build a container in seconds on the cloud and have it hosted by AWS
- Select `Singularity` or `Docker`, `linux-amd64` or `linux-arm64`
- Pick the packages you need in the container and click `Get Container`
- Doesn't support mac yet, though most python packages "should" work
- Once built, images are hosted by AWS and can be pulled by anyone (will last at least 5 years from creation)
- Seqera pays for the build compute, hosting of the containers is by Seqera on AWS and paid for by AWS donated credits
- To pull the built container:
`apptainer pull oras://community.wave.seqera.io/library/bwa_minigraph_pixi:c4c589e18eae6698`
## Converting from docker: if anyone uses Docker regularly - maybe they can take this one as an example?

```
bwa
apptainer shell bwa_minigraph_pixi_c4c589e18eae6698.sif
bwa
```
Binary file removed cover.png
Binary file not shown.
File renamed without changes.
119 changes: 119 additions & 0 deletions gitpod/gitpod-intro.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Gitpod

## What is Gitpod

[Gitpod](https://gitpod.io) is a developer environment that runs in your browser. In order to use it, you need a Git repository (either on GitHub, GitLab or Bitbucket). Gitpod opens up a container on your Git repository and clones the repository to the developer environment. This developer environment is initialized from the file `.gitpod.yml` present in the repository.

There are two offerings of Gitpod, Gitpod Flex, and Gitpod Enterprise. Gitpod Flex is designed to run a container on your laptop, cloud, or on-premises architecture. Gitpod Enterprise, which we discuss here, runs on a cloud environment hosted by Gitpod.

There are different pricing depending on your needs such as:

- Free plan (50 hours per month)
- Pay-as-you-go
- Company plan (custom)

Mahesh is on an open source plan (nammed NBIS). NBIS does not pay for a Gitpod plan or allow Gitpod to push directly to the NBISweden organization. Contributions to repositories on NBISweden must be made by Pull Request from your personal fork of a repository. Gitpod can then be run on your own forked repositories through your personal authentication.

## How to login to Gitpod

- Go to the [Gitpod site](https://gitpod.io).
- Select your Git hosting service (e.g., GitHub), and authenticate.
- If successful you should land on the workspaces page, with organisation settings at top left, and personal settings at top right.
- Now when you start a Gitpod environment you'll be connected to your version control system.

## How to start a Gitpod

To start a workspace, follow these steps:

- Navigate to your repository on GitHub, GitLab or Bitbucket.
- Add `gitpod.io/#` before the URL address of your repository. This will create a new URL address that directs you to the Gitpod workspace setup page. On that page, you can make the following choices:
1. The source repository for which the gitpod workspace will be created.
2. The code editor.
3. The computing resources required for the workspace.
- After making your choices, the code editor will open, allowing the user can start working on the files in the repository. The user's working directory is a cloned folder of the Github repository located on the Gitpod server, not locally on the computer.
- Any changes to the files within that folder can be pushed to the repository using Git commands.

**Note**: If you are editing a public Github public repository, Gitpod requires the "public_repo" permission to push changes. To do it, follow these steps:

1. Navigate to gitpod.io.
2. Click on your user icon
3. Click "user settings"
4. Navigate to "Git Providers"
5. Click the actions icon on the GitHub provider
6. Click "edit permissions"
7. Check "public_repo"
8. Click "Update permissions"
9. You will be redirected to Github for authentication.

After granting permissions, the user can push changes to the repository.

## How to configure Gitpod

- A gitpod workspace is configured mainly through the `.gitpod.yml` file at the root of your repository (e.g. github.com/user/repo/.gitpod.yml).

- This file is read by Gitpod when the workspace is started, and can be used to specify the base workspace image, and a list of tasks that will be run when the workspace is started.

- Below is the yml file we use in the Training-tech-shorts repo.

```yml
image: nfcore/gitpod:latest

tasks:
- name: Update Nextflow
command: nextflow self-update
- name: Install Pixi
command: |
sudo chown gitpod -R /home/gitpod/
curl -fsSL https://pixi.sh/install.sh | bash
. /home/gitpod/.bash_profile
- name: Install Quarto
command: |
wget https://quarto.org/download/latest/quarto-linux-amd64.deb
sudo dpkg -i quarto-linux-amd64.deb
rm quarto-linux-amd64.deb
quarto check all
```
- The `image:` section of the `.gitpod.yml` is used to specify the base workspace image, this can be a public or private docker image, or a Dockerfile (in this case the base image must be public).

```yml
# public image
image: nfcore/gitpod:latest
# local Dockerfile
image:
file: .gitpod.Dockerfile
```

- The `tasks:` section of the `.gitpod.yml` is used to specify a list of tasks that will be run when the workspace is started. Each task should have a `name:` and a `command:` section. The `command:` section specifies one or more shell commands that will be run in the workspace.

```yml
tasks:
- name: Update Nextflow
command: nextflow self-update
```

- In order to execute multiple commands in a single task, you can use the `|` syntax to specify a block of shell commands, each in one line.

```yml
tasks:
- name: Install Pixi
command: |
sudo chown gitpod -R /home/gitpod/
curl -fsSL https://pixi.sh/install.sh | bash
. /home/gitpod/.bash_profile
```

- Optionally, you can also add a `ports:` section to the `.gitpod.yml` file to specify a list of ports that should be opened by the workspace. This can be useful when hosting a web server or anything that needs to be accessed from outside the workspace.

```yml
ports:
- port: 8080
onOpen: open-preview
```

## Uses for Gitpod

- Demonstration: The containerized nature of gitpod makes it useful for serving instances of a program in a standardized environment for demonstration.
- Development: There are many software development tools available in the standard docker container. Pull requests can be managed from within gitpod and explored safely within a container.
- Experimentation: The ephemeral nature of the environment, and its standardized tools make Gitpod excellent for testing code and sandbox experimentation.
- Training: A pre-built environment can be provided to learners and supplies a consistent environment to work in with the necessary lesson requirements.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions summary.qmd

This file was deleted.

0 comments on commit 61d32e7

Please sign in to comment.