Skip to content

Commit

Permalink
Merge pull request #63 from anclrii/dev-2.0.0
Browse files Browse the repository at this point in the history
Dev 2.0.0
  • Loading branch information
anclrii authored Jun 10, 2022
2 parents 797f391 + 7ec55fe commit 27de183
Show file tree
Hide file tree
Showing 30 changed files with 3,238 additions and 250 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
- name: Install pip requirements
run: pip install --no-cache-dir -r requirements.txt -r requirements_tests.txt
- name: Run flake8 lint
run: flake8
- name: Run unit tests
run: pytest -v tests/
- name: Test docker build
run: docker build . --file Dockerfile
push:
needs: test
Expand All @@ -20,7 +26,8 @@ jobs:
fetch-depth: '0'
- name: Bump version and push tag
id: bumpVersion
uses: anothrNick/[email protected]
# uses: anothrNick/[email protected]
uses: alexeyatbluescape/github-tag-action@bugfix/semver-empty-results
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
venv
__pycache__
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COPY requirements.txt /
RUN pip install --no-cache-dir -r /requirements.txt

RUN mkdir -p /app
COPY storj-exporter.py /app
ADD storj_exporter /app
WORKDIR /app
ENV STORJ_HOST_ADDRESS=storagenode STORJ_API_PORT=14002 STORJ_EXPORTER_PORT=9651
CMD [ "python", "./storj-exporter.py" ]
CMD [ "python", "./" ]
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ In this example `storagenode1, storagenode2, storagenode3` are the names of stor
##### Install package dependencies

Dependencies: python3 python3-pip
pip3 install prometheus_client
pip3 install --no-cache-dir -r /requirements.txt

##### Move storj_exporter to binary directory
##### Move storj_exporter directory to a desired location

mv Storj-Exporter/storj-exporter.py /usr/local/bin/
chown storj_exporter:storj_exporter /usr/local/bin/storj-exporter.py
chmod +x /usr/local/bin/storj-exporter.py
mv storj_exporter/ /opt/
chown storj_exporter:storj_exporter /opt/storj_exporter/

##### Install systemd service and set to start on boot

Expand All @@ -60,7 +59,7 @@ In this example `storagenode1, storagenode2, storagenode3` are the names of stor

##### Standalone script

python3 storj-exporter.py
python3 /path/to/storj_exporter/

## Installing full monitoring stack (Prometheus + Grafana + Dashboard)

Expand Down
3 changes: 3 additions & 0 deletions requirements_tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
flake8
pytest
requests-mock
239 changes: 0 additions & 239 deletions storj-exporter.py

This file was deleted.

2 changes: 1 addition & 1 deletion storj_exporter.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ After=docker.service
User=storj_exporter
Group=storj_exporter
Type=simple
ExecStart=/usr/bin/python3 /usr/local/bin/storj-exporter.py
ExecStart=/usr/bin/python3 /opt/storj_exporter/
Restart=on-failure
RestartSec=5s

Expand Down
3 changes: 3 additions & 0 deletions storj_exporter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
Loading

0 comments on commit 27de183

Please sign in to comment.