Skip to content

Commit f220568

Browse files
authored
Merge pull request #74 from ns1labs/release
Release 3.2.0
2 parents 5707c68 + 7cfeee0 commit f220568

File tree

152 files changed

+15535
-1959
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+15535
-1959
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ cmake-build*
22
integration_tests/external*
33
Dockerfile
44
.dockerignore
5+
.gitignore
6+
.git
7+
appimage/Dockerfile.part
8+
appimage/export.sh
9+
appimage/Makefile

.github/workflows/build.yml

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- develop
8+
- release
9+
push:
10+
branches:
11+
- develop
12+
- release
13+
14+
env:
15+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
16+
BUILD_TYPE: Release
17+
18+
jobs:
19+
build:
20+
# The CMake configure and build commands are platform agnostic and should work equally
21+
# well on Windows or Mac. You can convert this to a matrix build if you need
22+
# cross-platform coverage.
23+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
24+
strategy:
25+
matrix:
26+
os: [ ubuntu-latest, macos-latest ]
27+
runs-on: ${{ matrix.os }}
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Create Build Environment
33+
# Some projects don't allow in-source building, so create a separate build directory
34+
# We'll use this as our working directory for all subsequent commands
35+
run: cmake -E make_directory ${{github.workspace}}/build
36+
37+
- name: Get Conan
38+
# You may pin to the exact commit or the version.
39+
# uses: turtlebrowser/get-conan@4dc7e6dd45c8b1e02e909979d7cfc5ebba6ddbe2
40+
uses: turtlebrowser/[email protected]
41+
42+
- name: Conan profile and settings
43+
run: |
44+
conan profile new --detect default
45+
conan config set general.revisions_enabled=1
46+
47+
- name: Conan profile (linux-workaround)
48+
if: matrix.os == 'ubuntu-latest'
49+
run:
50+
conan profile update settings.compiler.libcxx=libstdc++11 default
51+
52+
- name: Conan install (osx-workaround)
53+
if: matrix.os == 'macos-latest'
54+
working-directory: ${{github.workspace}}/build
55+
run: |
56+
conan remote add ns1labs-conan https://ns1labs.jfrog.io/artifactory/api/conan/ns1labs-conan
57+
conan install --build=missing ..
58+
59+
- name: linux package install
60+
if: matrix.os == 'ubuntu-latest'
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install --yes --no-install-recommends golang ca-certificates jq
64+
65+
- name: Configure CMake
66+
# Use a bash shell so we can use the same syntax for environment variable
67+
# access regardless of the host operating system
68+
shell: bash
69+
working-directory: ${{github.workspace}}/build
70+
# Note the current convention is to use the -S and -B options here to specify source
71+
# and build directories, but this is only available with CMake 3.13 and higher.
72+
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
73+
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
74+
75+
- name: Build
76+
working-directory: ${{github.workspace}}/build
77+
shell: bash
78+
# Execute the build. You can specify a specific target with "--target <NAME>"
79+
run: cmake --build . --config $BUILD_TYPE -- -j 2
80+
81+
- name: Test
82+
working-directory: ${{github.workspace}}/build
83+
shell: bash
84+
# Execute tests defined by the CMake configuration.
85+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
86+
run: ctest -C $BUILD_TYPE
87+
88+
package:
89+
needs: build
90+
runs-on: ubuntu-latest
91+
# if this is a push into one of our main branches (rather than just a pull request), we will also package
92+
if: github.event_name != 'pull_request'
93+
94+
steps:
95+
- uses: actions/checkout@v2
96+
97+
- name: Create Build Environment
98+
run: cmake -E make_directory ${{github.workspace}}/build
99+
100+
- name: Get Conan
101+
uses: turtlebrowser/[email protected]
102+
103+
- name: Conan profile and settings
104+
run: |
105+
conan profile new --detect default
106+
conan config set general.revisions_enabled=1
107+
conan profile update settings.compiler.libcxx=libstdc++11 default
108+
109+
- name: Configure CMake to generate VERSION
110+
shell: bash
111+
working-directory: ${{github.workspace}}/build
112+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
113+
114+
- name: Get branch name
115+
shell: bash
116+
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
117+
118+
- name: Debug branch name
119+
run: echo ${{ env.BRANCH_NAME }}
120+
121+
- name: Get VERSION
122+
run: |
123+
echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
124+
125+
- name: Debug version
126+
run: echo ${{ env.VERSION }}
127+
128+
- name: Generate ref tag (master)
129+
if: ${{ env.BRANCH_NAME == 'master' }}
130+
run: |
131+
echo "REF_TAG=latest" >> $GITHUB_ENV
132+
echo "PRERELEASE=false" >> $GITHUB_ENV
133+
echo "DRAFT=true" >> $GITHUB_ENV
134+
135+
- name: Generate ref tag (develop)
136+
if: ${{ env.BRANCH_NAME == 'develop' }}
137+
run: |
138+
echo "REF_TAG=latest-develop" >> $GITHUB_ENV
139+
echo "PRERELEASE=true" >> $GITHUB_ENV
140+
echo "DRAFT=false" >> $GITHUB_ENV
141+
142+
- name: Generate ref tag (release candidate)
143+
if: ${{ env.BRANCH_NAME == 'release' }}
144+
run: |
145+
echo "REF_TAG=latest-rc" >> $GITHUB_ENV
146+
echo "PRERELEASE=true" >> $GITHUB_ENV
147+
echo "DRAFT=false" >> $GITHUB_ENV
148+
149+
- name: Debug ref tag
150+
run: echo ${{ env.REF_TAG }}
151+
152+
- name: Manage Github ref tags
153+
uses: actions/github-script@v3
154+
with:
155+
github-token: ${{ github.token }}
156+
# note deleteRef can't start with refs/, but create createRef does.
157+
script: |
158+
try {
159+
await github.git.deleteRef({
160+
owner: context.repo.owner,
161+
repo: context.repo.repo,
162+
ref: "tags/${{ env.REF_TAG }}",
163+
})
164+
} catch (e) {
165+
console.log("The tag doesn't exist yet: " + e)
166+
}
167+
await github.git.createRef({
168+
owner: context.repo.owner,
169+
repo: context.repo.repo,
170+
ref: "refs/tags/${{ env.REF_TAG }}",
171+
sha: context.sha
172+
})
173+
174+
- name: Login to Docker Hub
175+
uses: docker/login-action@v1
176+
with:
177+
username: ${{ secrets.DOCKERHUB_USERNAME }}
178+
password: ${{ secrets.DOCKERHUB_TOKEN }}
179+
180+
- name: Build + push VERSION - pktvisor
181+
env:
182+
IMAGE_NAME: ns1labs/pktvisor
183+
run: |
184+
docker build . --file docker/Dockerfile --tag ${{ env.IMAGE_NAME }}:${{ env.VERSION }}
185+
docker push ${{ env.IMAGE_NAME }}:${{ env.VERSION }}
186+
187+
- name: Tag + push docker image with ref tag (cached build) - pktvisor
188+
env:
189+
IMAGE_NAME: ns1labs/pktvisor
190+
run: |
191+
docker build . --file docker/Dockerfile --tag ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
192+
docker push ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
193+
194+
- name: Build + push VERSION - pktvisor-prom-write
195+
env:
196+
IMAGE_NAME: ns1labs/pktvisor-prom-write
197+
working-directory: ${{github.workspace}}/centralized_collection/prometheus/docker-grafana-agent
198+
run: |
199+
docker build . --file Dockerfile --build-arg PKTVISOR_TAG=${{ env.REF_TAG }} --tag ${{ env.IMAGE_NAME }}:${{ env.VERSION }}
200+
docker push ${{ env.IMAGE_NAME }}:${{ env.VERSION }}
201+
202+
- name: Tag + push docker image with ref tag (cached build) - pktvisor-prom-write
203+
env:
204+
IMAGE_NAME: ns1labs/pktvisor-prom-write
205+
working-directory: ${{github.workspace}}/centralized_collection/prometheus/docker-grafana-agent
206+
run: |
207+
docker build . --file Dockerfile --build-arg PKTVISOR_TAG=${{ env.REF_TAG }} --tag ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
208+
docker push ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }}
209+
210+
- name: Generate AppImage
211+
env:
212+
IMAGE_NAME: ns1labs/pktvisor
213+
working-directory: ${{github.workspace}}/appimage
214+
run: |
215+
DEV_IMAGE="${{ env.IMAGE_NAME }}:${{ env.VERSION }}" DEV_MODE=t make pktvisor-x86_64.AppImage
216+
mv pktvisor-x86_64.AppImage pktvisor-x86_64-${{ env.VERSION }}.AppImage
217+
218+
- name: Upload AppImage artifact
219+
uses: actions/upload-artifact@v2
220+
with:
221+
name: pktvisor-x86_64-${{ env.VERSION }}.AppImage
222+
path: ${{github.workspace}}/appimage/pktvisor-x86_64-${{ env.VERSION }}.AppImage
223+

.github/workflows/cmake.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ cmake-build-*/
44
docs/html-documentation-generated*
55
integration_tests/external
66
golang/pkg/client/version.go
7+
docs/internals/html
8+
appimage/*.AppImage

3rd/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ message(STATUS "3rd party libraries")
44
add_subdirectory(datasketches)
55
add_subdirectory(rng)
66
add_subdirectory(timer)
7+
add_subdirectory(libmaxminddb)

0 commit comments

Comments
 (0)