-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possible data path and addon arg fix #161
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #161 +/- ##
=======================================
Coverage 74.95% 74.95%
=======================================
Files 7 7
Lines 1861 1861
=======================================
Hits 1395 1395
Misses 466 466 ☔ View full report in Codecov by Sentry. |
Currently testing. May try and simulate the addon container directory structure of the add-on container as best as possible. |
The working folder for the docker standalone mode (no add-on) is |
I wonder if the run.sh should be like: #!/usr/bin/with-contenv bashio
# ==============================================================================
# Start EMHASS service
# ==============================================================================
export CONFIG_PATH="/usr/src/config_emhass.yaml"
export OPTIONS_PATH="/data/options.json"
export DATA_PATH="/data/"
exec python3 -m emhass.web_server --url "http://supervisor/core/api" --key "$SUPERVISOR_TOKEN" --addon "True" ? |
docker file I created to test the add-on as close as I can make it without emulating HA (ran in EMHASS root) #Test Add-on via Docker Emulation
#Docker run example:
## docker build . -t emhass-addon -f AddonEmulateDocker && docker run -e CONFIG_PATH="/usr/src/config_emhass.yaml" -e "SECRETS_PATH=/usr/src/secrets_emhass.yaml" -e DATA_PATH="/data/" -e OPTIONS_PATH="/data/options.json" emhass-addon --url $URL --key $KEY
FROM --platform=$BUILDPLATFORM debian:stable AS build
WORKDIR /usr/src
# copy the requirements file into the image
COPY ./requirements.txt /usr/src/requirements.txt
# Setup
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libffi-dev \
python3.11 \
python3 \
python3-pip \
python3-dev \
git \
build-essential \
gcc \
coinor-cbc \
coinor-libcbc-dev \
libglpk-dev \
glpk-utils \
libhdf5-dev \
libhdf5-serial-dev \
netcdf-bin \
libnetcdf-dev \
pkg-config \
gfortran \
libatlas-base-dev \
&& ln -s /usr/include/hdf5/serial /usr/include/hdf5/include \
&& export HDF5_DIR=/usr/include/hdf5 \
&& pip3 install --extra-index-url=https://www.piwheels.org/simple --no-cache-dir --break-system-packages -U setuptools wheel \
&& pip3 install --extra-index-url=https://www.piwheels.org/simple --no-cache-dir --break-system-packages -r requirements.txt \
&& apt-get purge -y --auto-remove \
python3-pip \
python3-dev \
git \
build-essential \
libhdf5-dev \
libhdf5-serial-dev \
pkg-config \
gfortran \
&& rm -rf /var/lib/apt/lists/*
#install local emhass
#RUN git clone https://github.com/davidusb-geek/emhass.git
#pip install emhass (original)
COPY ./. /tmp/emhass
WORKDIR /tmp/emhass
RUN python3 setup.py install
WORKDIR /
# copy contentsusr/src
COPY config_emhass.yaml /usr/src
COPY options.json /data/
#unused in production, used temporarily for testing
COPY secrets_emhass.yaml /usr/src/
# Labels
LABEL \
io.hass.name="emhass" \
io.hass.description="EMHASS: Energy Management for Home Assistant" \
io.hass.version=${BUILD_VERSION} \
io.hass.type="addon" \
io.hass.arch="aarch64|amd64|armhf|armv7"
ENTRYPOINT [ "python3", "-m", "emhass.web_server", "--addon", "True" ] |
When testing I couldn't find any errors besides setting paths. Let me know if you get more errors and ill test again 👍 |
Ok thanks. I will merge, test it as it is and if that fails then I will look into the |
If the run.sh modification is required you may only need to parse in the options environment variable. |
No description provided.