Skip to content

Commit

Permalink
python-modules,docker,ci: move webhook() source to python-modules
Browse files Browse the repository at this point in the history
Signed-off-by: László Várady <[email protected]>
  • Loading branch information
MrAnno committed May 18, 2024
1 parent ab27946 commit 35ea41f
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 72 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/axosyslog-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
tarball-artifact:
required: false
type: string
axosyslog-modules-artifact:
required: true
type: string
snapshot-version:
required: false
type: string
Expand All @@ -37,12 +34,6 @@ jobs:
name: ${{ inputs.tarball-artifact }}
path: docker/apkbuild/axoflow/axosyslog

- name: Download axosyslog-modules tarball artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.axosyslog-modules-artifact }}
path: docker/apkbuild/axoflow/axosyslog

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand Down
32 changes: 2 additions & 30 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,9 @@ jobs:
# with:
# pkg-type: nightly

axosyslog-modules:
name: axosyslog-modules
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Create AxoSyslog modules tarball
working-directory: docker
run: |
tar -czvf python-modules.tar.gz python-modules/
- name: Store axosyslog-modules tarball as artifact
uses: actions/upload-artifact@v4
with:
name: axosyslog-modules-tarball
path: docker/python-modules.tar.gz

build-and-test:
runs-on: ubuntu-latest
needs:
- tarball
- axosyslog-modules
needs: tarball
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand All @@ -102,12 +82,6 @@ jobs:
name: source-tarball
path: docker/apkbuild/axoflow/axosyslog

- name: Download axosyslog-modules tarball artifact
uses: actions/download-artifact@v4
with:
name: axosyslog-modules-tarball
path: docker/apkbuild/axoflow/axosyslog

- name: Build Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -125,15 +99,13 @@ jobs:
export SYSLOG_NG_VERSION="${{ needs.tarball.outputs.snapshot-version }}"
docker/tests/smoke.sh
publish-image:
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/axosyslog-docker.yml
needs: [tarball, build-and-test, axosyslog-modules]
needs: [tarball, build-and-test]
with:
pkg-type: nightly
tarball-artifact: source-tarball
axosyslog-modules-artifact: axosyslog-modules-tarball
snapshot-version: ${{ needs.tarball.outputs.snapshot-version }}

# https://github.com/actions/delete-package-versions/issues/90
Expand Down
23 changes: 1 addition & 22 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,8 @@ jobs:
# with:
# pkg-type: stable

# TODO integrate axosyslog-modules with the source tree and remove this
axosyslog-modules:
name: axosyslog-modules
needs: find-draft-release-run
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Create AxoSyslog modules tarball
working-directory: docker
run: |
tar -czvf python-modules.tar.gz python-modules/
- name: Store axosyslog-modules tarball as artifact
uses: actions/upload-artifact@v4
with:
name: axosyslog-modules-tarball
path: docker/python-modules.tar.gz

publish-image:
uses: ./.github/workflows/axosyslog-docker.yml
needs: axosyslog-modules
needs: find-draft-release-run
with:
pkg-type: stable
axosyslog-modules-artifact: axosyslog-modules-tarball
4 changes: 0 additions & 4 deletions docker/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
EXTRA_DIST += \
docker/python-modules/webhook/__init__.py \
docker/python-modules/webhook/scl/webhook.conf \
docker/python-modules/webhook/source.py \
docker/python-modules/requirements.txt \
docker/tests/smoke.sh \
docker/alpine.dockerfile \
docker/apkbuild/axoflow/rootbld-repositories \
Expand Down
5 changes: 0 additions & 5 deletions docker/apkbuild/axoflow/axosyslog/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ subpackages="
$pkgname-grpc:_grpc
"
source="https://github.com/axoflow/axosyslog/releases/download/axosyslog-$pkgver/axosyslog-$pkgver.tar.gz
python-modules.tar.gz
"
builddir="$srcdir/axosyslog-$pkgver"

Expand Down Expand Up @@ -147,9 +146,6 @@ _python3() {
depends="$pkgname=$pkgver-r$pkgrel python3"
install="$subpkgname.post-install"

cat $srcdir/python-modules/requirements.txt >> $pkgdir/usr/lib/syslog-ng/python/requirements.txt
rm $srcdir/python-modules/requirements.txt
mv $srcdir/python-modules/* $pkgdir/usr/lib/syslog-ng/python/syslogng/modules
_submv usr/lib/syslog-ng/libmod-python.so usr/lib/syslog-ng/python usr/bin/syslog-ng-update-virtualenv
}

Expand Down Expand Up @@ -179,5 +175,4 @@ _submv() {

sha512sums="
SKIP axosyslog-4.7.1.tar.gz
SKIP python-modules.tar.gz
"
2 changes: 1 addition & 1 deletion docker/apkbuild/axoflow/axosyslog/APKBUILD-debug.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
makedepends="
bison
bpftool
@@ -86,6 +86,7 @@
@@ -85,6 +85,7 @@
build() {
CFLAGS="$CFLAGS -flto=auto" \
./configure \
Expand Down
1 change: 0 additions & 1 deletion docker/python-modules/requirements.txt

This file was deleted.

3 changes: 3 additions & 0 deletions modules/python-modules/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ EXTRA_DIST += \
modules/python-modules/syslogng/modules/s3/s3_destination.py \
modules/python-modules/syslogng/modules/s3/s3_object.py \
modules/python-modules/syslogng/modules/s3/scl/s3.conf \
modules/python-modules/syslogng/modules/webhook/__init__.py \
modules/python-modules/syslogng/modules/webhook/scl/webhook.conf \
modules/python-modules/syslogng/modules/webhook/source.py \
modules/python-modules/syslogng/parser.py \
modules/python-modules/syslogng/persist.py \
modules/python-modules/syslogng/reloc.py \
Expand Down
3 changes: 3 additions & 0 deletions modules/python-modules/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"syslogng.modules.kubernetes",
"syslogng.modules.hypr",
"syslogng.modules.s3",
"syslogng.modules.webhook",
]

requires_addons=[
Expand All @@ -47,6 +48,8 @@
"requests",
# s3
"boto3",
# webhook
"tornado",
]

packages = packages_builtin
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ six==1.16.0
urllib3==1.26.18
websocket-client==1.3.1
ply==3.11
tornado==6.4

0 comments on commit 35ea41f

Please sign in to comment.