Skip to content

Commit

Permalink
Merge pull request #417 from neilcook/license
Browse files Browse the repository at this point in the history
Re-license threadname
  • Loading branch information
neilcook authored Jan 18, 2024
2 parents 03d519b + 69e7633 commit 7a6e45c
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pubtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Test Results

on:
workflow_run:
workflows: ["Run regression tests"]
workflows: ["Call reusable regression workflow"]
types:
- completed
permissions: {}
Expand Down
52 changes: 9 additions & 43 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 'Run regression tests'
name: 'Call reusable regression workflow'

on:
push:
Expand All @@ -8,45 +8,11 @@ on:
- cron: '0 22 * * 3'

jobs:
regression:
name: regression
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Install dependencies
run: sudo apt-get update && sudo apt-get -qq -y install gcc g++ cmake libboost-all-dev libcurl4-openssl-dev libgetdns-dev libhiredis-dev libmaxminddb-dev libluajit-5.1-dev libprotobuf-dev libreadline-dev libssl-dev libsodium-dev libsystemd-dev libyaml-cpp-dev libjsoncpp-dev uuid-dev libz-dev libtool pkg-config protobuf-compiler pandoc wget autoconf automake
- name: Download prometheus-cpp
run: git clone https://github.com/jupp0r/prometheus-cpp.git && cd prometheus-cpp && git checkout tags/v1.0.1 -b v1.0.1 && echo 'include(CPack)' >> CMakeLists.txt
- name: Build and Install prometheus-cpp
run: cd prometheus-cpp && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off -DENABLE_PUSH=off -DENABLE_COMPRESSION=off -DENABLE_TESTING=off -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_POSITION_INDEPENDENT_CODE=ON && make && sudo make install
- name: Download Drogon
run: git clone https://github.com/drogonframework/drogon.git && cd drogon && git checkout tags/v1.9.1 -b v1.9.1
- name: Build and Install Drogon
run: cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_ORM=OFF -DCMAKE_BUILD_TYPE=Release && make && sudo make install
- run: sudo sysctl -w vm.max_map_count=262144
- run: autoreconf -i
- run: ./configure --enable-trackalert
- run: cd docker && make regression
env:
MAXMIND_LICENSE_KEY: ${{ secrets.MAXMIND_LICENSE_KEY }}
- run: make dist
- run: make distcheck
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: |
docker/tmp/*.xml
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}
regression_clang:
uses: ./.github/workflows/regression_reusable.yml
with:
compiler: clang
regression_gcc:
uses: ./.github/workflows/regression_reusable.yml
with:
compiler: gcc
52 changes: 52 additions & 0 deletions .github/workflows/regression_reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: 'Run regression tests'

on:
workflow_call:
inputs:
compiler:
description: 'Compiler to use'
type: string
required: true

jobs:
run-regression:
name: regression-${{ inputs.compiler }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: recursive
- name: Install dependencies
run: sudo apt-get update && sudo apt-get -qq -y install gcc g++ cmake libboost-all-dev libcurl4-openssl-dev libgetdns-dev libhiredis-dev libmaxminddb-dev libluajit-5.1-dev libprotobuf-dev libreadline-dev libssl-dev libsodium-dev libsystemd-dev libyaml-cpp-dev libjsoncpp-dev uuid-dev libz-dev libtool pkg-config protobuf-compiler pandoc wget autoconf automake
- name: Download prometheus-cpp
run: git clone https://github.com/jupp0r/prometheus-cpp.git && cd prometheus-cpp && git checkout tags/v1.0.1 -b v1.0.1 && echo 'include(CPack)' >> CMakeLists.txt
- name: Build and Install prometheus-cpp
run: cd prometheus-cpp && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off -DENABLE_PUSH=off -DENABLE_COMPRESSION=off -DENABLE_TESTING=off -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_POSITION_INDEPENDENT_CODE=ON && make && sudo make install
- name: Download Drogon
run: git clone https://github.com/drogonframework/drogon.git && cd drogon && git checkout tags/v1.9.1 -b v1.9.1
- name: Build and Install Drogon
run: cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_ORM=OFF -DCMAKE_BUILD_TYPE=Release && make && sudo make install
- run: sudo sysctl -w vm.max_map_count=262144
- run: autoreconf -i
- run: ./configure --enable-trackalert
- run: cd docker && make regression-${{ inputs.compiler }}
- run: make dist
- run: make distcheck
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: |
docker/tmp/*.xml
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}
1 change: 1 addition & 0 deletions common/webhook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian_types.hpp>
#include <boost/format.hpp>
#include <thread>
#include "webhook.hh"
#include "dolog.hh"
#include "hmac.hh"
Expand Down
2 changes: 1 addition & 1 deletion common/webhook.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#pragma once
#include <mutex>
#include <curl/curl.h>
#include <condition_variable>
#include "json11.hpp"
#include "ext/ctpl.h"
#include "dolog.hh"
#include "minicurl.hh"
#include "prometheus.hh"
Expand Down
1 change: 0 additions & 1 deletion common/wforce-webserver.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "iputils.hh"
#include "sstuff.hh"
#include "sholder.hh"
#include "ext/ctpl.h"
#include "drogon/drogon.h"
#include "prometheus.hh"
#include "perf-stats.hh"
Expand Down
11 changes: 0 additions & 11 deletions docker/regression/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ RUN apt-get update && \
clang \
cmake

# Disable Ipv6 for redis
ARG MAXMIND_LICENSE_KEY
RUN wget -O GeoLite2-City.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${MAXMIND_LICENSE_KEY}&suffix=tar.gz" || true
RUN wget -O GeoLite2-Country.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${MAXMIND_LICENSE_KEY}&suffix=tar.gz" || true
RUN wget -O GeoLite2-ASN.mmdb.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=${MAXMIND_LICENSE_KEY}&suffix=tar.gz" || true
RUN gunzip GeoLite2-*.mmdb.tar.gz || true
RUN tar xvf GeoLite2-City.mmdb.tar || true
RUN tar xvf GeoLite2-Country.mmdb.tar || true
RUN tar xvf GeoLite2-ASN.mmdb.tar || true
RUN mv GeoLite2*/GeoLite2-*.mmdb /usr/share/GeoIP || true

RUN pip3 install bottle virtualenv

WORKDIR /wforce/
Expand Down
7 changes: 4 additions & 3 deletions ext/ext/threadname.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* This file is part of PowerDNS or dnsdist.
* This file is part of PowerDNS or weakforced.
* Copyright -- PowerDNS.COM B.V. and its contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* In addition, for the avoidance of any doubt, permission is granted to
* link this program with OpenSSL and to (re)distribute the binaries
Expand Down
7 changes: 4 additions & 3 deletions ext/ext/threadname.hh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* This file is part of PowerDNS or dnsdist.
* This file is part of PowerDNS or weakforced.
* Copyright -- PowerDNS.COM B.V. and its contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* In addition, for the avoidance of any doubt, permission is granted to
* link this program with OpenSSL and to (re)distribute the binaries
Expand Down
Binary file added regression-tests/RegressionGeoIP.mmdb
Binary file not shown.
4 changes: 2 additions & 2 deletions regression-tests/wforce-tw.conf
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ end

setCustomGetEndpoint("testCustomGet", testCustomGetFunc)

newGeoIP2DB("City", "/usr/share/GeoIP/GeoLite2-City.mmdb")
newGeoIP2DB("Country", "/usr/share/GeoIP/GeoLite2-Country.mmdb")
newGeoIP2DB("City", "RegressionGeoIP.mmdb")
newGeoIP2DB("Country", "RegressionGeoIP.mmdb")

function geoip2(args)
local ip_address
Expand Down

0 comments on commit 7a6e45c

Please sign in to comment.