diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 8b4d4f3..928601d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -6,6 +6,15 @@ on: tags: ['*'] pull_request: workflow_dispatch: + inputs: + keep-test-image: + description: "Keep the Test Image (set to 'true' to keep the image)" + required: true + default: "false" + test-image-tag-suffix: + description: "Suffix for Test Image Tag" + required: false + default: "" env: REGISTRY: ghcr.io @@ -13,8 +22,8 @@ env: BASE_IMAGE_USER: ghcr.io/driplineorg BASE_IMAGE_REPO: dripline-cpp DEV_SUFFIX: '-dev' - BASE_IMAGE_TAG: 'v2.10.11' -# BASE_IMAGE_TAG: 'dlcpp-hf2.10.8' + BASE_IMAGE_TAG: 'v2.10.12' +# BASE_IMAGE_TAG: 'gha-test-hf2.10.12' # DEV_SUFFIX: '' jobs: @@ -24,7 +33,7 @@ jobs: runs-on: ubuntu-22.04 env: - TAG: gha-test + TAG: "gha-test${{ github.event.inputs.test-image-tag-suffix }}" INT_TAG: gha-int-test steps: @@ -48,12 +57,21 @@ jobs: with: driver: docker + - name: Login to GHCR + # This condition should match the `push` condition in the `Build` step just below + if: ${{ github.event.inputs.keep-test-image == 'true' }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build id: build uses: docker/build-push-action@v5 with: context: . - push: false + push: ${{ github.event.inputs.keep-test-image == 'true' }} load: true build-args: | img_user=${{ env.BASE_IMAGE_USER }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 965bafd..bbae80e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) # <3.5 is deprecated by CMake -project( DriplinePy VERSION 5.1.5 ) +project( DriplinePy VERSION 5.1.6 ) cmake_policy( SET CMP0074 NEW ) diff --git a/Dockerfile b/Dockerfile index 4411937..c3185bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG img_user=ghcr.io/driplineorg ARG img_repo=dripline-cpp #ARG img_tag=dlcpp-hf2.10.8 -ARG img_tag=v2.10.11 +ARG img_tag=v2.10.12 FROM ${img_user}/${img_repo}:${img_tag} AS deps diff --git a/changelog.md b/changelog.md index 48bb1f4..b082605 100644 --- a/changelog.md +++ b/changelog.md @@ -10,6 +10,18 @@ Types of changes: Added, Changed, Deprecated, Removed, Fixed, Security ## [Unreleased] +## [5.1.6] - 2026-08-26 + +### Fixed + +- `scheduled_log` now performs on_get in tr/except loop to catch dl errors and not crash, instead throwing a warning and returning +- `calibrate` now forces dict calibrations to be mapped to string, reflecting how Scarab reads and passes calibration information + +### Added + +- Added ability to keep the test Docker image + + ## [5.1.5] - 2025-02-04 ### Fixed diff --git a/chart/Chart.yaml b/chart/Chart.yaml index d77ab3d..67beba6 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 ## the appVersion is used as the container image tag for the main container in the pod from the deployment ## it can be overridden by a values.yaml file in image.tag -appVersion: "v5.1.5" +appVersion: "v5.1.6" description: Deploy a dripline-python microservice name: dripline-python version: 1.1.2 diff --git a/dripline/core/calibrate.py b/dripline/core/calibrate.py index f9c50ab..e39e685 100644 --- a/dripline/core/calibrate.py +++ b/dripline/core/calibrate.py @@ -49,8 +49,8 @@ def wrapper(self, *args, **kwargs): val_dict['value_cal'] = cal elif isinstance(self._calibration, dict): logger.debug('calibration is dictionary, looking up value') - if val_dict['value_raw'] in self._calibration: - val_dict['value_cal'] = self._calibration[val_dict['value_raw']] + if str(val_dict['value_raw']) in self._calibration: + val_dict['value_cal'] = self._calibration[str(val_dict['value_raw'])] else: raise ThrowReply('service_error_invalid_value', f"raw value <{repr(val_dict['value_raw'])}> not in cal dict") else: diff --git a/dripline/core/entity.py b/dripline/core/entity.py index fae6ae3..d22d69c 100644 --- a/dripline/core/entity.py +++ b/dripline/core/entity.py @@ -176,8 +176,12 @@ def log_interval(self, new_interval): raise ThrowReply('service_error_invalid_value', f"unable to interpret a new_interval of type <{type(new_interval)}>") def scheduled_log(self): - logger.debug("in a scheduled log event") - result = self.on_get() + logger.debug(f"in a scheduled log event for {self.name}") + try: + result = self.on_get() + except ThrowReply as err: + logger.warning(f'scheduled log failed with error:\n{err}') + return try: this_value = float(result[self._check_field]) is_float = True