Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve README for master/slave setup with hostname explanation #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zongsforce
Copy link

@zongsforce zongsforce commented Dec 27, 2024

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

This pull request addresses the lack of clarity surrounding the hostname parameter in the README.md file, specifically regarding its role in configuring master/slave setups for SmokePing.

Changes:

  • Added the hostname parameter to the configuration examples in README.md.
  • Provided a detailed explanation of the hostname parameter's purpose and usage, especially in the context of master/slave deployments.

Benefits of this PR and context:

The existing documentation did not adequately explain the hostname parameter, which can be crucial when setting up SmokePing in a distributed, master/slave configuration. This omission could lead to confusion and configuration issues for users attempting to implement such setups.

This enhancement aims to improve the documentation by:

  • Explicitly including the hostname parameter in the provided examples.
  • Clearly outlining how to configure the hostname for both master and slave instances, ensuring proper communication and data aggregation.

By adding this information, users will have a better understanding of how to properly configure SmokePing in master/slave mode, leading to a more robust and reliable monitoring setup.

How Has This Been Tested?

This change is a documentation update to README.md. It does not modify any code logic and therefore does not require specific testing. The accuracy of the added information regarding the hostname parameter and its use in master/slave configurations has been manually verified against the SmokePing documentation and common deployment practices.

Source / References:

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@zongsforce zongsforce changed the title add instructions for configuring the master-slave setup Improve README for master/slave setup with hostname explanation Dec 27, 2024
@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-fe96d8a5b6b0680c8873990168a6ed9f236035e0-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-fe96d8a5b6b0680c8873990168a6ed9f236035e0-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-fe96d8a5b6b0680c8873990168a6ed9f236035e0-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-fe96d8a5b6b0680c8873990168a6ed9f236035e0-pr-186

@Roxedus
Copy link
Member

Roxedus commented Dec 27, 2024

Please note this part of the contribution document https://github.com/linuxserver/docker-smokeping/blob/master/.github/CONTRIBUTING.md#readme

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-6fff1566ae7757198f7369b17abd5d09c144c518-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-6fff1566ae7757198f7369b17abd5d09c144c518-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-6fff1566ae7757198f7369b17abd5d09c144c518-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-6fff1566ae7757198f7369b17abd5d09c144c518-pr-186

@zongsforce
Copy link
Author

Please note this part of the contribution document https://github.com/linuxserver/docker-smokeping/blob/master/.github/CONTRIBUTING.md#readme

The content I want to add is not compatible with the current YAML structure. Do I need to modify the code that generates the README? Could you please provide some suggestions?

Reasons for the conflict:

  • hostname is an optional field, but it's not a variable under environment. At the same time, the meaning of the hostname parameter needs to be explained.
  • The syntax generation for docker compose and docker run needs to be handled differently.

@Roxedus
Copy link
Member

Roxedus commented Dec 27, 2024

These are the relevant variables for readme-vars https://github.com/linuxserver/docker-jenkins-builder/blob/b4796d74eef8d234fa6577696c2dd85720f895a5/vars/_container-vars-blank#L41-L43

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-9f5b27aad91b7b594a77698881bacbc170fabaa4-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-9f5b27aad91b7b594a77698881bacbc170fabaa4-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-9f5b27aad91b7b594a77698881bacbc170fabaa4-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-9f5b27aad91b7b594a77698881bacbc170fabaa4-pr-186

@zongsforce
Copy link
Author

zongsforce commented Dec 30, 2024

These are the relevant variables for readme-vars https://github.com/linuxserver/docker-jenkins-builder/blob/b4796d74eef8d234fa6577696c2dd85720f895a5/vars/_container-vars-blank#L41-L43

I tried modifying the param_usage_include_hostname variable in the _container-vars-blank file of the docker-jenkins-builder project to true or 'optional'. Then, I built the Docker image locally. After that, I switched to the docker-smokeping project and used docker run to regenerate README.md. However, I found that the README.md still did not include the hostname variable, even though I had added the param_hostname variable in the readme-vars.yml file.

Is this modification/validation process working as expected?

Additional Testing

To further test, I also modified the variables param_usage_include_vols and param_usage_include_ports to false. However, this change also did not affect the generated content of the README.md.

Thank you for your patience and support in helping me work through this issue!


My Changes

_container-vars-blank File:

- param_usage_include_hostname: false # you can set it to 'optional'
+ param_usage_include_hostname: true # you can set it to 'optional'
  param_hostname: "hostname"
- param_hostname_desc: "Set hostname for the container."
+ param_hostname_desc: "In a master-slave architecture, the hostname of the master node is displayed as its name in the web interface, while the hostname of the slave nodes represents their device aliases. These aliases must match the ones defined in the master's Slaves file."

readme-vars.yml File:

  # container parameters
  param_container_name: "{{ project_name }}"
+ param_hostname: "hostname"
  param_usage_include_vols: true

My Commands

Build Command:

cd docker-jenkins-builder
docker build \
  --no-cache \
  --pull \
  -t lscr.io/linuxserver/jenkins-builder:latest .

Generate Command:

docker run --rm \
  -v $(pwd):/tmp \
  -e PUID=$(id -u) -e PGID=$(id -g) \
  lscr.io/linuxserver/jenkins-builder:latest && \
rm -rf .jenkins-external

@Roxedus
Copy link
Member

Roxedus commented Dec 30, 2024

Generation works as expected.

docker run --rm   \
  -v /git/lsio/docker-smokeping:/tmp \
  -e PUID=99 -e PGID=100 \
  lscr.io/linuxserver/jenkins-builder:latest
--- a/README.md
+++ b/README.md
@@ -82,6 +82,7 @@ services:
   smokeping:
     image: lscr.io/linuxserver/smokeping:latest
     container_name: smokeping
+    hostname: smokeping-main
     environment:
       - PUID=1000
       - PGID=1000
@@ -102,6 +103,7 @@ services:
 ```bash
 docker run -d \
   --name=smokeping \
+  --hostname=smokeping-main \
   -e PUID=1000 \
   -e PGID=1000 \
   -e TZ=Etc/UTC \
@@ -121,6 +123,7 @@ Containers are configured using parameters passed at runtime (such as those abov
 
 | Parameter | Function |
 | :----: | --- |
+| `--hostname=` | In a master-slave architecture, the hostname of the master node is displayed as its name in the web interface, while the hostname of the slave nodes represents their device aliases. These aliases must match the ones defined in the master's Slaves file. |
 | `-p 80:80` | Allows HTTP access to the internal webserver. |
 | `-e PUID=1000` | for UserID - see below for explanation |
 | `-e PGID=1000` | for GroupID - see below for explanation |
diff --git a/readme-vars.yml b/readme-vars.yml
index 4583d34..f16ec2f 100644
--- a/readme-vars.yml
+++ b/readme-vars.yml
@@ -24,6 +24,9 @@ opt_param_env_vars:
   - {env_var: "MASTER_URL", env_value: "http://<master-host-ip>:80/smokeping/", desc: "Specify the master url to connect to. Used when in slave mode."}
   - {env_var: "SHARED_SECRET", env_value: "password", desc: "Specify the master shared secret for this host. Used when in slave mode."}
   - {env_var: "CACHE_DIR", env_value: "/tmp", desc: "Specify the cache directory for this host. Used when in slave mode."}
+param_usage_include_hostname: true # you can set it to 'optional'
+param_hostname: "smokeping-main"
+param_hostname_desc: "In a master-slave architecture, the hostname of the master node is displayed as its name in the web interface, while the hostname of the slave nodes represents their device aliases. These aliases must match the ones defined in the master's Slaves file."
 # application setup block
 app_setup_block_enabled: true
 app_setup_block: |

@zongsforce zongsforce force-pushed the master branch 4 times, most recently from c893fd7 to 224bf01 Compare December 30, 2024 13:14
@zongsforce
Copy link
Author

Generation works as expected.

docker run --rm   \
  -v /git/lsio/docker-smokeping:/tmp \
  -e PUID=99 -e PGID=100 \
  lscr.io/linuxserver/jenkins-builder:latest
--- a/README.md
+++ b/README.md
@@ -82,6 +82,7 @@ services:
   smokeping:
     image: lscr.io/linuxserver/smokeping:latest
     container_name: smokeping
+    hostname: smokeping-main
     environment:
       - PUID=1000
       - PGID=1000
@@ -102,6 +103,7 @@ services:
 ```bash
 docker run -d \
   --name=smokeping \
+  --hostname=smokeping-main \
   -e PUID=1000 \
   -e PGID=1000 \
   -e TZ=Etc/UTC \
@@ -121,6 +123,7 @@ Containers are configured using parameters passed at runtime (such as those abov
 
 | Parameter | Function |
 | :----: | --- |
+| `--hostname=` | In a master-slave architecture, the hostname of the master node is displayed as its name in the web interface, while the hostname of the slave nodes represents their device aliases. These aliases must match the ones defined in the master's Slaves file. |
 | `-p 80:80` | Allows HTTP access to the internal webserver. |
 | `-e PUID=1000` | for UserID - see below for explanation |
 | `-e PGID=1000` | for GroupID - see below for explanation |
diff --git a/readme-vars.yml b/readme-vars.yml
index 4583d34..f16ec2f 100644
--- a/readme-vars.yml
+++ b/readme-vars.yml
@@ -24,6 +24,9 @@ opt_param_env_vars:
   - {env_var: "MASTER_URL", env_value: "http://<master-host-ip>:80/smokeping/", desc: "Specify the master url to connect to. Used when in slave mode."}
   - {env_var: "SHARED_SECRET", env_value: "password", desc: "Specify the master shared secret for this host. Used when in slave mode."}
   - {env_var: "CACHE_DIR", env_value: "/tmp", desc: "Specify the cache directory for this host. Used when in slave mode."}
+param_usage_include_hostname: true # you can set it to 'optional'
+param_hostname: "smokeping-main"
+param_hostname_desc: "In a master-slave architecture, the hostname of the master node is displayed as its name in the web interface, while the hostname of the slave nodes represents their device aliases. These aliases must match the ones defined in the master's Slaves file."
 # application setup block
 app_setup_block_enabled: true
 app_setup_block: |

It's done. There were some issues with my previous changes, but I've made a new commit and have already tested it. Please help me review the changes again. Thank you for your patient assistance.

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-c131f428b5503081c25e3d8fbdea2f3b3c4a00fc-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-c131f428b5503081c25e3d8fbdea2f3b3c4a00fc-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-c131f428b5503081c25e3d8fbdea2f3b3c4a00fc-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-c131f428b5503081c25e3d8fbdea2f3b3c4a00fc-pr-186

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-39eabd663fddf47f6ee8fd86ae06ed36eb1f9456-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-39eabd663fddf47f6ee8fd86ae06ed36eb1f9456-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-39eabd663fddf47f6ee8fd86ae06ed36eb1f9456-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-39eabd663fddf47f6ee8fd86ae06ed36eb1f9456-pr-186

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-c893fd74af3ba4bd983b13dc0048b0887ae1c74b-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-c893fd74af3ba4bd983b13dc0048b0887ae1c74b-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-c893fd74af3ba4bd983b13dc0048b0887ae1c74b-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-c893fd74af3ba4bd983b13dc0048b0887ae1c74b-pr-186

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-224bf018a40c5d79d14f3d8e47c8eaa1463f9eaf-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-224bf018a40c5d79d14f3d8e47c8eaa1463f9eaf-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-224bf018a40c5d79d14f3d8e47c8eaa1463f9eaf-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-224bf018a40c5d79d14f3d8e47c8eaa1463f9eaf-pr-186

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-6901952bd311318abfe3f41f04488ae2060dcc32-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-6901952bd311318abfe3f41f04488ae2060dcc32-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-6901952bd311318abfe3f41f04488ae2060dcc32-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-6901952bd311318abfe3f41f04488ae2060dcc32-pr-186

@LinuxServer-CI
Copy link
Collaborator

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-b046011ed004a5e1d5ccc5febd6732a372893c30-pr-186/index.html
https://ci-tests.linuxserver.io/lspipepr/smokeping/2.8.2-r3-pkg-703e9b74-dev-b046011ed004a5e1d5ccc5febd6732a372893c30-pr-186/shellcheck-result.xml

Tag Passed
amd64-2.8.2-r3-pkg-703e9b74-dev-b046011ed004a5e1d5ccc5febd6732a372893c30-pr-186
arm64v8-2.8.2-r3-pkg-703e9b74-dev-b046011ed004a5e1d5ccc5febd6732a372893c30-pr-186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants