Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: astarte-platform/astarte_vmq_plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.1
Choose a base ref
...
head repository: astarte-platform/astarte_vmq_plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jun 9, 2023

  1. Forward port v1.1

    Merge release-1.1 branch into master.
    bettio committed Jun 9, 2023
    Copy the full SHA
    2209372 View commit details

Commits on Jun 20, 2023

  1. Forward port changes from v1.1

    Merge release-1.1 branch into master.
    bettio committed Jun 20, 2023
    Copy the full SHA
    d3351f7 View commit details
  2. Prepare next dev cycle (v1.2.0-dev)

    Signed-off-by: Davide Bettio <davide@uninstall.it>
    bettio committed Jun 20, 2023
    Copy the full SHA
    52cd7f7 View commit details

Commits on Jun 22, 2023

  1. Merge pull request #77 from bettio/prepare-v1.2.0-dev

    Prepare next dev cycle (v1.2.0-dev)
    Annopaolo authored Jun 22, 2023
    Copy the full SHA
    49cdfb8 View commit details

Commits on Aug 28, 2023

  1. Update astarte core deps

    astarte_core and astarte_rpc
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Aug 28, 2023
    Copy the full SHA
    0beca12 View commit details

Commits on Aug 31, 2023

  1. Connect to Astarte database

    The plugin has now access to the Astarte database. Relevant
    environment variables for Cassandra connection have been added:
    - `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__NODES` (default: "localhost:9042")
    - `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__USERNAME` (default: "cassandra")
    - `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__PASSWORD` (default: "cassandra")
    - `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__POOL_SIZE` (default: 1)
    - `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__SSL_ENABLED` (default: false)
    - `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__SSL_DISABLE_SNI`(default: true)
    - `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__SSL_CUSTOM_SNI`
    - `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__SSL_CA_FILE`
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Aug 31, 2023
    Copy the full SHA
    e8919ed View commit details

Commits on Sep 8, 2023

  1. Add relevant queries for device status

    In order to allow device deletion, its status
    must be retrieved: devices under deletion may
    not reconnect.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Sep 8, 2023
    Copy the full SHA
    19048c2 View commit details
  2. Support device deletion

    When a device is being deleted, it is also disconnected.
    Disconnection due to deletion is required via RPC from
    DataUpdaterPlant. After the device has been disconnected,
    the broker sends a message on the internal `"/f"` (for
    "farewell") topic to signal that the emission of messages
    from the device has ended. Then, the deletion ack for
    the device is written to database.
    A device under deletion cannot be allowed to reconnect
    until deletion is completed. This is made sure by
    checking the database in the `auth_on_register` plugin
    hook.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Sep 8, 2023
    Copy the full SHA
    968c384 View commit details
  3. Copy the full SHA
    928bf40 View commit details
  4. CI: Add database to test workflow

    The plugin now requires a connection to Astarte's database.
    Include it in the testing workflow.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Sep 8, 2023
    Copy the full SHA
    86c9195 View commit details

Commits on Oct 5, 2023

  1. Merge pull request #75 from Annopaolo/delete-device

    Support device deletion
    rbino authored Oct 5, 2023
    Copy the full SHA
    e5f4eb1 View commit details

Commits on Nov 22, 2023

  1. Update Elixir to 1.15

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 22, 2023
    Copy the full SHA
    9518e73 View commit details
  2. Workflows: use Elixir 1.15 in build workflow

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 22, 2023
    Copy the full SHA
    e132171 View commit details
  3. Charlists: write them in an Elixir 1.15-compatible way

    `mix format` now requires charlists to be written as `~c"charlist"`
    instead of `'charlist'`. Fix accordingly.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 22, 2023
    Copy the full SHA
    da0eb7e View commit details
  4. Update dependencies

    - Update Astarte dependencies (astarte_core, astarte_rpc)
      to latest master version
    - Update ssl_verify_fun to 1.1.17 to make it compatible
      with Elixir 1.15
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 22, 2023
    Copy the full SHA
    6a800a8 View commit details
  5. Merge pull request #82 from Annopaolo/update_elixir_deps

    Update Elixir and dependencies
    bettio authored Nov 22, 2023
    Copy the full SHA
    def7641 View commit details
  6. Replace dialyzex with dialyxir

    Use a more popular gradual typing tool, with better error messages.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 22, 2023
    Copy the full SHA
    7849629 View commit details
  7. Workflows: fix cache dir in build GH workflow

    The PLT cache directory was not created when cache miss, failing the dialyzer task.
    Create it.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 22, 2023
    Copy the full SHA
    bf8509f View commit details
  8. Update OTP to 26

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 22, 2023
    Copy the full SHA
    c849e4c View commit details
  9. Update OTP to 26 in Dockerfile

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 22, 2023
    Copy the full SHA
    3401874 View commit details

Commits on Nov 24, 2023

  1. Merge pull request #83 from Annopaolo/dialyxir-ditches-dialyzex

    Update Dialyzer tool
    bettio authored Nov 24, 2023
    Copy the full SHA
    7430dc1 View commit details

Commits on Nov 30, 2023

  1. Update dependencies (amqp, astarte_rpc) to handle OTP 26

    Moreover, remove lager dependency as it is no more required by amqp_common.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 30, 2023
    Copy the full SHA
    148fde8 View commit details
  2. Dockerfile: build on VerneMQ master

    It supports OTP 26.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 30, 2023
    Copy the full SHA
    ca8d6f1 View commit details
  3. GH Workflows: use OTP 26

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 30, 2023
    Copy the full SHA
    74f8f29 View commit details
  4. Update CHANGELOG.md

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Nov 30, 2023
    Copy the full SHA
    3ac6fd6 View commit details

Commits on Dec 1, 2023

  1. Merge pull request #84 from Annopaolo/otp-26

    Update Erlang/OTP to 26
    rbino authored Dec 1, 2023
    Copy the full SHA
    a9e33b4 View commit details

Commits on Apr 17, 2024

  1. Add Keyspace integration

    Edit current implementation in order to add keyspace differentation from env param
    Add new env param  to .schema file
    
    Signed-off-by: Eddy Babetto <eddy.babetto@secomind.com>
    eddbbt committed Apr 17, 2024
    Copy the full SHA
    d7e1682 View commit details
  2. Edit changelog

    Edit changelog with new env and queries edit
    
    Signed-off-by: Eddy Babetto <eddy.babetto@secomind.com>
    eddbbt committed Apr 17, 2024
    Copy the full SHA
    5fa19f6 View commit details
  3. Update astarte_core dependency

    Update astarte_core dependency with new realm_to_keysapce translation
    
    Signed-off-by: Eddy Babetto <eddy.babetto@secomind.com>
    eddbbt committed Apr 17, 2024
    Copy the full SHA
    18e67df View commit details
  4. Merge pull request #85 from eddbbt/keyspaces_edit

    Queries edit for keyspace separation feature
    Annopaolo authored Apr 17, 2024
    Copy the full SHA
    90859cb View commit details

Commits on Apr 18, 2024

  1. Update astarte_core dep

    mix deps.update astarte_core
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Apr 18, 2024
    Copy the full SHA
    8cb7cd5 View commit details
  2. Prepare v1.0.6 release

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Apr 18, 2024
    Copy the full SHA
    f522147 View commit details
  3. Merge pull request #86 from Annopaolo/prepare-v1.0.6

    Prepare v1.0.6 release
    rbino authored Apr 18, 2024
    Copy the full SHA
    11a0d7c View commit details

Commits on Apr 24, 2024

  1. Update CAstore to 1.0.x

    Bring in the new CAstore version as required by astarte_rpc
    
    mix deps.update astarte_rpc castore
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Apr 24, 2024
    Copy the full SHA
    46392ce View commit details
  2. Merge pull request #87 from Annopaolo/new-beaver

    Update CAstore to 1.0.x
    rbino authored Apr 24, 2024
    Copy the full SHA
    5e0a063 View commit details

Commits on May 28, 2024

  1. Copy the full SHA
    f0602fa View commit details
  2. Merge pull request #88 from eddbbt/fwport-1.1

    Forward-port changes from release-1.0
    Annopaolo authored May 28, 2024
    Copy the full SHA
    2c9c017 View commit details
  3. Copy the full SHA
    ee83b02 View commit details
  4. Merge pull request #89 from eddbbt/fwport-master

    Forward-port changes from release-1.1 to master
    Annopaolo authored May 28, 2024
    Copy the full SHA
    df9326a View commit details

Commits on Jul 18, 2024

  1. Workflows: add build and push to Dockerhub workflow

    Standardize the image publishing workflows to use Github
    rather than Dockerhub CI.
    
    For all details, see astarte-platform/astarte#960.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Jul 18, 2024
    Copy the full SHA
    f0b3b2b View commit details

Commits on Aug 14, 2024

  1. Add Mississippi dependency

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Aug 14, 2024
    Copy the full SHA
    7159bf8 View commit details

Commits on Oct 22, 2024

  1. AMQP publish: use Mississippi

    Replace the old messy AMQP code.
    The sharding key is now included (as a binary header)
    in the message, according to Mississippi best practices.
    
    This change is retrocompatible.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Oct 22, 2024
    Copy the full SHA
    f01cbfb View commit details

Commits on Oct 30, 2024

  1. Merge pull request #94 from Annopaolo/mississippi-vmq-dup

     Move AMQP publish logic to Mississippi
    rbino authored Oct 30, 2024
    Copy the full SHA
    9ca4d04 View commit details

Commits on Dec 12, 2024

  1. Logs: use logfmt

    Show logs in logfmt format (now you can use humanlog,
    and even see the date of a log line, wohooo).
    Moreover, make sure via a runtime configuration that
    displayed logs are only from level info or higher.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Dec 12, 2024
    Copy the full SHA
    2ebbe2b View commit details

Commits on Dec 19, 2024

  1. Move to VerneMQ 2.0.1

    The most significant change is the update of Dockerfile
    and related scripts.
    The reference used is v2.0.1 of vernemq/docker-vernemq
    (see https://github.com/vernemq/docker-vernemq/tree/2.0.1).
    This is mostly a verbatim copy.
    Some outdated configuration params have been removed from
    vernemq.conf.
    
    Similar to what previously done, we build both our plugin
    and VerneMQ and then put them together in the image.
    We're still using root as user.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Dec 19, 2024
    Copy the full SHA
    9be7913 View commit details
  2. Add support for tls on 8883, again

    The v2.0.1 vernemq.sh script did not expose
    port 8883 for mqtts. Bring it back.
    
    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Dec 19, 2024
    Copy the full SHA
    97fb465 View commit details
  3. Use the same vm.args as VErneMQ 2.0.1.

    Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
    Annopaolo committed Dec 19, 2024
    Copy the full SHA
    9bfb267 View commit details

Commits on Jan 11, 2025

  1. Merge pull request #95 from Annopaolo/logfmt

    Logs: use logfmt
    Annopaolo authored Jan 11, 2025
    Copy the full SHA
    ca63667 View commit details

Commits on Jan 14, 2025

  1. Merge pull request #93 from Annopaolo/revamp-ci

    Workflows: add build and push to Dockerhub workflow
    davidebriani authored Jan 14, 2025
    Copy the full SHA
    260392a View commit details
  2. Merge pull request #96 from Annopaolo/when-im-in-a-2-competition-and-…

    …my-opponent-is-vernemq
    
    Update VerneMQ to 2.0.1
    davidebriani authored Jan 14, 2025
    Copy the full SHA
    43e3bcb View commit details
24 changes: 21 additions & 3 deletions .github/workflows/build-workflow.yaml
Original file line number Diff line number Diff line change
@@ -10,10 +10,12 @@ on:
create:
# Run on pull requests
pull_request:
# Allow this workflow to be called by others
workflow_call:

env:
elixir_version: "1.14.5"
otp_version: "25.3.2"
elixir_version: "1.15.7"
otp_version: "26.1"

jobs:
test-dialyzer:
@@ -33,7 +35,8 @@ jobs:
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v1
- id: plt_cache
uses: actions/cache@v1
with:
path: dialyzer_cache
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-dialyzer_cache-${{ github.sha }}
@@ -45,6 +48,9 @@ jobs:
elixir-version: ${{ env.elixir_version }}
- name: Install Dependencies
run: mix deps.get
- name: Create PLTs dir
if: ${{steps.plt_cache.outputs.cache-hit != 'true'}}
run: mkdir -p dialyzer_cache && mix dialyzer --plt
- name: Run dialyzer
# FIXME: This should be set to fail when dialyzer issues are fixed
run: mix dialyzer || exit 0
@@ -60,15 +66,23 @@ jobs:
matrix:
rabbitmq:
- "rabbitmq:3.12.0-management"
database:
- "cassandra:3.11.15"
- "scylladb/scylla:5.2.2"
services:
rabbitmq:
image: ${{ matrix.rabbitmq }}
ports:
- 5672:5672
- 15672:15672
database:
image: ${{ matrix.database }}
ports:
- 9042:9042
env:
MIX_ENV: test
RABBITMQ_HOST: localhost
CASSANDRA_NODES: localhost
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
@@ -93,6 +107,10 @@ jobs:
run: mix format --check-formatted
- name: Compile
run: mix do compile
- name: Wait for Cassandra
run: |
npm install -g wait-for-cassandra
wait-for-cassandra -T 120000 -h $CASSANDRA_NODES
- name: Test and Coverage
run: mix coveralls.json --exclude wip -o coverage_results
- name: Upload Coverage Results to CodeCov
58 changes: 58 additions & 0 deletions .github/workflows/publish-release-to-dockerhub-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Publish Docker images

on:
release:
types: [published]

jobs:
build_and_test:
uses: ./.github/workflows/build-workflow.yaml
secrets: inherit

push_release_to_registry:
name: Push Docker images to Docker Hub
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
attestations: write
id-token: write
strategy:
fail-fast: true
needs:
- build_and_test
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
astarte/vernemq
tags: |
type=semver,pattern={{version}}
- name: Build and push tagged Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
70 changes: 70 additions & 0 deletions .github/workflows/publish-snapshot-to-dockerhub-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Publish snapshot Docker images

on:
push:
paths:
- '.github/workflows/publish-snapshot-to-dockerhub-workflow.yaml'
- 'Dockerfile'
branches:
- 'master'
- 'release-*'

jobs:
build_and_test:
uses: ./.github/workflows/build-workflow.yaml
secrets: inherit

push_snapshot_to_registry:
name: Push Docker images to Docker Hub
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
attestations: write
id-token: write
strategy:
fail-fast: true
needs:
- build_and_test
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Compute tag name for snapshot images
id: compute-tag
run: |
export TAG="$(echo ${{ github.ref }} | sed 's,refs/heads/,,' | sed 's/master/snapshot/g' | sed 's/release-\(.*\)/\1-snapshot/g' )"
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
astarte/vernemq
tags: |
# TODO we probably want something smarter, but the 'pattern' type runs only on tags at the moment
type=raw,value=${{ steps.compute-tag.outputs.TAG }}
- name: Build and push tagged Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.14.5-otp-25
erlang 25.3.2
elixir 1.15.7-otp-26
erlang 26.1
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,39 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- The plugin now accesses the Astarte database. The following
env variables have been added:
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__NODES`
(defaults to `localhost:9042`)
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__USERNAME`
(defaults to `cassandra`)
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__PASSWORD`
(defaults to `cassandra`)
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__POOL_SIZE`
(defaults to 10)
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__SSL_ENABLED`
(defaults to `false`)
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__SSL_DISABLE_SNI`
(defaults to `true`)
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__SSL_CUSTOM_SNI`
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__CASSANDRA__SSL_CA_FILE`
- Added support for device deletion. During deletion, a device is
disconnected and not allowed to reconnect until deletion ends.
Inflight messages are discarded. After deletion, a device must be
registered again in order to connect to Astarte.
- Added support for multiple Astarte instances sharing the same database,
the following env variable has been added:
- `DOCKER_VERNEMQ_ASTARTE_VMQ_PLUGIN__ASTARTE_INSTANCE_ID`
(defaults to ``)
- Added support for `capabilities` message topic at `/<realm name>/<device name>/capabilities`

### Changed
- Update Elixir to 1.15.7.
- Update Erlang/OTP to 26.1.
- Update VerneMQ to master (1cc57fa) to support OTP 26.

## [1.1.1] - 2023-10-03

## [1.1.0] - 2023-06-20
@@ -18,6 +51,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Correctly serialize disconnection/reconnection events if VerneMQ hooks are called in
the wrong order. Fix https://github.com/astarte-platform/astarte/issues/668.

## [1.0.6] - 2024-04-18

## [1.0.5] - 2023-09-25

## [1.0.4] - 2022-09-26
70 changes: 38 additions & 32 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM hexpm/elixir:1.14.5-erlang-25.3.2-debian-bullseye-20230522-slim as builder
FROM --platform=${BUILDPLATFORM} hexpm/elixir:1.15.5-erlang-26.1-debian-bullseye-20230612-slim AS builder

# install build dependencies
# --allow-releaseinfo-change allows to pull from 'oldstable'
@@ -8,13 +8,15 @@ RUN apt-get update --allow-releaseinfo-change -y \

WORKDIR /build

# Needed for VerneMQ 1.13.0
# TODO check if it's still needed for VerneMQ 2.0.1
RUN apt-get -qq update && apt-get -qq install libsnappy-dev libssl-dev

# Let's start by building VerneMQ
RUN git clone https://github.com/vernemq/vernemq.git -b 1.13.0
RUN git clone https://github.com/vernemq/vernemq.git

RUN cd vernemq && \
# Check out latest master
git checkout -b v2.0.1 && \
make rel && \
cd ..

@@ -48,53 +50,57 @@ RUN cp astarte_vmq_plugin/priv/astarte_vmq_plugin.schema vernemq/_build/default/

# Copy configuration files here - mainly because we want to keep the target image as small as possible
# and avoid useless layers.
COPY docker/files/vm.args /build/vernemq/_build/default/rel/vernemq/etc/
COPY docker/files/vernemq.conf /build/vernemq/_build/default/rel/vernemq/etc/
COPY docker/bin/rand_cluster_node.escript /build/vernemq/_build/default/rel/vernemq/bin/
COPY docker/bin/vernemq.sh /build/vernemq/_build/default/rel/vernemq/bin/
RUN chmod +x /build/vernemq/_build/default/rel/vernemq/bin/vernemq.sh
COPY docker/files/vm.args vernemq/_build/default/rel/vernemq/etc/
COPY docker/files/vernemq.conf vernemq/_build/default/rel/vernemq/etc/
COPY docker/bin/rand_cluster_node.escript vernemq/_build/default/rel/vernemq/bin/

# Note: it is important to keep Debian versions in sync, or incompatibilities between libcrypto will happen
FROM debian:bullseye-slim
FROM --platform=${BUILDPLATFORM} debian:bullseye-slim

# Set the locale
ENV LANG C.UTF-8

# We have to redefine this here since it goes out of scope for each build stage
ARG BUILD_ENV=prod

# Install some VerneMQ scripts dependencies
RUN apt-get -qq update && apt-get -qq install bash procps openssl iproute2 curl jq libsnappy-dev net-tools nano

# We need SSL, curl, iproute2 and jq - and to ensure /etc/ssl/astarte
RUN apt-get -qq update && apt-get -qq install libssl1.1 curl jq iproute2 netcat libsnappy1v5 && apt-get clean && mkdir -p /etc/ssl/astarte
# TODO some of these might not be needed anymore
RUN apt-get -qq update && apt-get -qq install libssl1.1 curl jq iproute2 netcat && apt-get clean && mkdir -p /etc/ssl/astarte

# Copy our built stuff (both are self-contained with their ERTS release)
COPY --from=builder /build/vernemq/_build/default/rel/vernemq /opt/vernemq/
COPY --from=builder /build/astarte_vmq_plugin/_build/$BUILD_ENV/rel/astarte_vmq_plugin /opt/astarte_vmq_plugin/
ENV PATH="/opt/vernemq/bin:$PATH"

# Add the wait-for utility
RUN cd /usr/bin && curl -O https://raw.githubusercontent.com/eficode/wait-for/master/wait-for && chmod +x wait-for && cd -
COPY --from=builder /build/astarte_vmq_plugin/docker/bin/vernemq.sh /usr/sbin/start_vernemq
COPY --from=builder /build/astarte_vmq_plugin/docker/bin/join_cluster.sh /usr/sbin/join_cluster

# MQTT
EXPOSE 1883
RUN chmod +x /usr/sbin/start_vernemq
RUN chmod +x /usr/sbin/join_cluster

# MQTT for Reverse Proxy
EXPOSE 1885
# Copy our built stuff (both are self-contained with their ERTS release)
COPY --from=builder /build/vernemq/_build/default/rel/vernemq /opt/vernemq/

# MQTT/SSL
EXPOSE 8883
RUN ln -s /opt/vernemq/etc /etc/vernemq && \
ln -s /opt/vernemq/data /var/lib/vernemq && \
ln -s /opt/vernemq/log /var/log/vernemq

# VerneMQ Message Distribution
EXPOSE 44053
COPY --from=builder /build/astarte_vmq_plugin/_build/$BUILD_ENV/rel/astarte_vmq_plugin /opt/astarte_vmq_plugin/

# EPMD - Erlang Port Mapper Daemon
EXPOSE 4369
# Ports
# 1883 MQTT
# 8883 MQTT/SSL
# 8080 MQTT WebSockets
# 44053 VerneMQ Message Distribution
# 4369 EPMD - Erlang Port Mapper Daemon
# 8888 Health, API, Prometheus Metrics
# 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 Specific Distributed Erlang Port Range

# Specific Distributed Erlang Port Range
EXPOSE 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109
EXPOSE 1883 8883 8080 44053 4369 8888 \
9100 9101 9102 9103 9104 9105 9106 9107 9108 9109

# Prometheus Metrics
EXPOSE 8888
VOLUME ["/opt/vernemq/log", "/opt/vernemq/data", "/opt/vernemq/etc"]

# Expose port for webroot ACME verification (in case)
EXPOSE 80
HEALTHCHECK CMD vernemq ping | grep -q pong

CMD ["/opt/vernemq/bin/vernemq.sh"]
CMD ["start_vernemq"]
3 changes: 0 additions & 3 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -20,7 +20,4 @@
# and its dependencies with the aid of the Mix.Config module.
import Config

config :lager,
handlers: [level: :critical]

import_config "#{config_env()}.exs"
11 changes: 1 addition & 10 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This file is part of Astarte.
#
# Copyright 2017 Ispirata Srl
# Copyright 2017 - 2023 SECO Mind Srl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,17 +18,8 @@

import Config

# lager is used by rabbit_common.
# Silent it by setting the higher loglevel.
config :lager,
error_logger_redirect: false,
handlers: [level: :critical]

config :astarte_vmq_plugin, :amqp_options, host: System.get_env("RABBITMQ_HOST") || "rabbitmq"

# make amqp supervisors logs less verbose
config :logger, handle_otp_reports: false

config :logger, :console,
format: {PrettyLog.UserFriendlyFormatter, :format},
metadata: [:function]
Loading