Skip to content
This repository has been archived by the owner on Apr 7, 2023. It is now read-only.

Commit

Permalink
feat: update sys.config based on hm-pyhelper
Browse files Browse the repository at this point in the history
update sys.config based on hm-pyhelper definition
  • Loading branch information
shawaj committed Mar 16, 2023
1 parent b7618e8 commit e8c9875
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,24 @@ ENV HELIUM_GA_RELEASE $HELIUM_GA_RELEASE
ARG BLOCKCHAIN_ROCKSDB_GC_BYTES
ENV BLOCKCHAIN_ROCKSDB_GC_BYTES $BLOCKCHAIN_ROCKSDB_GC_BYTES

ENV PYTHON_DEPENDENCIES_DIR=/opt/python-dependencies

COPY requirements.txt .

# hadolint ignore=DL3018
RUN apk add --no-cache --update \
python3 \
py3-pip && \
pip3 install --no-cache-dir --target="$PYTHON_DEPENDENCIES_DIR" -r requirements.txt

COPY docker.config /opt/miner/releases/"$HELIUM_GA_RELEASE"/sys.config
COPY docker.config.* /opt/miner/
COPY *.sh /opt/miner/

# Add python dependencies to PYTHONPATH
ENV PYTHONPATH="${PYTHON_DEPENDENCIES_DIR}:${PYTHONPATH}"
ENV PATH="${PYTHON_DEPENDENCIES_DIR}/bin:${PATH}"

RUN echo "$HELIUM_GA_RELEASE" > /etc/lsb_release

ENTRYPOINT ["/opt/miner/start-miner.sh"]
Empty file added config_update/__init__.py
Empty file.
Empty file added config_update/tests/__init__.py
Empty file.
1 change: 1 addition & 0 deletions config_update/update_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from hm_pyhelper.miner_param import get_ecc_location
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hm-pyhelper==0.13.56
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 100
36 changes: 36 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
from distutils.core import setup
from setuptools import find_packages
import os

base_name = 'hw_diag'

# allow setup.py to be run from any path
here = os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))
os.chdir(here)

requires = [
line.strip()
for line in open(os.path.join(here, "requirements.txt"), "r").readlines()
]

setup(
name=base_name,
version='1.0',
author=u'Nebra Ltd.',
author_email='[email protected]',
include_package_data=True,
packages=find_packages(), # include all packages under this directory
description='Diagnostics tool for Nebra Helium Hotspot software.',
long_description="",
zip_safe=False,

entry_points={
'console_scripts': [
'hm_diag = hw_diag.app:main',
],
},

# Adds dependencies
install_requires=requires
)
3 changes: 3 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest
pytest-cov
flake8

0 comments on commit e8c9875

Please sign in to comment.