Skip to content

Commit

Permalink
Streamline and add links
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPetrov committed Feb 2, 2025
1 parent ebf90da commit f7fdab9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions docs/docker.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Base and R2DT Docker Images
# Docker images

## Overview

This project uses a combination of two Docker images: `base_image` and the R2DT image. The `base_image` contains all non-Python dependencies of R2DT, while the R2DT image includes the necessary Python packages.
This project uses a combination of two Docker images: `base_image` and the R2DT image. The `base_image` contains all non-Python dependencies of R2DT, while the R2DT image includes the necessary Python packages. The images are built and pushed to Docker Hub using [GitHub Actions](./github-actions.md).

## Base Image
## Base image

The build process for the base image is detailed in [base_image/Dockerfile](https://github.com/r2dt-bio/R2DT/blob/main/base_image/Dockerfile). It uses GCC to compile C/C++ code and installs additional dependencies, such as Perl-related tools.

Expand All @@ -14,15 +14,15 @@ Rebuilding the base image is rare and is necessary only when an R2DT dependency

View [rnacentral/r2dt-base](https://hub.docker.com/r/rnacentral/r2dt-base) on Docker Hub →

## R2DT Image
## Main image

The R2DT image is constructed using the [Dockerfile](https://github.com/r2dt-bio/R2DT/blob/main/Dockerfile) located in the repository's root folder. It inherits from `r2dt-base`.
The main R2DT image is constructed using the [Dockerfile](https://github.com/r2dt-bio/R2DT/blob/main/Dockerfile) located in the repository's root folder. It inherits from `r2dt-base`.

This approach ensures that the R2DT image remains compact, containing only the Python and R2DT dependencies, excluding the extensive build tools used in the base image. Most changes in the Python code can be made using the prebuilt dependencies and do not require recompilation of C/C++ code.

View [rnacentral/r2dt](https://hub.docker.com/r/rnacentral/r2dt) on Docker Hub →

## Upgrade Process
## Upgrade process

When updating the base image, follow these steps:

Expand Down
35 changes: 17 additions & 18 deletions docs/github-actions.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
# GitHub Actions for Docker Image Builds
# GitHub Actions

R2DT automates the building and deployment of Docker images using **GitHub Actions**. The project employs two primary workflows:
1. Base Image Workflow – Creates a foundational Docker image.
2. Main Workflow – Builds the final image using the base image.
R2DT automates the building and deployment of [Docker images](./docker.md) using **GitHub Actions**. The project employs two primary workflows:

This automation streamlines development, ensuring consistency, reducing build times, and minimising manual intervention.

## Building the Base Image
1. Base Image Workflow – Creates a foundational Docker image.
2. Main Workflow – Builds the final image using the base image.

The base image is created via the workflow defined in [parallel-base-image.yml](https://github.com/r2dt-bio/R2DT/blob/main/.github/workflows/parallel-base-image.yml). This workflow provides a standardised environment for subsequent images. The image layers are built in parallel using [BuildJet](https://buildjet.com) and pushed to Docker Hub for caching.
This automation streamlines development, ensuring consistency, reducing build times, and minimising manual intervention.

### Usage of Base Image
## Base image

The base image serves as a starting point for the main Docker image. It includes essential dependencies and configurations that are common across different builds, ensuring consistency and reducing build times for the resulting images.

## Building the Resulting Image
The base image is created via the workflow defined in [parallel-base-image.yml](https://github.com/r2dt-bio/R2DT/blob/main/.github/workflows/parallel-base-image.yml). This workflow provides a standardised environment for subsequent images. The image layers are built in parallel using [BuildJet](https://buildjet.com) and pushed to Docker Hub for caching.

## Main image

The main workflow for building the resulting Docker image is defined in [main.yml](https://github.com/r2dt-bio/R2DT/blob/main/.github/workflows/main.yml). This workflow is triggered on pushes and pull requests to the `main` and `develop` branches.

### Key Steps in Main Workflow
### Key steps

1. **Initial Notification**: Sends a Slack notification indicating the start of the Docker image creation process.
2. **Create Docker Tag**: Uses the Docker metadata action to generate tags for the Docker image based on the branch or tag being built.
3. **Build and Push**: Builds the Docker image using `Dockerfile` and pushes it to the Docker registry. This step supports parallel builds for different platforms (e.g., `linux/amd64`, `linux/arm64`).
4. **Comment on Pull Request**: If the workflow is triggered by a pull request, it comments on the PR with the Docker image tags and labels.
5. **Final Notification**: Sends a Slack notification indicating the completion of the Docker image creation process.
1. **Initial notification**: Sends a Slack notification indicating the start of the Docker image creation process.
2. **Create Docker tag**: Uses the Docker metadata action to generate tags for the Docker image based on the branch or tag being built.
3. **Build and push**: Builds the Docker image using `Dockerfile` and pushes it to the Docker registry. This step supports parallel builds for different platforms (e.g., `linux/amd64`, `linux/arm64`).
4. **Comment on pull request**: If the workflow is triggered by a pull request, it comments on the PR with the Docker image tags and labels.
5. **Final notification**: Sends a Slack notification indicating the completion of the Docker image creation process.

### Parallel Builds in Dockerfile
### Parallel builds in Dockerfile

The `Dockerfile` supports parallel builds by specifying multiple stages for different components. Each stage is responsible for building a specific part of the application, for example:

Expand All @@ -36,7 +35,7 @@ The `Dockerfile` supports parallel builds by specifying multiple stages for diff

These stages are combined in the final build stage to create a comprehensive Docker image that includes all the necessary tools and dependencies.

### Parallel Builds in Main Workflow
### Parallel builds in main workflow

The main workflow supports parallel builds for multiple platforms using Docker Buildx. This allows the resulting Docker image to be compatible with different architectures, enhancing its usability across various environments.

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ If you have any questions or feedback, feel free to [submit a GitHub issue](http
docs
testing
docker
github-actions
releases
```

Expand Down

0 comments on commit f7fdab9

Please sign in to comment.