Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoDerp committed Mar 2, 2024
2 parents f18f536 + 468772d commit 910c26d
Show file tree
Hide file tree
Showing 24 changed files with 881 additions and 261 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker-build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#This action test builds EMHASS standalone Docker images, in each architecture.
name: "Test Docker Stanadlone"

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [
{buildx: linux/amd64, target_arch: amd64},
{buildx: linux/arm/v7, target_arch: armv7},
{buildx: linux/arm/v7, target_arch: armhf},
{buildx: linux/arm64, target_arch: aarch64}
]
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform.buildx }}
build-args: |
build_version=standalone
TARGETARCH=${{ matrix.platform.target_arch }}
tags: emhass/standalone-test
load: true
- name: Test #assume docker fail with FileNotFound secrets_emhass.yaml error
run: docker run --rm -it emhass/standalone-test | grep -q secrets_emhass.yaml && echo 0 || echo 1
92 changes: 73 additions & 19 deletions .github/workflows/publish_docker.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#template modified from: https://docs.docker.com/build/ci/github-actions/multi-platform/
name: "Publish Docker"

on:
Expand All @@ -6,37 +7,90 @@ on:
workflow_dispatch:

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [
{buildx: linux/amd64, target_arch: amd64},
{buildx: linux/arm/v7, target_arch: armv7},
{buildx: linux/arm/v7, target_arch: armhf},
{buildx: linux/arm64, target_arch: aarch64}
]
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
davidusb/emhass-docker-standalone
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
${{ secrets.DOCKERHUB_USERNAME }}/emhass-docker-standalone
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ matrix.platform.buildx }}
build-args: |
build_version=standalone
TARGETARCH=${{ matrix.platform.target_arch }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ secrets.DOCKERHUB_USERNAME }}/emhass-docker-standalone,push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ matrix.platform.target_arch }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
if: always()
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/emhass-docker-standalone
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ secrets.DOCKERHUB_USERNAME }}/emhass-docker-standalone@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ secrets.DOCKERHUB_USERNAME }}/emhass-docker-standalone:${{ steps.meta.outputs.version }}
3 changes: 2 additions & 1 deletion .github/workflows/upload-package-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ jobs:
source .venv/bin/activate
python -m pip install --upgrade pip
pip install setuptools wheel twine
python -m pip install --upgrade build
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
8 changes: 5 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "EMHASS run",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "web_server.py",
"console": "integratedTerminal",
Expand All @@ -22,11 +22,12 @@
"OPTIONS_PATH": "/workspaces/emhass/options.json",
"SECRETS_PATH": "/workspaces/emhass/secrets_emhass.yaml",
"DATA_PATH": "/workspaces/emhass/data/",
"LOGGING_LEVEL": "DEBUG"
}
},
{
"name": "EMHASS run ADDON",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "web_server.py",
"console": "integratedTerminal",
Expand All @@ -45,6 +46,7 @@
"LAT": "45.83", //optional change
"LON": "6.86", //optional change
"ALT": "4807.8", //optional change
"LOGGING_LEVEL": "DEBUG" //optional change
},

}
Expand Down
69 changes: 0 additions & 69 deletions Add-onEmulateDocker

This file was deleted.

24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# Changelog

## [0.8.1] - 2024-02-28
### Improvement
- Improved documentation
### Fix
- Persistent data storage fix
- Docker Standalone Publish Workspace Fix

## [0.8.0] - 2024-02-25
### Improvement
- Thanks to the great work from @GeoDerp we now have a unified/centralized Dockerfile that allows for testing different installation configuration methods in one place. This greatly helps testing, notably emulating the add-on environment. This will improve overall testing for both teh core code and the add-on. Again many thanks!
- There were also a lot of nice improveements from @GeoDerp to the webui, namely: styling, dynamic table, optimization feedback after button press, logging, a new clear button, etc.
- From now on we will unify the semantic versioning for both the main core code and the add-on.

## [0.7.8] - 2024-02-18
### Improvement
Added some nice logging functionalities and responsiveness on the webui.
Thanks to @GeoDerp for this great work!
- new actionLogs.txt is generated in datapath storing sessions app.logger info
- on successful html button press, fetch is called to get html containing latest table data
- on html button press, If app.logger ERROR is present, send action log back and present on page.

## [0.7.7] - 2024-02-10
### Improvement
- Bumped the webui. Index/style added runtime parameter dictionary inputs. Thanks to @GeoDerp
- Bumped the webui. Some great new features and styling. Now it is possible to pass data directly as lsit of values when using the buttons in the webui. Thanks to @GeoDerp
- Added two additional testing environment options. Thanks to @GeoDerp
### Fix
- Bump markupsafe from 2.1.4 to 2.1.5
Expand Down Expand Up @@ -565,6 +586,7 @@
[0.7.5]: https://github.com/davidusb-geek/emhass/releases/tag/v0.7.5
[0.7.6]: https://github.com/davidusb-geek/emhass/releases/tag/v0.7.6
[0.7.7]: https://github.com/davidusb-geek/emhass/releases/tag/v0.7.7
[0.7.8]: https://github.com/davidusb-geek/emhass/releases/tag/v0.7.8

# Notes
All notable changes to this project will be documented in this file.
Expand Down
Loading

0 comments on commit 910c26d

Please sign in to comment.