Skip to content

Commit 72706cd

Browse files
author
Inkedstinct
committed
Merge branch '7_doc/nld_proofread' of github.com:Inkedstinct/powerapi-ng.github.io into 7_doc/nld_proofread
2 parents 671beb4 + ebae5b0 commit 72706cd

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

docs/getting_started.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,10 @@ quick glimpse
7676

7777
## Preparation
7878

79-
You can download the archive using :
80-
79+
Clone the repository and get ready:
8180
```sh
82-
wget "https://github.com/powerapi-ng/powerapi-ng.github.io/tree/master/examples/powerapi-stack.zip"
83-
unzip powerapi-stack.zip && cd powerapi-stack
81+
git clone https://github.com/powerapi-ng/powerapi-ng.github.io.git
82+
cd powerapi-ng.github.io/docs/script/getting-started
8483
```
8584

8685
From this archive, you will have all the necessary files to get started, let us break down each element.
@@ -96,6 +95,7 @@ From this archive, you will have all the necessary files to get started, let us
9695
|----hwpc-mongodb.json
9796
|--start.sh
9897
|--start.py
98+
|--stop.sh
9999
|--pretty_print.py
100100
|--docker-compose.yaml
101101
|--.env

docs/script/getting_started/start.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
import os
3030
import sys
31+
import signal
3132
from subprocess import call
3233
import subprocess
3334
import json
@@ -41,6 +42,10 @@
4142
"2 - AMD Zen 2",
4243
"3 - AMD Zen 3"]
4344

45+
def signal_handler(sig, frame):
46+
print('You sent SIGINT signal, stoping docker compose stack')
47+
call("./stop.sh")
48+
4449

4550
def start_demo():
4651
"""
@@ -54,7 +59,8 @@ def start_demo():
5459
"\n" + list_arch[2] +
5560
"\n" + list_arch[3] +
5661
"\n")
57-
62+
63+
signal.signal(signal.SIGINT, signal_handler)
5864
val = ""
5965
choice = True
6066
while choice:

docs/script/getting_started/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ docker compose logs formula -f &
88

99
sleep 120
1010

11-
docker compose down
11+
./stop.sh
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -ueo pipefail
3+
set +x
4+
5+
docker compose down

0 commit comments

Comments
 (0)