luxos 0.0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- luxos-0.0.0.0/.github/pull_request_template.md +12 -0
- luxos-0.0.0.0/.github/workflows/pull-python-luxos.yml +86 -0
- luxos-0.0.0.0/.github/workflows/push-main.yml +88 -0
- luxos-0.0.0.0/.gitignore +37 -0
- luxos-0.0.0.0/.pre-commit-config.yaml +49 -0
- luxos-0.0.0.0/CHANGELOG.md +11 -0
- luxos-0.0.0.0/DEVELOP.md +82 -0
- luxos-0.0.0.0/PKG-INFO +100 -0
- luxos-0.0.0.0/README.md +77 -0
- luxos-0.0.0.0/config.yaml +54 -0
- luxos-0.0.0.0/health-checker.pyz +0 -0
- luxos-0.0.0.0/luxos.pyz +0 -0
- luxos-0.0.0.0/make.py +127 -0
- luxos-0.0.0.0/pyproject.toml +80 -0
- luxos-0.0.0.0/src/luxos/__init__.py +0 -0
- luxos-0.0.0.0/src/luxos/__main__.py +4 -0
- luxos-0.0.0.0/src/luxos/api.json +215 -0
- luxos-0.0.0.0/src/luxos/api.py +32 -0
- luxos-0.0.0.0/src/luxos/asyncops.py +208 -0
- luxos-0.0.0.0/src/luxos/exceptions.py +24 -0
- luxos-0.0.0.0/src/luxos/misc.py +31 -0
- luxos-0.0.0.0/src/luxos/scripts/__init__.py +0 -0
- luxos-0.0.0.0/src/luxos/scripts/async_luxos.py +54 -0
- luxos-0.0.0.0/src/luxos/scripts/health_checker.py +862 -0
- luxos-0.0.0.0/src/luxos/scripts/luxos.py +386 -0
- luxos-0.0.0.0/tests/conftest.py +136 -0
- luxos-0.0.0.0/tests/data/echopool.py +131 -0
- luxos-0.0.0.0/tests/requirements.txt +20 -0
- luxos-0.0.0.0/tests/test_luxos.py +19 -0
- luxos-0.0.0.0/tests/test_luxos_asyncops.py +134 -0
- luxos-0.0.0.0/tests/test_luxos_misc.py +28 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
Add your description here.
|
|
4
|
+
|
|
5
|
+
## Merge request checklist
|
|
6
|
+
|
|
7
|
+
- [ ] Added the appropriate `bug`, `enhancement` and/or `breaking-change` tags
|
|
8
|
+
- [ ] My code passes all tests, linter and formatting checks (`make check`).
|
|
9
|
+
- [ ] My commits follow the [How to Write a Git Commit Message Guide](https://chris.beams.io/posts/git-commit/).
|
|
10
|
+
- [ ] I have updated the `CHANGELOG` (yeah, last chance to do it).
|
|
11
|
+
- [ ] Run the `python make.py onepack` and add the new luxos.pyz/health-checker.pyz
|
|
12
|
+
generated files
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: LuxOS Pull-Request
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
9
|
+
|
|
10
|
+
env:
|
|
11
|
+
PACKAGE: luxos
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
18
|
+
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
19
|
+
runs-on: ${{ matrix.os }}
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Set up runner
|
|
23
|
+
run: echo noop
|
|
24
|
+
|
|
25
|
+
- name: Checkout
|
|
26
|
+
uses: actions/checkout@v4.1.0
|
|
27
|
+
with:
|
|
28
|
+
ref: ${{ github.event.pull_request.head.sha }}
|
|
29
|
+
|
|
30
|
+
- name: Setup Python toolchain
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: ${{ matrix.python-version }}
|
|
34
|
+
|
|
35
|
+
- name: Python dependencies
|
|
36
|
+
shell: bash
|
|
37
|
+
run: |
|
|
38
|
+
python -m pip install --upgrade pip
|
|
39
|
+
pip install -r tests/requirements.txt
|
|
40
|
+
|
|
41
|
+
- name: Run Python checks (ruff)
|
|
42
|
+
shell: bash
|
|
43
|
+
env:
|
|
44
|
+
PYTHONPATH: src
|
|
45
|
+
run: |
|
|
46
|
+
ruff check src tests
|
|
47
|
+
|
|
48
|
+
- name: Run Python checks (mypy)
|
|
49
|
+
shell: bash
|
|
50
|
+
env:
|
|
51
|
+
PYTHONPATH: src
|
|
52
|
+
OUTDIR: build/qa-${{ matrix.python-version }}-${{ matrix.os}}
|
|
53
|
+
run: |
|
|
54
|
+
mypy src \
|
|
55
|
+
--no-incremental --xslt-html-report $OUTDIR/mypy
|
|
56
|
+
|
|
57
|
+
- name: Run Python checks
|
|
58
|
+
shell: bash
|
|
59
|
+
env:
|
|
60
|
+
PYTHONPATH: src
|
|
61
|
+
OUTDIR: build/qa-${{ matrix.python-version }}-${{ matrix.os}}
|
|
62
|
+
run: |
|
|
63
|
+
py.test \
|
|
64
|
+
--cov=${{ env.PACKAGE }} \
|
|
65
|
+
--cov-report=html:$OUTDIR/coverage --cov-report=xml:$OUTDIR/coverage.xml \
|
|
66
|
+
--junitxml=$OUTDIR/junit/junit.xml --html=$OUTDIR/junit/junit.html --self-contained-html \
|
|
67
|
+
tests
|
|
68
|
+
|
|
69
|
+
- name: Build wheel packages
|
|
70
|
+
if: ${{ ! contains(matrix.os, 'windows') }}
|
|
71
|
+
env:
|
|
72
|
+
GITHUB_DUMP: ${{ toJson(github) }}
|
|
73
|
+
run: |
|
|
74
|
+
python -m build
|
|
75
|
+
touch .keepme
|
|
76
|
+
|
|
77
|
+
- name: Archive artifacts
|
|
78
|
+
uses: actions/upload-artifact@v4
|
|
79
|
+
with:
|
|
80
|
+
name: qa-results-${{ matrix.python-version }}-${{ matrix.os }}
|
|
81
|
+
path: |
|
|
82
|
+
build/qa-${{ matrix.python-version }}-${{ matrix.os}}
|
|
83
|
+
dist
|
|
84
|
+
.keepme
|
|
85
|
+
# Use always() to always run this step to publish test results when there are test failures
|
|
86
|
+
if: always()
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
name: Master build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- '*'
|
|
9
|
+
|
|
10
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
|
|
12
|
+
env:
|
|
13
|
+
PACKAGE: luxos
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
20
|
+
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
21
|
+
runs-on: ${{ matrix.os }}
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- name: Set up runner
|
|
25
|
+
run: echo noop
|
|
26
|
+
|
|
27
|
+
- name: Checkout
|
|
28
|
+
uses: actions/checkout@v4.1.0
|
|
29
|
+
with:
|
|
30
|
+
ref: ${{ github.event.push.ref }}
|
|
31
|
+
|
|
32
|
+
- name: Setup Python toolchain
|
|
33
|
+
uses: actions/setup-python@v5
|
|
34
|
+
with:
|
|
35
|
+
python-version: ${{ matrix.python-version }}
|
|
36
|
+
|
|
37
|
+
- name: Python dependencies
|
|
38
|
+
shell: bash
|
|
39
|
+
run: |
|
|
40
|
+
python -m pip install --upgrade pip
|
|
41
|
+
pip install -r tests/requirements.txt
|
|
42
|
+
|
|
43
|
+
- name: Run Python checks (ruff)
|
|
44
|
+
shell: bash
|
|
45
|
+
env:
|
|
46
|
+
PYTHONPATH: src
|
|
47
|
+
run: |
|
|
48
|
+
ruff check src tests
|
|
49
|
+
|
|
50
|
+
- name: Run Python checks (mypy)
|
|
51
|
+
shell: bash
|
|
52
|
+
env:
|
|
53
|
+
PYTHONPATH: src
|
|
54
|
+
OUTDIR: build/qa-${{ matrix.python-version }}-${{ matrix.os}}
|
|
55
|
+
run: |
|
|
56
|
+
mypy src \
|
|
57
|
+
--no-incremental --xslt-html-report $OUTDIR/mypy
|
|
58
|
+
|
|
59
|
+
- name: Run Python checks
|
|
60
|
+
shell: bash
|
|
61
|
+
env:
|
|
62
|
+
PYTHONPATH: src
|
|
63
|
+
OUTDIR: build/qa-${{ matrix.python-version }}-${{ matrix.os}}
|
|
64
|
+
run: |
|
|
65
|
+
py.test \
|
|
66
|
+
--cov=${{ env.PACKAGE }} \
|
|
67
|
+
--cov-report=html:$OUTDIR/coverage --cov-report=xml:$OUTDIR/coverage.xml \
|
|
68
|
+
--junitxml=$OUTDIR/junit/junit.xml --html=$OUTDIR/junit/junit.html --self-contained-html \
|
|
69
|
+
tests
|
|
70
|
+
|
|
71
|
+
- name: Build wheel packages
|
|
72
|
+
if: ${{ ! contains(matrix.os, 'windows') }}
|
|
73
|
+
env:
|
|
74
|
+
GITHUB_DUMP: ${{ toJson(github) }}
|
|
75
|
+
run: |
|
|
76
|
+
python -m build
|
|
77
|
+
touch .keepme
|
|
78
|
+
|
|
79
|
+
- name: Archive artifacts
|
|
80
|
+
uses: actions/upload-artifact@v4
|
|
81
|
+
with:
|
|
82
|
+
name: qa-results-${{ matrix.python-version }}-${{ matrix.os }}
|
|
83
|
+
path: |
|
|
84
|
+
build/qa-${{ matrix.python-version }}-${{ matrix.os}}
|
|
85
|
+
dist
|
|
86
|
+
.keepme
|
|
87
|
+
# Use always() to always run this step to publish test results when there are test failures
|
|
88
|
+
if: always()
|
luxos-0.0.0.0/.gitignore
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/myenv
|
|
2
|
+
/build
|
|
3
|
+
/dist
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Compiled Python files
|
|
7
|
+
__pycache__/
|
|
8
|
+
*.pyc
|
|
9
|
+
*.pyo
|
|
10
|
+
*.pyd
|
|
11
|
+
|
|
12
|
+
# Python virtual environment
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
*.env
|
|
16
|
+
|
|
17
|
+
# System, editor and IDE files
|
|
18
|
+
.vscode
|
|
19
|
+
.work
|
|
20
|
+
.ci-cargo
|
|
21
|
+
.idea/
|
|
22
|
+
*.swp
|
|
23
|
+
*.swo
|
|
24
|
+
*~
|
|
25
|
+
.project
|
|
26
|
+
*.pyproj
|
|
27
|
+
.DS_Store
|
|
28
|
+
Thumbs.db
|
|
29
|
+
|
|
30
|
+
# Ignore common temporary files
|
|
31
|
+
*.log
|
|
32
|
+
*.csv
|
|
33
|
+
tmp/
|
|
34
|
+
*.tmp
|
|
35
|
+
|
|
36
|
+
# Sonar artifacts
|
|
37
|
+
clippy.log
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# - repo: https://github.com/astral-sh/ruff-pre-commit
|
|
2
|
+
# rev: v0.3.4
|
|
3
|
+
# hooks:
|
|
4
|
+
# - id: ruff
|
|
5
|
+
# args: [--fix, --exit-non-zero-on-fix]
|
|
6
|
+
#
|
|
7
|
+
# - repo: https://github.com/pre-commit/mirrors-mypy
|
|
8
|
+
# rev: v1.9.0
|
|
9
|
+
# hooks:
|
|
10
|
+
# - id: mypy
|
|
11
|
+
# exclude: ^(tests)
|
|
12
|
+
|
|
13
|
+
repos:
|
|
14
|
+
- repo: local
|
|
15
|
+
hooks:
|
|
16
|
+
# repo: https://github.com/astral-sh/ruff-pre-commit
|
|
17
|
+
- id: ruff
|
|
18
|
+
name: ruff
|
|
19
|
+
description: "Run 'ruff' for extremely fast Python linting"
|
|
20
|
+
entry: ruff check --force-exclude
|
|
21
|
+
language: system
|
|
22
|
+
types_or: [python, pyi]
|
|
23
|
+
args: []
|
|
24
|
+
require_serial: true
|
|
25
|
+
additional_dependencies: []
|
|
26
|
+
minimum_pre_commit_version: "2.9.2"
|
|
27
|
+
|
|
28
|
+
- id: ruff-format
|
|
29
|
+
name: ruff-format
|
|
30
|
+
description: "Run 'ruff format' for extremely fast Python formatting"
|
|
31
|
+
entry: ruff format --force-exclude
|
|
32
|
+
language: system
|
|
33
|
+
types_or: [python, pyi]
|
|
34
|
+
args: []
|
|
35
|
+
require_serial: true
|
|
36
|
+
additional_dependencies: []
|
|
37
|
+
minimum_pre_commit_version: "2.9.2"
|
|
38
|
+
|
|
39
|
+
# https://github.com/pre-commit/mirrors-mypy
|
|
40
|
+
- id: mypy
|
|
41
|
+
name: mypy
|
|
42
|
+
description: ''
|
|
43
|
+
entry: mypy
|
|
44
|
+
language: system
|
|
45
|
+
types_or: [python, pyi]
|
|
46
|
+
args: ["--ignore-missing-imports", "--scripts-are-modules"]
|
|
47
|
+
require_serial: true
|
|
48
|
+
additional_dependencies: []
|
|
49
|
+
minimum_pre_commit_version: '2.9.2'
|
luxos-0.0.0.0/DEVELOP.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Develop
|
|
2
|
+
|
|
3
|
+
These are the developer's note, to develop luxos.
|
|
4
|
+
|
|
5
|
+
> **NOTE** We assume we're working inside the checked out
|
|
6
|
+
> `firmware-biz-tools` directory, and you have python (>=3.10)
|
|
7
|
+
> in your path.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
These instructions are useful for a quick start, and
|
|
12
|
+
you should be able to:
|
|
13
|
+
|
|
14
|
+
- **SETUP** the environment (this is done once)
|
|
15
|
+
<details><summary>Windows</summary>
|
|
16
|
+
|
|
17
|
+
```shell
|
|
18
|
+
python -m venv myenv
|
|
19
|
+
.\myenv\Scripts\activate
|
|
20
|
+
|
|
21
|
+
pip install -r tests\requirements.txt
|
|
22
|
+
pip install -e .
|
|
23
|
+
```
|
|
24
|
+
</details>
|
|
25
|
+
|
|
26
|
+
<details><summary>*NIX</summary>
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
python -m venv myenv
|
|
30
|
+
source ./myenv/bin/activate
|
|
31
|
+
|
|
32
|
+
pip install -r tests\requirements.txt
|
|
33
|
+
pip install -e .
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- **ACTIVATE** the environment (each time you start a new shell)
|
|
37
|
+
<details><summary>Windows</summary>
|
|
38
|
+
|
|
39
|
+
```shell
|
|
40
|
+
.\myenv\Scripts\activate
|
|
41
|
+
```
|
|
42
|
+
</details>
|
|
43
|
+
<details><summary>*NIX</summary>
|
|
44
|
+
|
|
45
|
+
```shell
|
|
46
|
+
source ./myenv/bin/activate
|
|
47
|
+
```
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
- **RUN** the tests
|
|
51
|
+
|
|
52
|
+
(Windows & *NIX)
|
|
53
|
+
```shell
|
|
54
|
+
pytest -vvs tests
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Coding
|
|
58
|
+
|
|
59
|
+
### Precommit
|
|
60
|
+
When it comes to coding, you can use [pre-commit](https://pre-commit.com/) hooks
|
|
61
|
+
to help you validate code at every git commit.
|
|
62
|
+
|
|
63
|
+
- **ENABLE** precommit:
|
|
64
|
+
```shell
|
|
65
|
+
pre-commit install
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- **DISABLE** precommit:
|
|
69
|
+
```shell
|
|
70
|
+
pre-commit uninstall
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- **SKIP CHECKS** during git commit:
|
|
74
|
+
Use the `-n` flag:
|
|
75
|
+
```shell
|
|
76
|
+
git commit -n ....
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
At every `git commit` code scanner [ruff](https://github.com/astral-sh/ruff) and
|
|
82
|
+
[mypy](https://mypy-lang.org) will run.
|
luxos-0.0.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: luxos
|
|
3
|
+
Version: 0.0.0.0
|
|
4
|
+
Summary: The all encompassing LuxOS python library.
|
|
5
|
+
Project-URL: Source, https://github.com/LuxorLabs/firmware-biz-tools
|
|
6
|
+
Project-URL: Issues, https://github.com/LuxorLabs/firmware-biz-tools/issues
|
|
7
|
+
Author-email: Antonio Cavallo <antonio.cavallo@luxor.tech>
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Requires-Dist: asyncpg
|
|
18
|
+
Requires-Dist: httpx
|
|
19
|
+
Requires-Dist: pandas
|
|
20
|
+
Requires-Dist: pyyaml
|
|
21
|
+
Requires-Dist: tqdm
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# LuxOS Tools Repository
|
|
25
|
+
|
|
26
|
+
> **WARNING** There are references into the PR luxos-code-refactoring
|
|
27
|
+
|
|
28
|
+
This repository contains scripts we built to operate and troubleshoot miners running LuxOS.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
There are few ways to install the luxos package:
|
|
33
|
+
|
|
34
|
+
1. Using pip (suggested for end-users):
|
|
35
|
+
```shell
|
|
36
|
+
pip install luxos
|
|
37
|
+
pip install git+https://github.com/LuxorLabs/luxos-tooling.git@pr/luxos-code-refactoring
|
|
38
|
+
```
|
|
39
|
+
Using pip gives you access to the cli commands `luxos` and `health-checker` as well
|
|
40
|
+
the ability to import in python the `import luxos.api` api for luxos.
|
|
41
|
+
|
|
42
|
+
2. A single drop in file (for support):
|
|
43
|
+
```shell
|
|
44
|
+
curl -LO https://github.com/LuxorLabs/luxos-tooling/raw/pr/luxos-code-refactoring/luxos.pyz
|
|
45
|
+
```
|
|
46
|
+
These are two standalone [zipapp](https://docs.python.org/3/library/zipapp.html) files, you can use
|
|
47
|
+
from the command line as `python luxos.pyz`, no dependencies beside a recent-*ish* python
|
|
48
|
+
version (eg. >= 3.10)
|
|
49
|
+
|
|
50
|
+
3. From the [github](https://github.com/LuxorLabs/luxos-tooling) source checkout (for devs):
|
|
51
|
+
```shell
|
|
52
|
+
python -m venv venv
|
|
53
|
+
source venv/bin/activate # for Windows: .\myenv\Scripts\activate)
|
|
54
|
+
|
|
55
|
+
pip install -r tests/requirements.txt
|
|
56
|
+
|
|
57
|
+
export PYTHONPATH=$(pwd)/src # for Windows: SET PYTHONPATH=%CD%\src
|
|
58
|
+
(or)
|
|
59
|
+
pip install -e .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## LuxOS API Wrapper - luxos
|
|
63
|
+
|
|
64
|
+
This tool offers a convenient way to interact with LuxOS through a command-line interface (CLI) or as Python packages for more advanced integrations.
|
|
65
|
+
|
|
66
|
+
**CLI Usage**
|
|
67
|
+
|
|
68
|
+
The luxos.py script serves as a versatile LuxOS API wrapper, allowing users to interact with LuxOS features directly from the command line. Below are some basic examples:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python3 -m luxos --ipfile miners.csv --cmd rebootdevice --timeout 2
|
|
72
|
+
python3 -m luxos --range_start 192.168.1.0 --range_end 192.168.1.255 --cmd rebootdevice --verbose True
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
> **NOTE** Please don't forget to set the PYTHONPATH.
|
|
76
|
+
|
|
77
|
+
**Library Usage**
|
|
78
|
+
|
|
79
|
+
If you prefer to integrate LuxOS functionality into your Python applications or scripts, luxos.py can also be used as a Python package. Here's a quick example:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from luxos.api import (execute_command)
|
|
83
|
+
|
|
84
|
+
execute_command("192.168.1.1", 4028, 2, "rebootdevice", "", False)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## LuxOS HealthChecker - health_checker.py
|
|
88
|
+
|
|
89
|
+
The HealthChecker script is designed to continuously pull miner data from LuxOS, providing valuable insights into the health of your mining machines.
|
|
90
|
+
|
|
91
|
+
You can customize the HealthChecker params using the `config.yaml` file provided.
|
|
92
|
+
To run the HealthChecker you can use `health-checker` if you installed using pip, or
|
|
93
|
+
the cli `python3 -m luxos.scripts.health_checker`.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
Feel free to explore and customize these tools to suit your specific needs.
|
|
98
|
+
If you encounter any issues or have suggestions for improvement, please open an issue or submit a pull request.
|
|
99
|
+
|
|
100
|
+
You can find LuxOS API documentation [here](https://docs.luxor.tech/firmware/api/intro).
|
luxos-0.0.0.0/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# LuxOS Tools Repository
|
|
2
|
+
|
|
3
|
+
> **WARNING** There are references into the PR luxos-code-refactoring
|
|
4
|
+
|
|
5
|
+
This repository contains scripts we built to operate and troubleshoot miners running LuxOS.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
There are few ways to install the luxos package:
|
|
10
|
+
|
|
11
|
+
1. Using pip (suggested for end-users):
|
|
12
|
+
```shell
|
|
13
|
+
pip install luxos
|
|
14
|
+
pip install git+https://github.com/LuxorLabs/luxos-tooling.git@pr/luxos-code-refactoring
|
|
15
|
+
```
|
|
16
|
+
Using pip gives you access to the cli commands `luxos` and `health-checker` as well
|
|
17
|
+
the ability to import in python the `import luxos.api` api for luxos.
|
|
18
|
+
|
|
19
|
+
2. A single drop in file (for support):
|
|
20
|
+
```shell
|
|
21
|
+
curl -LO https://github.com/LuxorLabs/luxos-tooling/raw/pr/luxos-code-refactoring/luxos.pyz
|
|
22
|
+
```
|
|
23
|
+
These are two standalone [zipapp](https://docs.python.org/3/library/zipapp.html) files, you can use
|
|
24
|
+
from the command line as `python luxos.pyz`, no dependencies beside a recent-*ish* python
|
|
25
|
+
version (eg. >= 3.10)
|
|
26
|
+
|
|
27
|
+
3. From the [github](https://github.com/LuxorLabs/luxos-tooling) source checkout (for devs):
|
|
28
|
+
```shell
|
|
29
|
+
python -m venv venv
|
|
30
|
+
source venv/bin/activate # for Windows: .\myenv\Scripts\activate)
|
|
31
|
+
|
|
32
|
+
pip install -r tests/requirements.txt
|
|
33
|
+
|
|
34
|
+
export PYTHONPATH=$(pwd)/src # for Windows: SET PYTHONPATH=%CD%\src
|
|
35
|
+
(or)
|
|
36
|
+
pip install -e .
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## LuxOS API Wrapper - luxos
|
|
40
|
+
|
|
41
|
+
This tool offers a convenient way to interact with LuxOS through a command-line interface (CLI) or as Python packages for more advanced integrations.
|
|
42
|
+
|
|
43
|
+
**CLI Usage**
|
|
44
|
+
|
|
45
|
+
The luxos.py script serves as a versatile LuxOS API wrapper, allowing users to interact with LuxOS features directly from the command line. Below are some basic examples:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
python3 -m luxos --ipfile miners.csv --cmd rebootdevice --timeout 2
|
|
49
|
+
python3 -m luxos --range_start 192.168.1.0 --range_end 192.168.1.255 --cmd rebootdevice --verbose True
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> **NOTE** Please don't forget to set the PYTHONPATH.
|
|
53
|
+
|
|
54
|
+
**Library Usage**
|
|
55
|
+
|
|
56
|
+
If you prefer to integrate LuxOS functionality into your Python applications or scripts, luxos.py can also be used as a Python package. Here's a quick example:
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from luxos.api import (execute_command)
|
|
60
|
+
|
|
61
|
+
execute_command("192.168.1.1", 4028, 2, "rebootdevice", "", False)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## LuxOS HealthChecker - health_checker.py
|
|
65
|
+
|
|
66
|
+
The HealthChecker script is designed to continuously pull miner data from LuxOS, providing valuable insights into the health of your mining machines.
|
|
67
|
+
|
|
68
|
+
You can customize the HealthChecker params using the `config.yaml` file provided.
|
|
69
|
+
To run the HealthChecker you can use `health-checker` if you installed using pip, or
|
|
70
|
+
the cli `python3 -m luxos.scripts.health_checker`.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
Feel free to explore and customize these tools to suit your specific needs.
|
|
75
|
+
If you encounter any issues or have suggestions for improvement, please open an issue or submit a pull request.
|
|
76
|
+
|
|
77
|
+
You can find LuxOS API documentation [here](https://docs.luxor.tech/firmware/api/intro).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
output:
|
|
2
|
+
verbose: false # Logging verbose output
|
|
3
|
+
csv_output: healthcheck.csv # File name for the health check results
|
|
4
|
+
local_grafana_file: health_checks/local_grafana.csv # Local file where outputs will be stored to support local Grafana operation
|
|
5
|
+
report_output_type: csv # Output type (csv or db)
|
|
6
|
+
|
|
7
|
+
# File containing IP addresses for scanning
|
|
8
|
+
ipfile: miners.csv
|
|
9
|
+
|
|
10
|
+
# IP range for scanning (leave null if using csv file for scan)
|
|
11
|
+
ip_settings:
|
|
12
|
+
range_start: null # IP start range
|
|
13
|
+
range_end: null # IP end range
|
|
14
|
+
|
|
15
|
+
threads:
|
|
16
|
+
max_threads: 10 # Maximum number of threads to use (watch out so we dont overload the network)
|
|
17
|
+
|
|
18
|
+
luxos:
|
|
19
|
+
port: 4028 # Port for LuxOS API
|
|
20
|
+
timeout: 5 # Timeout for network scan in seconds
|
|
21
|
+
|
|
22
|
+
# Time (in seconds) to wait between each execution of the health check (to start the loop again)
|
|
23
|
+
sleep_between_executions: 10
|
|
24
|
+
|
|
25
|
+
# Database settings (if report_output_type is db)
|
|
26
|
+
database:
|
|
27
|
+
host: ""
|
|
28
|
+
port:
|
|
29
|
+
name:
|
|
30
|
+
user:
|
|
31
|
+
password:
|
|
32
|
+
table_name:
|
|
33
|
+
|
|
34
|
+
# Configuration execution settings
|
|
35
|
+
execution:
|
|
36
|
+
executeconfigs: "False" # Define if configs should be executed on miners after every health check
|
|
37
|
+
tempctrlset:
|
|
38
|
+
execute: "True" # Execute tempctrlset
|
|
39
|
+
param1: 50
|
|
40
|
+
param2: 66
|
|
41
|
+
param3: 76
|
|
42
|
+
atmset:
|
|
43
|
+
execute: "False" # Execute atmset
|
|
44
|
+
param1: enabled=true
|
|
45
|
+
param2: startup_minutes=1
|
|
46
|
+
param3: post_ramp_minutes=1
|
|
47
|
+
param4: temp_window=3
|
|
48
|
+
fanset:
|
|
49
|
+
execute: "True" # Execute fanset
|
|
50
|
+
param1: 100
|
|
51
|
+
param2: 3
|
|
52
|
+
immersionswitch:
|
|
53
|
+
execute: "False" # Execute immersionswitch
|
|
54
|
+
param1: off
|
|
Binary file
|
luxos-0.0.0.0/luxos.pyz
ADDED
|
Binary file
|