Skip to content

Commit

Permalink
Merge branch 'hubblo-org:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
demeringo authored Jan 31, 2023
2 parents b7b6929 + 832ec60 commit bf34c3a
Show file tree
Hide file tree
Showing 38 changed files with 2,219 additions and 524 deletions.
21 changes: 21 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
target/

docs_src/

.git

.cache

*.md

*.jpg

*.png

*.svg

book.toml

helm/

docker-compose/
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: hubblo-org
31 changes: 31 additions & 0 deletions .github/workflows/bloat-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#name: Check changes in binary size
#
#on:
# push:
# branches: [ main ]
# paths-ignore:
# - 'docs_src/**'
# - 'README.md'
# - 'CHANGELOG.md'
# - 'CITATION'
# - 'book.toml'
# pull_request:
# branches: [ main ]
# paths-ignore:
# - 'docs_src/**'
# - 'README.md'
# - 'CHANGELOG.md'
# - 'CITATION'
# - 'book.toml'
#
#jobs:
# bloat_test:
# name: Cargo Fmt and Clippy - Linux
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# - name: Run cargo bloat
# uses: orf/cargo-bloat-action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
131 changes: 125 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_and_test
name: Tests

on:
push:
Expand All @@ -12,6 +12,12 @@ on:
- 'CONTRIBUTING.md'
pull_request:
branches: [ main, dev ]
paths-ignore:
- 'docs_src/**'
- 'README.md'
- 'CHANGELOG.md'
- 'CITATION'
- 'book.toml'

env:
CARGO_TERM_COLOR: always
Expand All @@ -20,9 +26,71 @@ env:
AWX_HOST: "https://cd.hubblo.org"

jobs:
build:
name: build_and_test_x86_64
check_pr_is_on_the_right_branch:
name: Check PR is open on the right branch
runs-on: ubuntu-latest
steps:
- name: Display warning and kill pipeline if needed
run: |
if [ ${GITHUB_BASE_REF} == "main" && ${GITHUB_HEAD_REF} != "dev" ]; then
echo "PR has been opened on the main branch, from another branch than dev. Please consider opening it on the dev branch instead !"
exit 1
fi
fmt_and_clippy_linux:
name: Cargo Fmt and Clippy - Linux
runs-on: ubuntu-latest
needs: check_pr_is_on_the_right_branch
steps:
- name: Cancel Previous Runs
uses: ambimax/action-cancel-previous-runs@v1
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Clippy Check
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -A clippy::upper_case_acronyms -D warnings
fmt_and_clippy_windows:
name: Cargo Fmt and Clippy - Windows
runs-on: windows-latest
needs: fmt_and_clippy_linux
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rustup
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install rustup.install --ignore-checksums
- name: Install Rust toolchain
run: |
rustup toolchain install stable-x86_64-pc-windows-msvc
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Clippy Check
uses: actions-rs/cargo@v1
with:
command : clippy
args: --no-default-features --features "prometheus json riemann"

test_linux_x86_64:
name: Test on GNU/Linux x86_64 (Bare metal worker)
runs-on: ubuntu-latest
needs: fmt_and_clippy_linux
steps:
- name: Install dependencies (awxkit)
uses: actions/setup-python@v2
Expand All @@ -37,7 +105,58 @@ jobs:
run: |
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 '"')
echo "::set-output name=awx_token::${AWX_TOKEN}"
- name: Launch job
id: launch
- name: Prepare Rust environment on bare metal worker
id: rust
run: |
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}\"}" 12 --monitor
- name: Clone Scaphandre repository
id: clone
run: |
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}\"}" 13 --monitor
- name: Run Unit Tests
id: unittests
run: |
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}\"}" 14 --monitor
build_linux_x86_64:
name: Build on GNU/Linux x86_64 (Bare metal worker)
runs-on: ubuntu-latest
needs: test_linux_x86_64
steps:
- name: Install dependencies (awxkit)
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install python requirements (awxkit)
run: |
python -m pip install --upgrade pip
pip install awxkit
- name: Log on AWX
id: login
run: |
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 '"')
echo "::set-output name=awx_token::${AWX_TOKEN}"
- name: Build Docker image
id: dockerbuild
run: |
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}\"}" 15 --monitor
- name: Test Scaphandre + Prometheus in docker-compose
id: promtest
run: |
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}\"}" 16 --monitor
test_windows_x86_64:
name: Test on Windows x86_64 (Virtual machine worker)
runs-on: "windows-2019"
needs: fmt_and_clippy_windows
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rustup
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install rustup.install --ignore-checksums
- name: Install Rust toolchain
run: |
rustup toolchain install stable-x86_64-pc-windows-msvc
- name: Build (debug mode)
run: |
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
cargo build --no-default-features --features "prometheus json riemann"
57 changes: 0 additions & 57 deletions .github/workflows/rust.yml

This file was deleted.

37 changes: 35 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,42 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/hubblo-org/scaphandre/commits/main)
## [Unreleased](https://github.com/hubblo-org/scaphandre/commits/dev)

This may be not up to date, please check main branch.
Please check dev branch.

## [0.5.0](https://github.com/hubblo-org/scaphandre/releases/tag/v0.5.0)

### Changed

- Upgraded procfs to 0.12 : [#144](https://github.com/hubblo-org/scaphandre/pull/144)
- Rollbacked to ubuntu 20.04 as the base docker image : [#151](https://github.com/hubblo-org/scaphandre/pull/151), thanks to @demeringo
- Using github action to tag docker image : [#160](https://github.com/hubblo-org/scaphandre/pull/160), thanks to @rossf7

### Added

- New level of abstraction regarding structs managed by Sensors, so we could implement more sensors in an easier way : [#149](https://github.com/hubblo-org/scaphandre/pull/149)
- Enable JSON exporter to run as a daemon : [#169](https://github.com/hubblo-org/scaphandre/issues/169)
- First building blocks for conditional compilation depending on the OS : [#148](https://github.com/hubblo-org/scaphandre/pull/148)
- Mitigation for machines where powercap is not able to feed rapl domain folders, and only has socket ones : [#198](https://github.com/hubblo-org/scaphandre/pull/198)
- Experimental support for Windows 10, 11, server 2019 : [#74](https://github.com/hubblo-org/scaphandre/issues/74) and [#247](https://github.com/hubblo-org/scaphandre/issues/247)
- Added --containers option to JSON exporter : [#217](https://github.com/hubblo-org/scaphandre/issues/217)

### Fixed

- Kubernetes pods using containerd are now supported : [#130](https://github.com/hubblo-org/scaphandre/pull/130), thanks to @rossf7
- Excluded unrelevant procfs metrics from calculation of cpu cycles consumed by processes : [#132](https://github.com/hubblo-org/scaphandre/pull/132)
- Mitigated possible decrepancies between host (rapl) total power usage metric and the sum of per-process power usage metrics : [#20](https://github.com/hubblo-org/scaphandre/issues/20), note that some issues show remaining issues on this topic. Further investigation and work needed.
- Documentation fix for helm install : [#136](https://github.com/hubblo-org/scaphandre/pull/136), thanks to @arthurzenika
- New helm chart values: arguments and backtrace : [#139](https://github.com/hubblo-org/scaphandre/pull/139), thanks to @jotak
- Some documentation typos : [#157](https://github.com/hubblo-org/scaphandre/pull/157), thanks to @metacosm
- Aligning on new clippy rules : [#162](https://github.com/hubblo-org/scaphandre/pull/162), thanks to @demeringo
- Always set last pods check timestamp : [#173](https://github.com/hubblo-org/scaphandre/pull/173), thanks to @rossf7
- Support kubelets using systemd cgroup driver: [#146](https://github.com/hubblo-org/scaphandre/pull/146), thanks to @rossf7
- Fix missing volume in psp (helm chart): [#168](https://github.com/hubblo-org/scaphandre/pull/168), thanks to @olevitt
- Spelling check in documentation : [#183](https://github.com/hubblo-org/scaphandre/pull/183), thanks to @irishgordo
- No more duplicated HELP and TYPE lines in prometheus exporter: [#165](https://github.com/hubblo-org/scaphandre/issues/165) and [#192](https://github.com/hubblo-org/scaphandre/pull/192)
- Escaping newlines in cmdline: [#175](https://github.com/hubblo-org/scaphandre/issues/175), thanks to @uggla

## [0.4.1](https://github.com/hubblo-org/scaphandre/releases/tag/v0.4.0)

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Please have a look at our [Contributing guide](https://hubblo-org.github.io/scaphandre-documentation/contributing.html) !

Or from the code repository directly : [contributing.md](docs_src/contributing.md).
Loading

0 comments on commit bf34c3a

Please sign in to comment.