Skip to content

Commit 63c4191

Browse files
authored
Merge branch 'dev' into feat/filter-pods-by-node
2 parents 0f73970 + 93d6ba8 commit 63c4191

113 files changed

Lines changed: 11900 additions & 2892 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
target/
2+
3+
docs_src/
4+
5+
.git
6+
7+
.cache
8+
9+
*.md
10+
11+
*.jpg
12+
13+
*.png
14+
15+
*.svg
16+
17+
book.toml
18+
19+
helm/
20+
21+
docker-compose/

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: hubblo-org

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Please see the documentation for all configuration options:
2+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: "cargo"
7+
directory: "/"
8+
target-branch: "dev"
9+
schedule:
10+
interval: "weekly"
Lines changed: 162 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,183 @@
1-
name: build_and_test
1+
name: Tests
22

33
on:
44
push:
5-
branches: [ main, dev ]
5+
branches: [main, dev]
66
paths-ignore:
7-
- 'docs_src/**'
8-
- 'README.md'
9-
- 'CHANGELOG.md'
10-
- 'CITATION'
11-
- 'book.toml'
12-
- 'CONTRIBUTING.md'
7+
- "docs_src/**"
8+
- "README.md"
9+
- "CHANGELOG.md"
10+
- "CITATION"
11+
- "book.toml"
12+
- "CONTRIBUTING.md"
13+
- ".github/workflows/exe-release-prometheuspush.yml"
14+
- "*.md"
15+
- "oranda.json"
1316
pull_request:
14-
branches: [ main, dev ]
17+
branches: [main, dev]
18+
paths-ignore:
19+
- "docs_src/**"
20+
- "README.md"
21+
- "CHANGELOG.md"
22+
- "CITATION"
23+
- "book.toml"
24+
- ".github/workflows/exe-release-prometheuspush.yml"
25+
- "*.md"
26+
- "oranda.json"
1527

1628
env:
1729
CARGO_TERM_COLOR: always
18-
AWX_PUBLIC_ACCESS: "{Xs%g5/a/Si=;_[4LL"
19-
AWX_PUBLIC_USER: "scaphandre-public"
20-
AWX_HOST: "https://cd.hubblo.org"
30+
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
33+
cancel-in-progress: true
2134

2235
jobs:
23-
build:
24-
name: build_and_test_x86_64
36+
check_pr_is_on_the_right_branch:
37+
name: Check PR is open on the right branch
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Display warning and kill pipeline if needed
41+
run: |
42+
if [ ${GITHUB_BASE_REF} == "main" && ${GITHUB_HEAD_REF} != "dev" ]; then
43+
echo "PR has been opened on the main branch, from another branch than dev. Please consider opening it on the dev branch instead !"
44+
exit 1
45+
fi
46+
fmt_and_clippy_linux:
47+
name: Cargo Fmt and Clippy - Linux
48+
runs-on: ubuntu-latest
49+
needs: check_pr_is_on_the_right_branch
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v3
53+
- name: Install Rust
54+
uses: bpetit/action-toolchain@v2.0.0
55+
with:
56+
toolchain: stable
57+
profile: minimal
58+
override: true
59+
components: rustfmt
60+
- name: Check formatting
61+
uses: bpetit/action-cargo@v2.0.1
62+
with:
63+
command: fmt
64+
args: --all -- --check
65+
- name: Clippy Check
66+
uses: bpetit/action-cargo@v2.0.1
67+
with:
68+
command: clippy
69+
args: -- -A clippy::upper_case_acronyms -D warnings
70+
71+
#fmt_and_clippy_windows:
72+
# name: Cargo Fmt and Clippy - Windows
73+
# runs-on: windows-latest
74+
# needs: check_pr_is_on_the_right_branch
75+
# steps:
76+
# - name: Checkout
77+
# uses: actions/checkout@v3
78+
# - name: Install Rustup
79+
# uses: crazy-max/ghaction-chocolatey@v2
80+
# with:
81+
# args: install rustup.install --ignore-checksums
82+
# - name: Install Rust toolchain
83+
# run: |
84+
# rustup toolchain install stable-x86_64-pc-windows-msvc
85+
# - name: Check formatting
86+
# uses: bpetit/action-cargo@v2.0.1
87+
# with:
88+
# command: fmt
89+
# args: --all -- --check
90+
# - name: Clippy Check
91+
# uses: bpetit/action-cargo@v2.0.1
92+
# with:
93+
# command : clippy
94+
# args: --no-default-features --features "prometheus json riemann warpten"
95+
96+
test_linux_x86_64:
97+
name: Test on GNU/Linux x86_64 (Bare metal worker)
2598
runs-on: ubuntu-latest
2699
steps:
27100
- name: Install dependencies (awxkit)
28-
uses: actions/setup-python@v2
101+
uses: actions/setup-python@v3
29102
with:
30-
python-version: '3.x'
103+
python-version: "3.11"
104+
- name: Install python requirements (awxkit)
105+
run: |
106+
python -m pip install --upgrade pip
107+
pip install awxkit setuptools
108+
- name: Log on AWX
109+
id: login
110+
run: |
111+
export AWX_TOKEN=$(awx --conf.host "${{ secrets.AWX_HOST }}" --conf.username "${{ secrets.AWX_PUBLIC_USER }}" --conf.password "${{ secrets.AWX_PASSWORD }}" login | jq .token | tr -d '"')
112+
echo "awx_token=${AWX_TOKEN}" >> $GITHUB_OUTPUT
113+
- name: Prepare Rust environment on bare metal worker
114+
id: rust
115+
run: |
116+
awx --conf.token ${{ steps.login.outputs.awx_token }} --conf.host ${{ secrets.AWX_HOST }} job_templates launch --extra_vars="{\"github_repository\":\"$GITHUB_REPOSITORY\",\"github_actor\":\"${GITHUB_ACTOR}\",\"github_workflow\":\"${GITHUB_WORKFLOW}\",\"github_workspace\":\"${GITHUB_WORKSPACE}\",\"github_event_name\":\"${GITHUB_EVENT_NAME}\",\"github_event_path\":\"${GITHUB_EVENT_PATH}\",\"github_sha\":\"${GITHUB_SHA}\",\"github_ref\":\"${GITHUB_REF}\",\"github_head_ref\":\"${GITHUB_HEAD_REF}\",\"github_base_ref\":\"${GITHUB_BASE_REF}\",\"github_server_url\":\"${GITHUB_SERVER_URL}\"}" 12 --monitor
117+
- name: Clone Scaphandre repository
118+
id: clone
119+
run: |
120+
awx --conf.token ${{ steps.login.outputs.awx_token }} --conf.host ${{ secrets.AWX_HOST }} job_templates launch --extra_vars="{\"github_repository\":\"${GITHUB_REPOSITORY}\",\"github_actor\":\"${GITHUB_ACTOR}\",\"github_workflow\":\"${GITHUB_WORKFLOW}\",\"github_workspace\":\"${GITHUB_WORKSPACE}\",\"github_event_name\":\"${GITHUB_EVENT_NAME}\",\"github_event_path\":\"${GITHUB_EVENT_PATH}\",\"github_sha\":\"${GITHUB_SHA}\",\"github_ref\":\"${GITHUB_REF}\",\"github_head_ref\":\"${GITHUB_HEAD_REF}\",\"github_base_ref\":\"${GITHUB_BASE_REF}\",\"github_server_url\":\"${GITHUB_SERVER_URL}\"}" 13 --monitor
121+
- name: Run Unit Tests
122+
id: unittests
123+
run: |
124+
awx --conf.token ${{ steps.login.outputs.awx_token }} --conf.host ${{ secrets.AWX_HOST }} job_templates launch --extra_vars="{\"github_repository\":\"${GITHUB_REPOSITORY}\",\"github_actor\":\"${GITHUB_ACTOR}\",\"github_workflow\":\"${GITHUB_WORKFLOW}\",\"github_workspace\":\"${GITHUB_WORKSPACE}\",\"github_event_name\":\"${GITHUB_EVENT_NAME}\",\"github_event_path\":\"${GITHUB_EVENT_PATH}\",\"github_sha\":\"${GITHUB_SHA}\",\"github_ref\":\"${GITHUB_REF}\",\"github_head_ref\":\"${GITHUB_HEAD_REF}\",\"github_base_ref\":\"${GITHUB_BASE_REF}\",\"github_server_url\":\"${GITHUB_SERVER_URL}\"}" 14 --monitor
125+
build_linux_x86_64:
126+
name: Build on GNU/Linux x86_64 (Bare metal worker)
127+
runs-on: ubuntu-latest
128+
needs:
129+
- fmt_and_clippy_linux
130+
- test_linux_x86_64
131+
steps:
132+
- name: Install dependencies (awxkit)
133+
uses: actions/setup-python@v3
134+
with:
135+
python-version: "3.11"
31136
- name: Install python requirements (awxkit)
32137
run: |
33138
python -m pip install --upgrade pip
34139
pip install awxkit
35-
- name: Log on AWX
140+
- name: Log on AWX
36141
id: login
37142
run: |
38-
export AWX_TOKEN=$(awx --conf.host "${{env.AWX_HOST}}" --conf.username "${{env.AWX_PUBLIC_USER}}" --conf.password "${{env.AWX_PUBLIC_ACCESS}}" login | jq .token | tr -d '"')
39-
echo "::set-output name=awx_token::${AWX_TOKEN}"
40-
- name: Launch job
41-
id: launch
143+
export AWX_TOKEN=$(awx --conf.host "${{ secrets.AWX_HOST }}" --conf.username "${{ secrets.AWX_PUBLIC_USER }}" --conf.password "${{ secrets.AWX_PASSWORD }}" login | jq .token | tr -d '"')
144+
echo "awx_token=${AWX_TOKEN}" >> $GITHUB_OUTPUT
145+
- name: Build debug version
146+
id: builddebug
147+
run: |
148+
awx --conf.token ${{ steps.login.outputs.awx_token }} --conf.host ${{ secrets.AWX_HOST }} job_templates launch --extra_vars="{\"github_repository\":\"${GITHUB_REPOSITORY}\",\"github_actor\":\"${GITHUB_ACTOR}\",\"github_workflow\":\"${GITHUB_WORKFLOW}\",\"github_workspace\":\"${GITHUB_WORKSPACE}\",\"github_event_name\":\"${GITHUB_EVENT_NAME}\",\"github_event_path\":\"${GITHUB_EVENT_PATH}\",\"github_sha\":\"${GITHUB_SHA}\",\"github_ref\":\"${GITHUB_REF}\",\"github_head_ref\":\"${GITHUB_HEAD_REF}\",\"github_base_ref\":\"${GITHUB_BASE_REF}\",\"github_server_url\":\"${GITHUB_SERVER_URL}\"}" 17 --monitor
149+
- name: Test JSON exporter
150+
id: jsonexporter
151+
run: |
152+
awx --conf.token ${{ steps.login.outputs.awx_token }} --conf.host ${{ secrets.AWX_HOST }} job_templates launch --extra_vars="{\"github_repository\":\"${GITHUB_REPOSITORY}\",\"github_actor\":\"${GITHUB_ACTOR}\",\"github_workflow\":\"${GITHUB_WORKFLOW}\",\"github_workspace\":\"${GITHUB_WORKSPACE}\",\"github_event_name\":\"${GITHUB_EVENT_NAME}\",\"github_event_path\":\"${GITHUB_EVENT_PATH}\",\"github_sha\":\"${GITHUB_SHA}\",\"github_ref\":\"${GITHUB_REF}\",\"github_head_ref\":\"${GITHUB_HEAD_REF}\",\"github_base_ref\":\"${GITHUB_BASE_REF}\",\"github_server_url\":\"${GITHUB_SERVER_URL}\"}" 18 --monitor
153+
- name: Build Docker image
154+
id: dockerbuild
155+
run: |
156+
awx --conf.token ${{ steps.login.outputs.awx_token }} --conf.host ${{ secrets.AWX_HOST }} job_templates launch --extra_vars="{\"github_repository\":\"${GITHUB_REPOSITORY}\",\"github_actor\":\"${GITHUB_ACTOR}\",\"github_workflow\":\"${GITHUB_WORKFLOW}\",\"github_workspace\":\"${GITHUB_WORKSPACE}\",\"github_event_name\":\"${GITHUB_EVENT_NAME}\",\"github_event_path\":\"${GITHUB_EVENT_PATH}\",\"github_sha\":\"${GITHUB_SHA}\",\"github_ref\":\"${GITHUB_REF}\",\"github_head_ref\":\"${GITHUB_HEAD_REF}\",\"github_base_ref\":\"${GITHUB_BASE_REF}\",\"github_server_url\":\"${GITHUB_SERVER_URL}\"}" 15 --monitor
157+
- name: Test Scaphandre + Prometheus in docker-compose
158+
id: promtest
42159
run: |
43-
awx --conf.token ${{ steps.login.outputs.awx_token }} --conf.host ${{ env.AWX_HOST }} job_templates launch --extra_vars="{\"github_repository\":\"${GITHUB_REPOSITORY}\",\"github_actor\":\"${GITHUB_ACTOR}\",\"github_workflow\":\"${GITHUB_WORKFLOW}\",\"github_workspace\":\"${GITHUB_WORKSPACE}\",\"github_event_name\":\"${GITHUB_EVENT_NAME}\",\"github_event_path\":\"${GITHUB_EVENT_PATH}\",\"github_sha\":\"${GITHUB_SHA}\",\"github_ref\":\"${GITHUB_REF}\",\"github_head_ref\":\"${GITHUB_HEAD_REF}\",\"github_base_ref\":\"${GITHUB_BASE_REF}\",\"github_server_url\":\"${GITHUB_SERVER_URL}\"}" 9 --monitor
160+
awx --conf.token ${{ steps.login.outputs.awx_token }} --conf.host ${{ secrets.AWX_HOST }} job_templates launch --extra_vars="{\"github_repository\":\"${GITHUB_REPOSITORY}\",\"github_actor\":\"${GITHUB_ACTOR}\",\"github_workflow\":\"${GITHUB_WORKFLOW}\",\"github_workspace\":\"${GITHUB_WORKSPACE}\",\"github_event_name\":\"${GITHUB_EVENT_NAME}\",\"github_event_path\":\"${GITHUB_EVENT_PATH}\",\"github_sha\":\"${GITHUB_SHA}\",\"github_ref\":\"${GITHUB_REF}\",\"github_head_ref\":\"${GITHUB_HEAD_REF}\",\"github_base_ref\":\"${GITHUB_BASE_REF}\",\"github_server_url\":\"${GITHUB_SERVER_URL}\"}" 16 --monitor
161+
#test_windows_x86_64:
162+
# name: Test on Windows x86_64 (Virtual machine worker)
163+
# runs-on: "windows-latest"
164+
# steps:
165+
# - name: Checkout
166+
# uses: actions/checkout@v3
167+
# - name: Install openssl for Windows with vcpkg
168+
# run: |
169+
# echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
170+
# vcpkg install openssl:x64-windows-static-md
171+
# - name: Install Rustup
172+
# uses: crazy-max/ghaction-chocolatey@v2
173+
# with:
174+
# args: install rustup.install --ignore-checksums
175+
# - name: Install Rust toolchain
176+
# run: |
177+
# rustup toolchain install stable-x86_64-pc-windows-msvc
178+
# - name: Tests
179+
# run: |
180+
# cargo test --no-default-features --features "prometheus prometheuspush json riemann" exporters
181+
# - name: Build (debug mode)
182+
# run: |
183+
# cargo build --no-default-features --features "prometheus prometheuspush json riemann"
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build Debian package on release
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'docs_src/**'
7+
- 'README.md'
8+
- 'CITATION'
9+
- 'book.toml'
10+
- 'CONTRIBUTING.md'
11+
- '*.md'
12+
- 'oranda.json'
13+
tags: [ 'v*.*.*', 'dev*.*.*' ]
14+
15+
16+
jobs:
17+
create_debian_pkg_with_tag:
18+
name: Create Debian package associated to version tag
19+
runs-on: ubuntu-latest
20+
outputs:
21+
deb11output: ${{ steps.deb11pkgname.outputs.deb11pkg }}
22+
deb12output: ${{ steps.deb12pkgname.outputs.deb12pkg }}
23+
steps:
24+
- name: Install s3cmd
25+
run: sudo apt install python3-pip -y && sudo pip3 install s3cmd awxkit
26+
- name: Checkout scaphandre repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
- name: Get latest tag of scaphandre repository
31+
id: latest-scaphandre-tag
32+
uses: "WyriHaximus/github-action-get-previous-tag@v1.3.0"
33+
with:
34+
fallback: dev0.5.18
35+
- name: Checkout scaphandre-debian repository
36+
uses: actions/checkout@v4
37+
with:
38+
repository: hubblo-org/scaphandre-debian
39+
- name: Build package with version tag and Debian 11 Bullseye
40+
run : |
41+
./build.sh -v ${{ steps.latest-scaphandre-tag.outputs.tag }}
42+
- name: Modify name of package to include tag version for Debian 11
43+
id: deb11pkgname
44+
run: |
45+
cd target
46+
PKG_NAME=$(ls | sed "s/\([0-9]\+\.\)\{2\}[0-9]\+\-[0-9]\+\?/${{ steps.latest-scaphandre-tag.outputs.tag }}-deb11/")
47+
mv *.deb $PKG_NAME
48+
echo "deb11pkg=$PKG_NAME" >> "$GITHUB_OUTPUT"
49+
- name: Upload to scw s3 and remove package
50+
run: |
51+
cd target
52+
s3cmd --access_key="${{ secrets.S3_ACCESS_KEY_ID }}" --secret_key="${{ secrets.S3_SECRET_ACCESS_KEY }}" --region="fr-par" --acl-public --host="s3.fr-par.scw.cloud" --host-bucket="%(bucket).s3.fr-par.scw.cloud" put ${{ steps.deb11pkgname.outputs.deb11pkg }} s3://scaphandre/x86_64/
53+
rm *.deb
54+
- name: Build package with version tag and Debian 12 Bookworm
55+
run: |
56+
./build.sh -i debian:bookworm-slim -v ${{ steps.latest-scaphandre-tag.outputs.tag }}
57+
- name: Modify name of package to include tag version for Debian 12
58+
id: deb12pkgname
59+
run: |
60+
cd target
61+
PKG_NAME=$(ls | sed "s/\([0-9]\+\.\)\{2\}[0-9]\+\-[0-9]\+\?/${{ steps.latest-scaphandre-tag.outputs.tag }}-deb12/")
62+
mv *.deb $PKG_NAME
63+
echo "deb12pkg=$PKG_NAME" >> "$GITHUB_OUTPUT"
64+
- name: Upload to scw s3
65+
run: |
66+
cd target
67+
s3cmd --access_key="${{ secrets.S3_ACCESS_KEY_ID }}" --secret_key="${{ secrets.S3_SECRET_ACCESS_KEY }}" --region="fr-par" --acl-public --host="s3.fr-par.scw.cloud" --host-bucket="%(bucket).s3.fr-par.scw.cloud" put ${{ steps.deb12pkgname.outputs.deb12pkg }} s3://scaphandre/x86_64/
68+
deb11-container-install-scaphandre:
69+
name: Create Debian 11 container and install scaphandre with URL
70+
needs: create_debian_pkg_with_tag
71+
env:
72+
DEB11PKG: ${{ needs.create_debian_pkg_with_tag.outputs.deb11output }}
73+
runs-on: ubuntu-latest
74+
container:
75+
image: debian:buster-slim
76+
steps:
77+
- name: Install dependencies
78+
run: |
79+
apt update
80+
apt install -y curl
81+
- name: Download Debian 11 scaphandre package
82+
run: |
83+
curl -O https://s3.fr-par.scw.cloud/scaphandre/x86_64/${{ env.DEB11PKG }}
84+
- name: Install and show scaphandre version
85+
run: |
86+
apt install -y ./${{ env.DEB11PKG }}
87+
scaphandre -V
88+
deb12-container-install-scaphandre:
89+
name: Create Debian 12 container and install scaphandre with URL
90+
needs: create_debian_pkg_with_tag
91+
runs-on: ubuntu-latest
92+
env:
93+
DEB12PKG: ${{ needs.create_debian_pkg_with_tag.outputs.deb12output }}
94+
container:
95+
image: debian:bookworm-slim
96+
steps:
97+
- name: Install dependencies
98+
run: |
99+
apt update
100+
apt install -y curl
101+
- name: Download Debian 12 scaphandre package
102+
run: |
103+
curl -O https://s3.fr-par.scw.cloud/scaphandre/x86_64/${{ env.DEB12PKG }}
104+
- name: Install and show scaphandre version
105+
run: |
106+
apt install -y ./${{ env.DEB12PKG }}
107+
scaphandre -V

0 commit comments

Comments
 (0)