Linux-rt-users archive mirror
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Chris White <chwhite@redhat.com>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: [PATCH] rt-tests: Add Dockerfile README
Date: Tue, 23 Jan 2024 15:37:17 -0500 (EST)	[thread overview]
Message-ID: <159e3b94-3917-2bf5-f8d8-b323b813abbc@redhat.com> (raw)
In-Reply-To: <20240123195336.167-1-chwhite@redhat.com>



On Tue, 23 Jan 2024, Chris White wrote:

> Add README detailing Docker setup for building and testing
> rt-tests in a containerized environment.
> 
> Signed-off-by: Chris White <chwhite@redhat.com>
> ---
>  README-Dockerfile | 49 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
>  create mode 100644 README-Dockerfile
> 
> diff --git a/README-Dockerfile b/README-Dockerfile
> new file mode 100644
> index 0000000..fc6ec85
> --- /dev/null
> +++ b/README-Dockerfile
> @@ -0,0 +1,49 @@
> +1
> +# README-Dockerfile-rt-tests
> +
> +## Introduction
> +This README provides detailed instructions for setting up an rt-tests container using Docker or Podman. This Dockerfile will pull a current copy of your code (plus all of your changes) and compile it into a container image for you to test with. This will give you an imbiguous way to test your changes, assuming you are running on a semi-modern host OS. The rt-tests container can be used to test any of the subpackages found under the rt-tests project, but is mainly intended for hwlatdetect and cyclictest.
> +
> +## Prerequisites
> +- Docker or Podman installed on your system.
> +
> +## Installation
> +### Prepare Your Environment
> +- For EPEL systems (Fedora, CentOS, RHEL):
> +  - Install Podman: `sudo dnf install podman -y`
> +- For Debian-based systems (Ubuntu):
> +  - Install Docker: `sudo apt-get update && sudo apt-get install docker.io -y`
> +  - Alternatively, install Podman: `sudo apt-get update && sudo apt-get install podman -y`
> +
> +### Build the Container
> +- Navigate to the root directory of the 'rteval'
> +- Build the container image named 'rteval-upstream':
> +  - For Podman: `sudo podman build -t rt-tests-upstream .`
> +  - For Docker: `sudo docker build -t rt-tests-upstream .`
> +
> +## Usage
> +### Run the Container
> +- Start the container in privileged mode:
> +  - For Podman: `sudo podman run -it --privileged rt-tests-upstream`
> +  - For Docker: `sudo docker run -it --privileged rt-tests-upstream`
> +- This will create a long lasting container. In order to use it again (say after a reboot), you need to start and exec into the container to get yourself back into the shell:
> +  - For Podman: 
> +    - `sudo podman start rt-tests-upstream`
> +    - `sudo podman exec -it rt-tests-upstream /bin/bash`
> +  - For Docker: 
> +    - `sudo docker start rt-tests-upstream`
> +    - `sudo docker exec -it rt-tests-upstream /bin/bash`
> +- And to clean up and remove your container so you can test a new one:
> +  - For Podman: `sudo podman rm -f rt-tests-upstream`
> +  - For Docker: `sudo docker rm -f rt-tests-upstream`
> +- Please note that the above command does not cleanup the container when you are done. It can be useful to run a single use container when trying to only test a quick change and remove the container afterwards. To run a a single use container that removes itself immediately after you exit the shell, run the following commands with the `--rm` option:
> +  - For Podman: `sudo podman run -it --rm --privileged rt-tests-upstream`
> +  - For Docker: `sudo docker run -it --rm --privileged rt-tests-upstream`  
> +
> +### Test rteval Build
> +- Inside the container, test one of the rt-tests packages you just built: 
> +  - Command: `cyclictest -D 1s`
> +  - Command: `hwlatdetect --duration 1`
> +
> +## Conclusion
> +Follow these detailed steps for a successful rt-tests container setup using Docker or Podman.
> -- 

Signed-off-by: John Kacur <jkacur@redhat.com>


      reply	other threads:[~2024-01-23 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 19:53 [PATCH] rt-tests: Add Dockerfile README Chris White
2024-01-23 20:37 ` John Kacur [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=159e3b94-3917-2bf5-f8d8-b323b813abbc@redhat.com \
    --to=jkacur@redhat.com \
    --cc=chwhite@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).