Skip to content

Commit

Permalink
Merge branch 'hotfix/2.8.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Oblath committed Jan 5, 2024
2 parents e14c412 + 9001032 commit ffab027
Show file tree
Hide file tree
Showing 12 changed files with 7,552 additions and 2,964 deletions.
111 changes: 40 additions & 71 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,33 @@ name: Publish
on:
push:
branches: [ main, develop ]
tags: ['v*.*.*']

tags: ['*']
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

workflow_dispatch:

env:
REGISTRY: docker.io
BASE_IMAGE_REPO: python
BASE_IMAGE_TAG: '3.8.7-buster'

# narg/NARG (number-of-CPU argument to pass to the builds) are based on OS-specific CPU counts in the GitHub-hosted GHA runners.
# checked 1/4/2024: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

jobs:

test_docker:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

env:
NARG: 2

# This job runs for all events that trigger this workflow

steps:

- name: Checkout the repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -38,6 +42,7 @@ jobs:
--build-arg build_type=Debug \
--build-arg build_examples=TRUE \
--build-arg enable_testing=TRUE \
--build-arg narg=${NARG} \
--tag driplineorg/dripline-cpp:test \
.
docker run driplineorg/dripline-cpp:test /usr/local/build/testing/run_tests
Expand All @@ -50,12 +55,18 @@ jobs:

strategy:
matrix:
os: [ubuntu-20.04, macos-10.15]
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
narg: 2
- os: macos-latest
narg: 3


steps:

- name: Checkout the repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down Expand Up @@ -87,7 +98,7 @@ jobs:
- name: Build
run: |
cd build
make -j2 install
make -j${{ matrix.narg }} install
- name: Run tests
run: |
Expand All @@ -96,7 +107,10 @@ jobs:
build_and_push:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

env:
NARG: 2

# This job runs on push (limited above to develop, main and tags) and pull_requests marked read_for_review
# Pushing images is limited below to push events
Expand Down Expand Up @@ -124,41 +138,46 @@ jobs:
steps:

- name: Checkout the repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: driplineorg/dripline-cpp
images: ${{ env.REGISTRY }}/${{ github.repository }}
flavor: |
latest=auto
suffix=${{ matrix.tag-suffix }},onlatest=true
tags: |
type=semver,pattern={{raw}}
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable=${{ github.ref == format('refs/heads{0}', 'main') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# for ghcr.io, use:
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: build_push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name == 'push' }} # limited to develop, main, and tags; don't push on PR
Expand All @@ -168,60 +187,10 @@ jobs:
build_type=${{ matrix.build-type }}
build_examples=${{ matrix.build-examples }}
enable_testing=${{ matrix.enable-testing }}
narg=${{env.NARG }}
tags: ${{ steps.docker_meta.outputs.tags }}
platforms: linux/amd64,linux/arm/v7,linux/arm64

docs:
runs-on: ubuntu-20.04
# This job only runs for pushed tags
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: [build_and_push]
steps:
- name: Checkout the repo
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
tree \
doxygen \
python3-sphinx \
graphviz
- name: Output location
run: |
export OUTPUT_LOCATION="unknown"
echo "Github ref: $GITHUB_REF"
if [[ $GITHUB_REF == refs/heads/develop ]]; then
echo "Branch is develop"
export OUTPUT_LOCATION=develop
elif [[ $GITHUB_REF == refs/heads/main ]]; then
echo "Branch is main"
export OUTPUT_LOCATION=main
elif [[ $GITHUB_REF == refs/heads/* ]]; then
suffix=${GITHUB_REF#"refs/heads/"}
suffix=$(echo $suffix | tr '/' '-')
echo "Branch is $GITHUB_REF; directory will be $suffix"
export OUTPUT_LOCATION=branches/$suffix
elif [[ $GITHUB_REF == refs/tags/* ]]; then
suffx=${GITHUB_REF#"refs/tags/"}
echo "Tag is $GITHUB_REF; directory will be $suffix"
export OUTPUT_LOCATION=tags/$suffix
fi
echo "Output location: $OUTPUT_LOCATION"
# Persist the output location in future steps
echo "OUTPUT_LOCATION=$OUTPUT_LOCATION" >> $GITHUB_ENV
- name: Build docs
run: |
cd documentation
make html
ls ./build/html
mv ./build/html /tmp/build.html
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: /tmp/build.html # The folder the action should deploy.
target-folder: ${{ env.OUTPUT_LOCATION }}
dry-run: false
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required (VERSION 3.12)
#########

cmake_policy( SET CMP0048 NEW ) # version in project()
project( Dripline VERSION 2.8.4 )
project( Dripline VERSION 2.8.7 )

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/scarab/cmake )

Expand All @@ -33,8 +33,8 @@ set ( Dripline_PYTHON_THROW_REPLY_KEYWORD "ThrowReply" CACHE STRING "Keyword use

set( Dripline_MAX_PAYLOAD_SIZE "10000" CACHE STRING "Maximum payload size (bytes)" )

# always use C++11
set( CMAKE_CXX_STANDARD 11 )
# always use C++17
set( CMAKE_CXX_STANDARD 17 )


# Process options
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FROM ${img_repo}:${img_tag}
ARG build_type=Release
ARG build_examples=FALSE
ARG enable_testing=FALSE
ARG narg=2

# Most dependencies

Expand Down Expand Up @@ -63,6 +64,6 @@ RUN mkdir -p /usr/local/build && \
-DDripline_BUILD_PYTHON:BOOL=TRUE \
-DPBUILDER_PY_INSTALL_IN_SITELIB=TRUE \
../src && \
make -j3 install
make -j${narg} install

# TODO: rm -rf /usr/local/src
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

This library is a C++ implementation of the [Dripline](http://driplineorg.github.io) protocol.

[![Run Tests](https://github.com/driplineorg/dripline-cpp/actions/workflows/run_tests.yaml/badge.svg)](https://github.com/driplineorg/dripline-cpp/actions/workflows/run_tests.yaml)
[![Build](https://github.com/driplineorg/dripline-cpp/actions/workflows/publish.yaml/badge.svg)](https://github.com/driplineorg/dripline-cpp/actions/workflows/publish.yaml)
![Docker Image Version (latest semver)](https://img.shields.io/docker/v/driplineorg/dripline-cpp?sort=semver)
![Dripline Protocol](https://img.shields.io/endpoint?color=blue&url=https%3A%2F%2Fraw.githubusercontent.com%2Fdriplineorg%2Fdripline-cpp%2Fmain%2Fdripline_shield.json)

## Documentation

* [Dripline](http://driplineorg.github.io)
* [Dripline-cpp](http://driplineorg.github.io/dripline-cpp)
* [Dripline-cpp](https://dripline-cpp.readthedocs.io/en/latest)
* [API](http://driplineorg.github.io/dripline-cpp/_static/index.html)
1 change: 1 addition & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ project( DriplineExternal VERSION 0.0.0 )
# SimpleAmqpClient
##################

option( BUILD_API_DOCS "" OFF )
add_subdirectory( SimpleAmqpClient )

# Because the SimpleAmqpClient CMake build doesn't take care of this stuff, we have to do it ourselves
Expand Down
2 changes: 1 addition & 1 deletion external/SimpleAmqpClient
Submodule SimpleAmqpClient updated 51 files
+86 −8 .clang-format
+11 −0 .devcontainer/Dockerfile
+12 −0 .devcontainer/base.Dockerfile
+35 −0 .devcontainer/devcontainer.json
+4 −0 .gitignore
+30 −33 .travis.yml
+51 −21 CMakeLists.txt
+22 −0 ChangeLog.md
+115 −1,336 Doxyfile.in
+0 −119 Modules/UseDoxygen.cmake
+4 −4 README.md
+4 −5 src/AmqpException.cpp
+1 −2 src/AmqpLibraryException.cpp
+1 −2 src/AmqpResponseLibraryException.cpp
+165 −312 src/BasicMessage.cpp
+420 −97 src/Channel.cpp
+139 −63 src/ChannelImpl.cpp
+1 −1 src/Envelope.cpp
+248 −3 src/SimpleAmqpClient/AmqpException.h
+19 −2 src/SimpleAmqpClient/AmqpLibraryException.h
+10 −2 src/SimpleAmqpClient/AmqpResponseLibraryException.h
+7 −1 src/SimpleAmqpClient/BadUriException.h
+173 −196 src/SimpleAmqpClient/BasicMessage.h
+26 −0 src/SimpleAmqpClient/Bytes.h
+654 −556 src/SimpleAmqpClient/Channel.h
+7 −7 src/SimpleAmqpClient/ChannelImpl.h
+11 −1 src/SimpleAmqpClient/ConnectionClosedException.h
+17 −1 src/SimpleAmqpClient/ConsumerCancelledException.h
+12 −2 src/SimpleAmqpClient/ConsumerTagNotFoundException.h
+87 −47 src/SimpleAmqpClient/Envelope.h
+70 −0 src/SimpleAmqpClient/MessageRejectedException.h
+12 −3 src/SimpleAmqpClient/MessageReturnedException.h
+7 −0 src/SimpleAmqpClient/SimpleAmqpClient.h
+75 −54 src/SimpleAmqpClient/Table.h
+3 −3 src/SimpleAmqpClient/TableImpl.h
+8 −0 src/SimpleAmqpClient/Util.h
+1 −1 src/SimpleAmqpClient/Version.h
+15 −18 src/Table.cpp
+7 −8 src/TableImpl.cpp
+8 −1 testing/connected_test.h
+1 −0 testing/test_ack.cpp
+10 −6 testing/test_channels.cpp
+63 −1 testing/test_connect.cpp
+1 −0 testing/test_consume.cpp
+11 −12 testing/test_exchange.cpp
+3 −2 testing/test_get.cpp
+3 −14 testing/test_message.cpp
+1 −0 testing/test_nack.cpp
+3 −20 testing/test_publish.cpp
+9 −10 testing/test_queue.cpp
+45 −90 testing/test_table.cpp
5 changes: 1 addition & 4 deletions library/amqp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ namespace dripline
case TableValue::ValueType::VT_uint32:
return scarab::param_ptr_t( new scarab::param_value( a_value.GetUint32() ) );
break;
case TableValue::ValueType::VT_uint64:
return scarab::param_ptr_t( new scarab::param_value( a_value.GetUint64() ) );
break;
default:
throw std::domain_error( "Invalid SimpleAMQPClient TableValue type" );
}
Expand Down Expand Up @@ -115,7 +112,7 @@ namespace dripline
{
if( a_value.is_bool() ) return AmqpClient::TableValue( a_value.as_bool() );
if( a_value.is_int() ) return AmqpClient::TableValue( a_value.as_int() );
if( a_value.is_uint() ) return AmqpClient::TableValue( a_value.as_uint() );
if( a_value.is_uint() ) return AmqpClient::TableValue( (uint32_t)a_value.as_uint() );
if( a_value.is_double() ) return AmqpClient::TableValue( a_value.as_double() );
if( a_value.is_string() ) return AmqpClient::TableValue( a_value.as_string() );
throw std::domain_error( "Invalid param value type" );
Expand Down
6 changes: 5 additions & 1 deletion library/core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,11 @@ namespace dripline
{
LDEBUG( dlog, "Opening AMQP connection and creating channel to " << f_address << ":" << f_port );
LDEBUG( dlog, "Using broker authentication: " << f_username << ":" << f_password );
return AmqpClient::Channel::Create( f_address, f_port, f_username, f_password );
struct AmqpClient::Channel::OpenOpts opts;
opts.host = f_address;
opts.port = f_port;
opts.auth = AmqpClient::Channel::OpenOpts::BasicAuth(f_username, f_password);
return AmqpClient::Channel::Open( opts );
}
catch( amqp_exception& e )
{
Expand Down
4 changes: 2 additions & 2 deletions library/dripline_exceptions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace dripline
It should be used in the manner of any typical C++ exception, whenever the current
function doesn't know how to handle a problem it encounters.
*/
class DRIPLINE_API dripline_error : public scarab::base_exception< dripline_error >
class DRIPLINE_API dripline_error : public scarab::typed_exception< dripline_error >
{
public:
dripline_error() = default;
Expand All @@ -40,7 +40,7 @@ namespace dripline
@author N.S. Oblath
@brief Error indicating a problem with the connection to the broker
*/
class DRIPLINE_API connection_error : public scarab::base_exception< connection_error >
class DRIPLINE_API connection_error : public scarab::typed_exception< connection_error >
{
public:
connection_error() = default;
Expand Down
Loading

0 comments on commit ffab027

Please sign in to comment.