Skip to content

Commit 8d981c9

Browse files
committed
update sdk to beta.26 / minor improvements
1 parent 0cd4a20 commit 8d981c9

File tree

10 files changed

+75
-67
lines changed

10 files changed

+75
-67
lines changed

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,22 @@ check-init:
2727
ingredients: $(INGREDIENTS)
2828
@echo "Re-evaluating ingredients..."
2929

30-
${PACKAGE_ID}.s9pk: $(INGREDIENTS) | check-deps check-init
30+
${PACKAGE_ID}.s9pk: $(INGREDIENTS) $(shell git ls-files assets) | check-deps check-init
3131
@$(MAKE) --no-print-directory ingredients
3232
start-cli s9pk pack
3333

34+
x86: $(INGREDIENTS) $(shell git ls-files assets) | check-deps check-init
35+
@$(MAKE) --no-print-directory ingredients
36+
BUILD=x86 start-cli s9pk pack
37+
@echo " Done!"
38+
@echo " Filesize:$(shell du -h $(PACKAGE_ID).s9pk) is ready"
39+
40+
arm: $(INGREDIENTS) $(shell git ls-files assets) | check-deps check-init
41+
@$(MAKE) --no-print-directory ingredients
42+
BUILD=arm start-cli s9pk pack
43+
@echo " Done!"
44+
@echo " Filesize:$(shell du -h $(PACKAGE_ID).s9pk) is ready"
45+
3446
javascript/index.js: $(shell git ls-files startos) tsconfig.json node_modules package.json
3547
npm run build
3648

README.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ It includes a preconfigured dashboard for monitoring your Bitaxes. This package
99

1010
This repository creates the `s9pk` package that is installed to run AxeOS Monitor on [StartOS](https://github.com/Start9Labs/start-os/). Learn more about service packaging in the [Developer Docs](https://start9.com/latest/developer-docs/).
1111

12+
<p align="center">
13+
<img src="axeos-monitor-preview.png" alt="Project Logo" width="100%">
14+
</p>
15+
1216
## Dependencies
1317

1418
Install the system dependencies below to build this project by following the instructions in the provided links. You can also find detailed steps to setup your environment in the service packaging [documentation](https://docs.start9.com/latest/developer-docs/packaging#development-environment).
1519

1620
- [docker](https://docs.docker.com/get-docker)
1721
- [docker-buildx](https://docs.docker.com/buildx/working-with-buildx/)
18-
- [yq](https://mikefarah.gitbook.io/yq)
19-
- [deno](https://deno.land/)
2022
- [make](https://www.gnu.org/software/make/)
21-
- [start-sdk](https://github.com/Start9Labs/start-os/tree/sdk)
23+
- [start-cli](https://github.com/Start9Labs/start-os/)
2224

2325
## Cloning
2426

@@ -37,21 +39,9 @@ To build the service as a universal package, run the following command:
3739
make
3840
```
3941

40-
Alternatively the package can be built for individual architectures by specifying the architecture as follows:
41-
42-
```
43-
make x86
44-
```
45-
46-
or
47-
48-
```
49-
make arm
50-
```
51-
5242
## Installing (on StartOS)
5343

54-
Before installation, define `host: https://server-name.local` in your `~/.embassy/config.yaml` config file then run the following commands to determine successful install:
44+
Before installation, define `host: https://server-name.local` in your `~/.startos/config.yaml` config file then run the following commands to determine successful install:
5545

5646
> Change server-name.local to your Start9 server address
5747
@@ -61,7 +51,7 @@ start-cli auth login
6151
make install
6252
```
6353

64-
**Tip:** You can also install the axeos-monitor-aio-startos.s9pk by sideloading it under the **StartOS > System > Sideload a Service** section.
54+
**Tip:** You can also install the axeos-monitor-aio.s9pk by sideloading it under the **StartOS > System > Sideload a Service** section.
6555

6656
## Verify Install
6757

assets/grafana/dashboards/axeos.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "grafana",
88
"uid": "-- Grafana --"
99
},
10-
"enable": false,
10+
"enable": true,
1111
"hide": true,
1212
"iconColor": "rgba(0, 211, 255, 1)",
1313
"name": "Annotations & Alerts",
@@ -3030,7 +3030,7 @@
30303030
]
30313031
},
30323032
"time": {
3033-
"from": "now-5m",
3033+
"from": "now-1h",
30343034
"to": "now"
30353035
},
30363036
"timepicker": {},

assets/grafana/provisioning/dashboards/dashboards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ providers:
1414
# <bool> disable dashboard deletion
1515
disableDeletion: false
1616
# <int> how often Grafana will scan for changed dashboards
17-
updateIntervalSeconds: 10
17+
updateIntervalSeconds: 600
1818
# <bool> allow updating provisioned dashboards from the UI
1919
allowUiUpdates: false
2020
options:

axeos-monitor-preview.png

144 KB
Loading

instructions.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,15 @@
22

33
The default username/password is 'admin/admin'. You will be asked to change this password when you first login.
44
**Save this password in your password manager, you will not be able to recover it.**
5+
6+
# Customize the default Dashboard
7+
8+
AxeOS Monitor comes with a default dashboard that already has some useful widgets. You can customize this dashboard by adding or removing widgets, or by creating your own custom widgets.
9+
10+
Note that the default dashboard cannot be saved and serves as a template for creating your own dashboards. This default dashboard will be reset and overwritten when you upgrade or reinstall AxeOS Monitor.
11+
12+
If you want to customize the default dashboard, you should save it as a new dashboard. To do this, click on the "Edit" button in the top right corner of the dashboard, then "Save as copy". You will be prompted to enter a name for your new dashboard. Once you have saved your new dashboard, you can customize it as you like.
13+
14+
# Set your home dashboard
15+
16+
To set your newly copied dashboard as your default home dashboard, go to your profile (click the icon in the top right of the screen). Here you can select your new dashboard from the "Home Dashboard" dropdown menu. This will set your new dashboard as the default dashboard that is displayed when you log in.

package-lock.json

Lines changed: 18 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"check": "tsc --noEmit"
77
},
88
"dependencies": {
9-
"@start9labs/start-sdk": "^0.4.0-beta.25"
9+
"@start9labs/start-sdk": "^0.4.0-beta.26"
1010
},
1111
"devDependencies": {
1212
"@types/node": "^22.1.0",

startos/main.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const main = sdk.setupMain(async ({ effects, started }) => {
7878
)
7979

8080
// Fix file permissions
81+
exec(`chown -R 472:0 ${grafanaSubcontainer.rootfs}/assets`)
8182
exec(`chown -R 472:0 ${grafanaSubcontainer.rootfs}/var/lib/grafana`)
8283
exec(`chown -R 472:0 ${grafanaSubcontainer.rootfs}/etc/grafana`)
8384

@@ -89,21 +90,9 @@ export const main = sdk.setupMain(async ({ effects, started }) => {
8990
exec(`chmod g+w ${jsonExporterSubcontainer.rootfs}/config`)
9091

9192
// grafana provisioning
92-
await ensureFileExists(
93-
grafanaSubcontainer,
94-
'/assets/provisioning/datasources/prometheus.yml',
95-
'/etc/grafana/provisioning/datasources/prometheus.yml',
96-
)
97-
// await ensureFileExists(
98-
// grafanaSubcontainer,
99-
// '/assets/provisioning/dashboards/dashboards.yml',
100-
// '/etc/grafana/provisioning/dashboards/dashboards.yml',
101-
// )
102-
103-
// add/update default axeos dashboard
104-
const src = grafanaSubcontainer.rootfs + '/assets/dashboards/axeos.json'
105-
const dst = grafanaSubcontainer.rootfs + '/etc/grafana/dashboards/axeos.json'
106-
exec(`cp ${src} ${dst} && chown 472:0 ${dst}`)
93+
exec(`cp ${grafanaSubcontainer.rootfs}/assets/provisioning/datasources/prometheus.yml ${grafanaSubcontainer.rootfs}/etc/grafana/provisioning/datasources/prometheus.yml`)
94+
exec(`cp ${grafanaSubcontainer.rootfs}/assets/provisioning/dashboards/dashboards.yml ${grafanaSubcontainer.rootfs}/etc/grafana/provisioning/dashboards/dashboards.yml`)
95+
exec(`cp ${grafanaSubcontainer.rootfs}/assets/dashboards/axeos.json ${grafanaSubcontainer.rootfs}/etc/grafana/dashboards/axeos.json`)
10796

10897
const healthReceipts: T.HealthCheck[] = []
10998

startos/manifest.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
import { setupManifest } from '@start9labs/start-sdk'
2+
import { SDKImageInputSpec } from '@start9labs/start-sdk/base/lib/types/ManifestTypes'
3+
4+
// the following allows us to build the service for x86 or arm64 specifically
5+
// use: 'make x86' or 'make arm' ('make' will build both)
6+
const BUILD = process.env.BUILD || ''
7+
const arch =
8+
BUILD === 'x86'
9+
? ['x86_64']
10+
: BUILD === 'arm'
11+
? ['aarch64']
12+
: ['x86_64', 'aarch64']
213

314
export const manifest = setupManifest({
415
id: 'axeos-monitor-aio',
@@ -16,23 +27,23 @@ export const manifest = setupManifest({
1627
volumes: ['grafana', 'prometheus'],
1728
images: {
1829
grafana: {
19-
arch: ['x86_64'],
30+
arch: arch,
2031
source: {
2132
dockerTag: 'grafana/grafana-oss:12.0.1',
2233
},
23-
},
34+
} as SDKImageInputSpec,
2435
prometheus: {
25-
arch: ['x86_64'],
36+
arch: arch,
2637
source: {
2738
dockerTag: 'prom/prometheus:v3.4.1',
2839
},
29-
},
40+
} as SDKImageInputSpec,
3041
'json-exporter': {
31-
arch: ['x86_64'],
42+
arch: arch,
3243
source: {
3344
dockerTag: 'prometheuscommunity/json-exporter:v0.7.0',
3445
},
35-
},
46+
} as SDKImageInputSpec,
3647
},
3748
hardwareRequirements: {},
3849
alerts: {

0 commit comments

Comments
 (0)