Skip to content

Commit ad17f1c

Browse files
authored
Pktvisor release 4.4.0 (#681)
Pktvisor release 4.4.0 (#681)
2 parents 3fc9673 + 18764e5 commit ad17f1c

File tree

9 files changed

+61
-288
lines changed

9 files changed

+61
-288
lines changed

.github/workflows/build-develop.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ jobs:
2727
runs-on: macos-11
2828
steps:
2929
- uses: actions/checkout@v3
30-
30+
- name: install gcc 12.2
31+
run: |
32+
gcc --version
33+
brew search gcc
34+
brew install gcc@12
35+
gcc --version
36+
3137
- name: Create Build Environment
3238
# Some projects don't allow in-source building, so create a separate build directory
3339
# We'll use this as our working directory for all subsequent commands
@@ -39,35 +45,35 @@ jobs:
3945
with:
4046
version: 1.59.0
4147

42-
- name: Setup Conan Cache
43-
uses: actions/cache@v3
44-
with:
45-
path: ${{github.workspace}}/build/conan_home/
46-
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }}
47-
restore-keys: conan-${{ runner.os }}-
48-
49-
- name: Configure CMake
50-
# Use a bash shell so we can use the same syntax for environment variable
51-
# access regardless of the host operating system
52-
shell: bash
53-
working-directory: ${{github.workspace}}/build
54-
# Note the current convention is to use the -S and -B options here to specify source
55-
# and build directories, but this is only available with CMake 3.13 and higher.
56-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
57-
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
58-
59-
- name: Build
60-
working-directory: ${{github.workspace}}/build
61-
shell: bash
62-
# Execute the build. You can specify a specific target with "--target <NAME>"
63-
run: cmake --build . --config $BUILD_TYPE -- -j 2
64-
65-
- name: Test
66-
working-directory: ${{github.workspace}}/build
67-
shell: bash
68-
# Execute tests defined by the CMake configuration.
69-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
70-
run: ctest -C $BUILD_TYPE
48+
# - name: Setup Conan Cache
49+
# uses: actions/cache@v3
50+
# with:
51+
# path: ${{github.workspace}}/build/conan_home/
52+
# key: conan-${{ runner.os }}-${{ hashFiles('conanfile.txt', '*/conanfile.txt') }}
53+
# restore-keys: conan-${{ runner.os }}-
54+
55+
# - name: Configure CMake
56+
# # Use a bash shell so we can use the same syntax for environment variable
57+
# # access regardless of the host operating system
58+
# shell: bash
59+
# working-directory: ${{github.workspace}}/build
60+
# # Note the current convention is to use the -S and -B options here to specify source
61+
# # and build directories, but this is only available with CMake 3.13 and higher.
62+
# # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
63+
# run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
64+
65+
# - name: Build
66+
# working-directory: ${{github.workspace}}/build
67+
# shell: bash
68+
# # Execute the build. You can specify a specific target with "--target <NAME>"
69+
# run: cmake --build . --config $BUILD_TYPE -- -j 2
70+
71+
# - name: Test
72+
# working-directory: ${{github.workspace}}/build
73+
# shell: bash
74+
# # Execute tests defined by the CMake configuration.
75+
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
76+
# run: ctest -C $BUILD_TYPE
7177

7278
unit-tests-linux:
7379
# The CMake configure and build commands are platform agnostic and should work equally
@@ -644,7 +650,7 @@ jobs:
644650
key: ${{ secrets.RUNNER_SSH_KEY }}
645651
port: 2022
646652
source: "./output/*"
647-
target: "/usr/share/nginx/html/pktvisor/develop/${{ needs.integration-tests.outputs.commit_hash }}/pktvisor/python-test"
653+
target: "/usr/share/nginx/html/test_data/pktvisor/develop/${{ needs.integration-tests.outputs.commit_hash }}/pktvisor/python-test"
648654

649655
remove-github-runner-amd64:
650656
continue-on-error: true

.github/workflows/build-release.yml

Lines changed: 3 additions & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
unit-tests:
2121
strategy:
2222
matrix:
23-
os: [ ubuntu-latest, macos-11 ]
23+
os: [ ubuntu-latest ]
2424
runs-on: ${{ matrix.os }}
2525
steps:
2626
- uses: actions/checkout@v3
@@ -255,92 +255,6 @@ jobs:
255255
path: |
256256
.github/hosted-runner/arm64/terraform.tfstate
257257
retention-days: 1
258-
259-
spinup-amd64-runner:
260-
needs: [ prebuild-package ]
261-
runs-on: ubuntu-latest
262-
outputs:
263-
runner_token: ${{ steps.token.outputs.runner }}
264-
runner_label: ${{ env.RUNNER_LABEL }}
265-
if: github.event_name != 'pull_request'
266-
steps:
267-
- name: Checkout
268-
uses: actions/checkout@v3
269-
270-
- name: Generate runner token
271-
id: token
272-
run: |
273-
curl -X POST -H "authorization: Bearer ${{ secrets.BOT_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/orb-community/pktvisor/actions/runners/registration-token -o token.json
274-
echo "::set-output name=runner::$(cat token.json | jq .token --raw-output )"
275-
cat token.json
276-
277-
- name: Get short commit hash to a variable
278-
id: commit_hash
279-
run: |
280-
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
281-
282-
- name: Inject runner token in user_data.sh
283-
run: |
284-
cd .github/hosted-runner/amd64/
285-
ESCAPED_REPLACE_RUNNER_TOKEN=$(printf '%s\n' "${{ steps.token.outputs.runner }}" | sed -e 's/[\/&]/\\&/g')
286-
sed -i -e "s/RUNNER_TOKEN/$ESCAPED_REPLACE_RUNNER_TOKEN/g" user_data.sh
287-
ESCAPED_REPLACE_RUNNER_NAME=$(printf '%s\n' "${{ steps.commit_hash.outputs.sha_short }}-amd64" | sed -e 's/[\/&]/\\&/g')
288-
sed -i -e "s/AMD64_RUNNER/$ESCAPED_REPLACE_RUNNER_NAME/g" user_data.sh
289-
ESCAPED_REPLACE_RUNNER_LABEL=$(printf '%s\n' "${{ steps.commit_hash.outputs.sha_short }}-amd64" | sed -e 's/[\/&]/\\&/g')
290-
sed -i -e "s/RUNNER_LABEL/$ESCAPED_REPLACE_RUNNER_LABEL/g" user_data.sh
291-
echo "RUNNER_LABEL=${{ steps.commit_hash.outputs.sha_short }}-amd64" >> $GITHUB_ENV
292-
293-
- name: Inject AWS key
294-
run: |
295-
cd .github/hosted-runner/amd64/
296-
ESCAPED_REPLACE_KEY_ID=$(printf '%s\n' "${{ secrets.AWS_ACCESS_KEY_ID }}" | sed -e 's/[\/&]/\\&/g')
297-
sed -i -e "s/AWSID/$ESCAPED_REPLACE_KEY_ID/g" vars.tf
298-
ESCAPED_REPLACE_ACCESS_KEY=$(printf '%s\n' "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | sed -e 's/[\/&]/\\&/g')
299-
sed -i -e "s/AWSSECRET/$ESCAPED_REPLACE_ACCESS_KEY/g" vars.tf
300-
ESCAPED_REPLACE_ENVIRONMENT=$(printf '%s\n' "${{ needs.prebuild-package.outputs.branch_name }}-${{ steps.commit_hash.outputs.sha_short }}-release" | sed -e 's/[\/&]/\\&/g')
301-
sed -i -e "s/ENVIRONMENT/$ESCAPED_REPLACE_ENVIRONMENT/g" vars.tf
302-
303-
- name: setup terraform
304-
uses: hashicorp/setup-terraform@v2
305-
with:
306-
terraform_version: 1.1.7
307-
terraform_wrapper: false
308-
309-
- name: Terraform Init
310-
run: |
311-
cd .github/hosted-runner/amd64/
312-
terraform init -input=false
313-
314-
- name: Terraform plan
315-
run: |
316-
cd .github/hosted-runner/amd64/
317-
terraform plan -out=tfplan
318-
319-
- name: Terraform apply
320-
run: |
321-
cd .github/hosted-runner/amd64/
322-
terraform apply -auto-approve tfplan
323-
324-
- name: Terraform output
325-
run: |
326-
cd .github/hosted-runner/amd64/
327-
terraform output -raw ip > ip.txt
328-
329-
- name: Persist IP to workspace
330-
uses: actions/upload-artifact@v2
331-
with:
332-
name: ip
333-
path: |
334-
.github/hosted-runner/amd64/ip.txt
335-
retention-days: 1
336-
337-
- name: Persist to workspace
338-
uses: actions/upload-artifact@v2
339-
with:
340-
name: terraform2
341-
path: |
342-
.github/hosted-runner/amd64/terraform.tfstate
343-
retention-days: 1
344258

345259
build-win64:
346260
# The CMake configure and build commands are platform agnostic and should work equally
@@ -428,7 +342,7 @@ jobs:
428342
retention-days: 1
429343

430344
build-cli-win64:
431-
needs: [ build-win64 ]
345+
needs: [ build-win64, release ]
432346
runs-on: ubuntu-latest
433347
steps:
434348
- name: Checkout code
@@ -592,80 +506,6 @@ jobs:
592506
docker image ls -a
593507
docker push ${{ env.IMAGE_NAME }}:release-arm64
594508
595-
package-armv7:
596-
needs: [ spinup-amd64-runner ]
597-
runs-on: ${{ needs.spinup-amd64-runner.outputs.runner_label }}
598-
if: github.event_name != 'pull_request'
599-
steps:
600-
- name: Attach to workspace
601-
uses: actions/download-artifact@v2
602-
with:
603-
name: workspace
604-
605-
- name: Get branch name
606-
shell: bash
607-
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
608-
609-
- name: Debug branch name
610-
run: echo ${{ env.BRANCH_NAME }}
611-
612-
- name: Get VERSION
613-
run: |
614-
echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
615-
- name: Debug version
616-
run: echo ${{ env.VERSION }}
617-
618-
- name: Generate ref tag (master)
619-
if: ${{ env.BRANCH_NAME == 'master' }}
620-
run: |
621-
echo "REF_TAG=latest" >> $GITHUB_ENV
622-
echo "PRERELEASE=false" >> $GITHUB_ENV
623-
echo "DRAFT=true" >> $GITHUB_ENV
624-
- name: Debug ref tag
625-
run: echo ${{ env.REF_TAG }}
626-
627-
- name: Login to GitHub Container Registry
628-
uses: docker/login-action@v1
629-
with:
630-
registry: ghcr.io
631-
username: ${{ github.repository_owner }}
632-
password: ${{ secrets.GITHUB_TOKEN }}
633-
634-
- name: Replace token
635-
run: |
636-
sed -i -e "s/CP_TOKEN/${{ secrets.CRASHPAD_TOKEN }}/g" docker/run.sh
637-
- name: Replace escape url
638-
run: |
639-
REPLACE=${{ secrets.BUGSPLAT_CP_URL }}
640-
ESCAPED_REPLACE=$(printf '%s\n' "$REPLACE" | sed -e 's/[\/&]/\\&/g')
641-
sed -i -e "s/CP_URL/$ESCAPED_REPLACE/g" docker/run.sh
642-
643-
- name: Set up QEMU
644-
uses: docker/setup-qemu-action@v2
645-
646-
- name: Set up Docker Buildx
647-
id: buildx
648-
uses: docker/setup-buildx-action@v2
649-
650-
- name: Build + push - pktvisor (multi-arch)
651-
env:
652-
IMAGE_NAME: ghcr.io/orb-community/pktvisor
653-
uses: docker/build-push-action@v3
654-
with:
655-
builder: ${{ steps.buildx.outputs.name }}
656-
context: .
657-
file: ./docker/Dockerfile
658-
platforms: linux/arm/v7
659-
tags: ${{ env.IMAGE_NAME }}:release-armv7
660-
outputs: type=docker,dest=/tmp/armv7.tar
661-
662-
- name: Load image
663-
env:
664-
IMAGE_NAME: ghcr.io/orb-community/pktvisor
665-
run: |
666-
docker load --input /tmp/armv7.tar
667-
docker image ls -a
668-
docker push ${{ env.IMAGE_NAME }}:release-armv7
669509
670510
package-amd64:
671511
needs: [ prebuild-package ]
@@ -866,88 +706,8 @@ jobs:
866706
cd .github/hosted-runner/arm64/
867707
terraform destroy -auto-approve
868708
869-
remove-github-runner-amd64:
870-
continue-on-error: true
871-
needs: [ package-armv7 ]
872-
runs-on: ubuntu-latest
873-
if: github.event_name != 'pull_request'
874-
steps:
875-
- name: Attach to workspace
876-
uses: actions/download-artifact@v2
877-
with:
878-
name: ip
879-
880-
- name: Get runner ip
881-
id: address
882-
run: |
883-
ls -lha
884-
echo "::set-output name=ip::$(cat ip.txt)"
885-
886-
- name: Generate remove runner token
887-
id: remove-token-amd64
888-
run: |
889-
curl -X POST -H "authorization: Bearer ${{ secrets.BOT_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/orb-community/pktvisor/actions/runners/remove-token -o token.json
890-
echo "::set-output name=remove-runner::$(cat token.json | jq .token --raw-output )"
891-
cat token.json
892-
echo "TOKEN_RUNNER_AMD64=$(cat token.json | jq .token --raw-output )" >> $GITHUB_ENV
893-
894-
- name: Executing remote ssh commands on runner
895-
uses: appleboy/ssh-action@master
896-
with:
897-
host: ${{ steps.address.outputs.ip }}
898-
username: ubuntu
899-
key: ${{ secrets.RUNNER_SSH_KEY }}
900-
port: 22
901-
script: |
902-
cd /actions-runner
903-
sudo chmod 777 . -R
904-
./config.sh remove --token ${{ env.TOKEN_RUNNER_AMD64 }}
905-
906-
remove-amd64-runner:
907-
needs: [ remove-github-runner-amd64 ]
908-
runs-on: ubuntu-latest
909-
if: github.event_name != 'pull_request'
910-
steps:
911-
- name: Checkout
912-
uses: actions/checkout@v3
913-
914-
- name: Attach to workspace
915-
uses: actions/download-artifact@v2
916-
with:
917-
name: terraform2
918-
path: .github/hosted-runner/amd64/
919-
920-
- name: Inject AWS key
921-
run: |
922-
cd .github/hosted-runner/amd64/
923-
ESCAPED_REPLACE_KEY_ID=$(printf '%s\n' "${{ secrets.AWS_ACCESS_KEY_ID }}" | sed -e 's/[\/&]/\\&/g')
924-
sed -i -e "s/AWSID/$ESCAPED_REPLACE_KEY_ID/g" vars.tf
925-
ESCAPED_REPLACE_ACCESS_KEY=$(printf '%s\n' "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | sed -e 's/[\/&]/\\&/g')
926-
sed -i -e "s/AWSSECRET/$ESCAPED_REPLACE_ACCESS_KEY/g" vars.tf
927-
928-
- name: setup terraform
929-
uses: hashicorp/setup-terraform@v2
930-
with:
931-
terraform_version: 1.1.7
932-
933-
- name: Terraform Init
934-
run: |
935-
cd .github/hosted-runner/amd64/
936-
terraform init -input=false
937-
938-
- name: Terraform plan destroy
939-
run: |
940-
cd .github/hosted-runner/amd64/
941-
terraform plan -destroy
942-
continue-on-error: true
943-
944-
- name: Terraform destroy
945-
run: |
946-
cd .github/hosted-runner/amd64/
947-
terraform destroy -auto-approve
948-
949709
pushing-manifests:
950-
needs: [ package-amd64 , package-arm64 , package-armv7 ]
710+
needs: [ package-amd64 , package-arm64 ]
951711
runs-on: ubuntu-latest
952712
if: github.event_name != 'pull_request'
953713
steps:
@@ -962,7 +722,6 @@ jobs:
962722
run: |
963723
docker manifest create ghcr.io/orb-community/pktvisor:latest \
964724
ghcr.io/orb-community/pktvisor:release-amd64 \
965-
ghcr.io/orb-community/pktvisor:release-armv7 \
966725
ghcr.io/orb-community/pktvisor:release-arm64
967726
968727
- name: Push manifest to ghcr.io

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.13)
55
#######################################################
66

77
# this is the source of truth for semver version
8-
project(visor VERSION 4.3.0)
8+
project(visor VERSION 4.4.0)
99

1010
# for main line release, this is empty
1111
# for development release, this is "-develop"

automated_tests/features/cleanup.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@AUTORETRY
12
Feature: cleanup env
23

34
@cleanup

automated_tests/features/pktvisor.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@AUTORETRY
12
Feature: pktvisor tests
23

34
@smoke

0 commit comments

Comments
 (0)