From dd1bb0004578820eac938b948495d1c57ea0d87b Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Tue, 9 Feb 2021 10:07:39 -0800 Subject: [PATCH 1/3] Adding doc to setup the agen on linux --- docs/README.md | 1 + docs/setup_linux.md | 74 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 docs/setup_linux.md diff --git a/docs/README.md b/docs/README.md index ffae971a2..396ddc28e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,6 +8,7 @@ |**[Benchmarking local applications](local_application.md)** | Send local application source to the agent. |**[Benchmarking Docker containers](benchmarking_docker.md)** | Run Docker containers. |**[Running micro-benchmarks](microbenchmarks.md)** | Run BenchmarkDotNet benchmarks. +|**[Setting up an agent on Linux](setup_linux.md)** | How to install and update the agent on a Linux machines. ## Guides diff --git a/docs/setup_linux.md b/docs/setup_linux.md new file mode 100644 index 000000000..ff477092b --- /dev/null +++ b/docs/setup_linux.md @@ -0,0 +1,74 @@ +## Setting up an agent on Linux + +On Linux, it is recommended to setup the Agent using the Docker file provided in this repository. +There instructions are valid for x86 and arm. + +### Installing Docker + +- Install docker from the automated script + +``` +curl -sSL https://get.docker.com | sh +``` + +- Add the local account to the docker user group so that you can execute docker commands without sudo + +``` +sudo groupadd docker +sudo usermod -aG docker $USER +newgrp docker +``` + +- Reopen the session with the account +- Check Docker is running + +``` +docker run hello-world +``` + +### Starting the Agent + +- Clone the `crank` repository + +``` +mkdir ~/src +cd ~/src +git clone https://github.com/dotnet/crank +``` + +- Build and run the Agent docker image + +``` +cd ~/src/crank/docker/agent +./build.sh +./run.sh +``` + +This will build the image with all the dependencies (perfcollect, ...) and start a container named `crank-agent`. +To stop the container, run `./stop.sh` + +### Displaying the agent log + +To display the live log, run the following command: + +``` +docker logs -f --tail 100 crank-agent +``` + +### Continuous integration + +In order to restart and update the agent regularly, the follow cron job can be used. + +- Edit the crontab file: + +``` +crontab -e +``` + +- Add this entry: + +``` +0 0 * * * cd [PATH_TO_CRANK]/src/crank/docker/agent; ./stop.sh; docker rm -f $(docker ps -a -q --filter "label=benchmarks"); docker system prune --all --force --volumes; git checkout -f master; git pull; ./build.sh; ./run.sh +``` + +This will stop any running agent, clean all docker images used to run benchmarks, update the GitHub repositor, build and restart the agent image. \ No newline at end of file From 2714ba56e3f45ba4a9afdddf8e38fccac58565d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Tue, 9 Feb 2021 10:22:05 -0800 Subject: [PATCH 2/3] Update setup_linux.md --- docs/setup_linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/setup_linux.md b/docs/setup_linux.md index ff477092b..fe5aa3be8 100644 --- a/docs/setup_linux.md +++ b/docs/setup_linux.md @@ -1,7 +1,7 @@ ## Setting up an agent on Linux On Linux, it is recommended to setup the Agent using the Docker file provided in this repository. -There instructions are valid for x86 and arm. +There instructions are valid for x86_64 and ARM64 (aka ARMv8 or AARCH64). ### Installing Docker @@ -57,7 +57,7 @@ docker logs -f --tail 100 crank-agent ### Continuous integration -In order to restart and update the agent regularly, the follow cron job can be used. +In order to restart and update the agent regularly, the following cron job can be used. - Edit the crontab file: @@ -71,4 +71,4 @@ crontab -e 0 0 * * * cd [PATH_TO_CRANK]/src/crank/docker/agent; ./stop.sh; docker rm -f $(docker ps -a -q --filter "label=benchmarks"); docker system prune --all --force --volumes; git checkout -f master; git pull; ./build.sh; ./run.sh ``` -This will stop any running agent, clean all docker images used to run benchmarks, update the GitHub repositor, build and restart the agent image. \ No newline at end of file +This will stop any running agent, clean all docker images used to run benchmarks, update the GitHub repositor, build and restart the agent image. From 3623ce1b69d3e79b27676e0b60e69250705561fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Tue, 9 Feb 2021 10:24:27 -0800 Subject: [PATCH 3/3] Update README.md --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 396ddc28e..670ddff74 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,7 +8,7 @@ |**[Benchmarking local applications](local_application.md)** | Send local application source to the agent. |**[Benchmarking Docker containers](benchmarking_docker.md)** | Run Docker containers. |**[Running micro-benchmarks](microbenchmarks.md)** | Run BenchmarkDotNet benchmarks. -|**[Setting up an agent on Linux](setup_linux.md)** | How to install and update the agent on a Linux machines. +|**[Setting up an agent on Linux](setup_linux.md)** | How to install and update the agent on a Linux machine. ## Guides