-
Notifications
You must be signed in to change notification settings - Fork 81
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
Supporting files for APCUPSD Addon #101
base: master
Are you sure you want to change the base?
Changes from all commits
d710d2f
1a1d2fc
2564908
86d4857
7980c92
fe30c82
cb9e643
13e7df2
994d9b0
0948655
dcda5c7
8614809
af466ac
5ab242a
9b58079
c70dbc3
2c9dbb9
78ebac6
c5d2cc7
6e4d84d
70c1e9c
bd2dfc4
90b25fd
e896592
3c0cc28
9d1d1c8
596d3cb
8eda5c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Intentionally blank |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because this addon may optionally run 1 or 2 containers depending on it's configuration I have commented out the services: definition. In the scenario where a user does not want to run apcupsd in a container, the addon_apcupsd.network.tmpl template will be used which does not define the service "addon_apcupsd". If these files were uncommented, the cli would complain that "addon_apcupsd" does not have an image / build context specified. Let me know if there is a more elegant solution here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The best way to do this is one template file per container, so I'll break it out into two separate files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, I want to flag that you'll want to test that the service sucessfully restarts when toggling between "Container" and "Network" mode. Keep a look out for a bug where the service tries and fails to start the apcupsd container even though we don't need this container because we are running in network mode. This happened due to the presence of an (empty) service definition inside the overrides folder. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Enter your own customizations for the APCUPSD Addon container here. These changes will persist after upgrades, so you only need to do them once. | ||
# | ||
# See https://docs.docker.com/compose/extends/#adding-and-overriding-configuration | ||
# for more information on overriding specific parameters of docker-compose files. | ||
|
||
version: "3.7" | ||
#services: | ||
# addon_apcupsd: | ||
# x-rp-comment: Add your customizations below this line | ||
# addon_apcupsd_exporter: | ||
# x-rp-comment: Add your customizations below this line |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: This apcupsd job is added to the prometheus config regardless of whether the user has the addon enabled. I don't think this is an issue as it fails to fetch the metrics silently, but perhaps it is additional overhead we would not want to add? Let me know if there is a method to conditionally add items to this configuration file based on an environment variable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think failing silently in this case is fine, we already do it ( |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Autogenerated - DO NOT MODIFY THIS FILE DIRECTLY | ||
# If you want to overwrite some of these values with your own customizations, | ||
# please add them to `override/addons/apcupsd/addon_apcupsd.yml`. | ||
# | ||
# See https://docs.docker.com/compose/extends/#adding-and-overriding-configuration | ||
# for more information on overriding specific parameters of docker-compose files. | ||
|
||
version: "3.7" | ||
services: | ||
addon_apcupsd: | ||
image: ${ADDON_APCUPSD_CONTAINER_TAG} | ||
container_name: ${COMPOSE_PROJECT_NAME}_addon_apcupsd | ||
cap_drop: | ||
- ALL | ||
restart: unless-stopped | ||
stop_signal: SIGKILL | ||
stop_grace_period: 1s | ||
devices: ["${ADDON_APCUPSD_MOUNT_POINT}"] | ||
volumes: | ||
- ${ROCKETPOOL_FOLDER}/addon_apcupsd.conf:/etc/apcupsd/apcupsd.conf | ||
networks: | ||
- net | ||
addon_apcupsd_exporter: | ||
image: ${ADDON_APCUPSD_EXPORTER_CONTAINER_TAG} | ||
container_name: ${COMPOSE_PROJECT_NAME}_addon_apcupsd_exporter | ||
cap_drop: | ||
- ALL | ||
restart: unless-stopped | ||
stop_signal: SIGKILL | ||
stop_grace_period: 1s | ||
command: "-apcupsd.addr addon_apcupsd:3551 -apcupsd.network tcp -telemetry.addr 0.0.0.0:${ADDON_APCUPSD_METRICS_PORT:-9162} -telemetry.path /metrics" | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
networks: | ||
- net | ||
networks: | ||
net: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Autogenerated - DO NOT MODIFY THIS FILE DIRECTLY | ||
# If you want to overwrite some of these values with your own customizations, | ||
# please add them to `override/addons/apcupsd/addon_apcupsd.yml`. | ||
# | ||
# See https://docs.docker.com/compose/extends/#adding-and-overriding-configuration | ||
# for more information on overriding specific parameters of docker-compose files. | ||
|
||
version: "3.7" | ||
services: | ||
addon_apcupsd_exporter: | ||
image: ${ADDON_APCUPSD_EXPORTER_CONTAINER_TAG} | ||
container_name: ${COMPOSE_PROJECT_NAME}_addon_apcupsd_exporter | ||
cap_drop: | ||
- ALL | ||
restart: unless-stopped | ||
stop_signal: SIGKILL | ||
stop_grace_period: 1s | ||
command: "-apcupsd.addr ${ADDON_APCUPSD_NETWORK_ADDRESS:-host.docker.internal:3551} -apcupsd.network tcp -telemetry.addr 0.0.0.0:${ADDON_APCUPSD_METRICS_PORT:-9162} -telemetry.path /metrics" | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
networks: | ||
- net | ||
networks: | ||
net: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file will be populated with an apcupsd.conf by the cli if the user enables running apcupsd in a container. This file is present in the installer so that it has the correct permissions to be overwritten by the cli.
Please let me know if there is a preffered file path to use here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved this to
install/addons/apcupsd/addon_apcupsd.conf
- all of the addon-specific files will go into that folder and get mounted as a volume in your container.