Skip to content

Commit

Permalink
Merge tag 'v2.2.1' into develop
Browse files Browse the repository at this point in the history
Updated docker use and fixed submodule versions conflicts
  • Loading branch information
nsoblath committed May 3, 2024
2 parents 5955411 + 921f597 commit 063f528
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 32 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Test and Publish
name: Build and Publish

on:
pull_request:
Expand Down Expand Up @@ -36,15 +36,15 @@ jobs:
steps:

- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
# Need to avoid a shallow clone (fetch-depth=1) so that the lookup of the tag works
fetch-depth: 0

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
flavor: |
Expand All @@ -63,24 +63,24 @@ jobs:
fallback: beta

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

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

- name: Log in to the Container registry
uses: docker/login-action@v2
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@v3
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
Expand All @@ -95,5 +95,5 @@ jobs:
platforms: linux/amd64

- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 3.12)

# Define the project
cmake_policy( SET CMP0048 NEW ) # version in project()
project( Psyllid VERSION 2.2.0 )
project( Psyllid VERSION 2.2.1 )

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/sandfly/cmake )
include( sandfly )
Expand Down
9 changes: 1 addition & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@ RUN apt-get update &&\
rm -rf /var/lib/apt/lists/* &&\
/bin/true

COPY external /tmp_source/external
COPY monarch /tmp_source/monarch
COPY sandfly /tmp_source/sandfly
COPY source /tmp_source/source
COPY CMakeLists.txt /tmp_source/CMakeLists.txt
COPY .git /tmp_source/.git
COPY .gitmodules /tmp_source/.gitmodules
COPY PsyllidConfig.cmake.in /tmp_source/PsyllidConfig.cmake.in
COPY . /tmp_source

## store cmake args because we'll need to run twice (known package_builder issue)
## use `extra_cmake_args` to add or replace options at build time; CMAKE_CONFIG_ARGS_LIST are defaults
Expand Down
12 changes: 0 additions & 12 deletions broker-in-docker/docker-compose.yaml

This file was deleted.

42 changes: 42 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Docker directory

## Broker in a container

If you'd like to run Psyllid on your host machine but use Docker to run the RabbitMQ broker, use the `docker-compose-broker.yaml` file. It will start a broker in a container and expose to the host the ports 5672 (for sending and receiving AMQP messages) and 15672 (for accessing the web GUI).

First start the broker in one terminal (or use `-d` to start as a daemon):

> docker compose -f docker-compose-broker.yaml up

From the host the broker will be accessible at `localhost:5672`. Next you'll start Psyllid:

> /path/to/psyllid --auth-file authentications.json -c ../examples/fmt_1ch_socket.yaml

You'll need to use your host's copy of `dl-agent` to interact with Psyllid:

> /path/to/dl-agent --auth-file authentications.json cmd psyllid ...

## Everything in containers

If you'd like to run Psyllid in a container in addition to RabbitMQ running in a container, use the `docker-compose-full.yaml` file. It will first start a broker, then start Psyllid.

You can use the environment variable `IMG_TAG` to set the container tag for Psyllid. The full container specification used will be `ghcr.io/project8/psyllid:${IMG_TAG}`. If that variable isn't set, `latest` will be used as the default.

You can specify the configuration file used with the `PSYLLID_CONFIG` environment variable. The `examples` directory is mounted into the container at `/configs`, so you can use anything in that directory without modifying the compose file. If you want to use another file, you can add it to the `examples` directory or you can modify the compose file to mount that config file into the container. You'll need to specify the full path to the config file in `PSYLLID_CONFIG`.

The Psyllid container will use the healthcheck for the broker to ensure that the broker is available for connections before it starts.

You can start everything with:

> docker compose -f docker-compose-full.yaml up

You can prepend that command with an environment variable setting if you want it to apply just to the command you're running:

> IMG_TAG=my_tag docker compose -f docker-compose-full.yaml up

Side note: the `psyllid` command in `docker-compose-full.yaml` overrides the broker specification to set it to be `rabbit-broker`. This is because the auth file and the example config file both set the broker to `localhost` (side-side note: the config file overrides the auth file, but the command line overrides both of them).

You'll need to use `dl-agent` to control Psyllid. This can be done from the host since port 5672 of the broker container is exposed to the host, or by using `docker exec` to get a command-line prompt in the Psyllid container:

> docker exec -it docker-psyllid-1 bash

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"amqp": {
"host": "rabbit_broker",
"broker": "localhost",
"username": "guest",
"password": "guest"
}
Expand Down
11 changes: 11 additions & 0 deletions docker/docker-compose-broker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This compose file lauches a RabbitMQ broker with both the HTTP port (15672) and the broker communication port (5672) mapped to the host.
# Use this file if you want to run Psyllid on the host with a broker running in a container.

services:
# a rabbit broker
rabbit-broker:
image: rabbitmq:3-management
ports:
- "5672:5672"
- "15672:15672"

30 changes: 30 additions & 0 deletions docker/docker-compose-full.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This compose file lauches a RabbitMQ broker with both the HTTP port (15672) and the broker communication port (5672) mapped to the host.
# Use this file if you want to run Psyllid on the host with a broker running in a container.

services:
# a rabbit broker
rabbit-broker:
image: rabbitmq:3-management
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD-SHELL", "curl -u guest:guest http://rabbit-broker:15672/api/overview &> /dev/null || exit 1"]

psyllid:
image: ghcr.io/project8/psyllid:${IMG_TAG:-latest}
depends_on:
rabbit-broker:
condition: service_healthy
volumes:
- ../examples:/configs
command: >
bash -c "psyllid -vv --auth-file /auths.json -c ${PSYLLID_CONFIG:-/configs/fmt_1ch_socket.yaml} dripline.broker=rabbit-broker"
configs:
- auths.json

configs:
auths.json:
file: ./authentications.json


2 changes: 1 addition & 1 deletion monarch
Submodule monarch updated 2 files
+1 −1 CMakeLists.txt
+1 −1 Scarab
2 changes: 1 addition & 1 deletion sandfly

0 comments on commit 063f528

Please sign in to comment.