diff --git a/Dockerfile b/Dockerfile index f3dc8f1..9c88df6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/config_update/__init__.py b/config_update/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/config_update/tests/__init__.py b/config_update/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/config_update/update_config.py b/config_update/update_config.py new file mode 100644 index 0000000..3f23516 --- /dev/null +++ b/config_update/update_config.py @@ -0,0 +1 @@ +from hm_pyhelper.miner_param import get_ecc_location diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..27c5e8e --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +hm-pyhelper==0.13.56 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..7da1f96 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 100 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..666f8fd --- /dev/null +++ b/setup.py @@ -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='sales@nebra.com', + 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 +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..f604537 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +pytest +pytest-cov +flake8