Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-0.8]: backports from master #1048

Merged
merged 36 commits into from Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fe07cad
scripts: drop unused stuff from docker-build-image
marquiz Aug 10, 2023
a6e9c40
cross-build: get golang binaries instead of compiling from source
marquiz Aug 10, 2023
96f08a8
Makefile: prepare binary packages as release assets
marquiz Aug 11, 2023
46001af
Makefile: isolate image-push from image target
marquiz Aug 11, 2023
ec934ba
Makefile: remove -it arg from docker run
marquiz Aug 15, 2023
8f7a4c3
Makefile: drop unwanted update-workflows target
marquiz Aug 16, 2023
bbed3a2
github: add security scanning
marquiz Aug 9, 2023
78a9c76
github: take golang version from go.mod
marquiz Aug 11, 2023
23d0104
github: drop the turnstyle plugin
marquiz Aug 14, 2023
fc581cd
github: drop containerized build of docs from verify workflow
marquiz Aug 14, 2023
3e77c65
github: refactor docs building
marquiz Aug 14, 2023
3d3b6fd
github: split security scanning into re-usable jobs
marquiz Aug 11, 2023
90ea7ca
github: use pinpointed ubuntu version on the runners
marquiz Aug 16, 2023
6e7e951
github: refactor verify workflow
marquiz Aug 16, 2023
bbe73dd
github: add workflows for image building
marquiz Aug 11, 2023
8725870
github: add release job for publishing binary packages
marquiz Aug 15, 2023
0718cfb
github: add creation of vendored dist into release workflow
marquiz Aug 15, 2023
c592e93
github: fix the usage of github environments
marquiz Aug 17, 2023
68461c0
github: add trivy license scanning
marquiz Aug 17, 2023
d8fd9bc
github: split code and docs CI into separate workflows
marquiz Aug 17, 2023
37edb08
github: use path filter for publishing docs
marquiz Aug 17, 2023
6bd0cde
docs: use ADD in the dockerfile to fetch go tarball
marquiz Aug 11, 2023
9348e14
docs/deps: update pygments to v2.15.1
marquiz Aug 10, 2023
0e3857a
chore: remove refs to deprecated io/ioutil
testwill Jul 7, 2023
75e5bde
chore: remove refs to deprecated io/ioutil
testwill Jul 17, 2023
1250c9b
Use golang builtin multierror
marquiz Aug 11, 2023
6f5f6fc
all: switch to k8s.io/utils/cpuset.
klihub May 23, 2023
5261f55
resmgr: stop importing kubernetes/kubelet internals.
klihub May 23, 2023
9113991
go.mod: update goresctrl to v0.5.0
marquiz Aug 17, 2023
129d741
pkg/topology: sync go.mod with the main module
marquiz Aug 18, 2023
d59fcd8
e2e: restore vm as last step in the static-pools test suite
askervin Aug 14, 2023
8e28ce4
e2e: fix topology-aware/n4c16/test09-container-exit test
askervin Aug 21, 2023
9538543
e2e: fix distro=opensuse to support k8s 1.27+
askervin Aug 22, 2023
d684ccf
e2e: update default distro from Ubuntu 20.04 to 22.04
askervin Aug 22, 2023
7a7c94c
e2e: relax dynamic demotion first detection round requirement
askervin Aug 22, 2023
24d0251
demoter: fix sudden cri-resmgr process exit on page demotion
askervin Aug 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/common-build-docs.yaml
@@ -0,0 +1,36 @@
name: Build documentation
on:
workflow_call:
inputs:
publish:
default: false
required: false
type: boolean

jobs:
update-gh-pages:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1

- name: Fetch gh-pages
run: git fetch --no-tags --prune --depth=1 origin refs/heads/gh-pages:refs/heads/gh-pages

- name: Install build dependencies
run: |
pip3 install --user -r docs/requirements.txt
echo "`python3 -m site --user-base`/bin" >> $GITHUB_PATH

- name: Add docs from this revision to gh-pages
run: |
git config user.name "Github"
git config user.email "no-reply@github.com"
./scripts/build/update-gh-pages.sh

- name: Publish gh-pages
if: ${{ inputs.publish }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git gh-pages
44 changes: 44 additions & 0 deletions .github/workflows/common-build-images.yaml
@@ -0,0 +1,44 @@
name: Build container images

on:
workflow_call:
inputs:
image-tag:
default: ${{ github.ref_name }}
required: false
type: string
publish:
default: false
required: false
type: boolean
github-environment:
default: null
required: false
type: string

jobs:
build-images:
name: Build and publish container images
runs-on: ubuntu-22.04
environment: ${{ inputs.github-environment }}
env:
IMAGE_REPO: intel
IMAGE_VERSION: ${{ inputs.image-tag }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build images
run: "make images IMAGE_VERSION=${IMAGE_VERSION} Q="

- name: Login to Docker Hub
if: ${{ inputs.publish }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push images
if: ${{ inputs.publish }}
run: "make images-push IMAGE_VERSION=${IMAGE_VERSION} Q="

19 changes: 19 additions & 0 deletions .github/workflows/common-codeql.yaml
@@ -0,0 +1,19 @@
name: CodeQL scanning
on:
workflow_call:

jobs:
codeql-scan:
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
90 changes: 90 additions & 0 deletions .github/workflows/common-trivy.yaml
@@ -0,0 +1,90 @@
name: Trivy scanning
on:
workflow_call:
inputs:
upload-to-github-security-tab:
default: false
required: false
type: boolean
export-csv:
default: false
required: false
type: boolean

jobs:
trivy-scan-licenses:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run Trivy in fs mode
uses: aquasecurity/trivy-action@master
with:
scan-type: fs
scan-ref: .
exit-code: 1
scanners: license
severity: "UNKNOWN,MEDIUM,HIGH,CRITICAL"

trivy-scan-vulns:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run Trivy in fs mode
continue-on-error: true
uses: aquasecurity/trivy-action@master
with:
scan-type: fs
scan-ref: .
exit-code: 1
list-all-pkgs: true
format: json
output: trivy-report.json

- name: Show report in human-readable format
uses: aquasecurity/trivy-action@master
with:
scan-type: convert
vuln-type: ''
severity: ''
image-ref: trivy-report.json
format: table

- name: Convert report to sarif
if: ${{ inputs.upload-to-github-security-tab }}
uses: aquasecurity/trivy-action@master
with:
scan-type: convert
vuln-type: ''
severity: ''
image-ref: trivy-report.json
format: sarif
output: trivy-report.sarif

- name: Upload sarif report to GitHub Security tab
if: ${{ inputs.upload-to-github-security-tab }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: trivy-report.sarif

- name: Convert report to csv
if: ${{ inputs.export-csv }}
uses: aquasecurity/trivy-action@master
with:
scan-type: convert
vuln-type: ''
severity: ''
image-ref: trivy-report.json
format: template
template: "@.github/workflows/trivy-csv.tpl"
output: trivy-report.csv

- name: Upload CSV report as an artifact
if: ${{ inputs.export-csv }}
uses: actions/upload-artifact@v3
with:
name: trivy-report
path: trivy-report.csv
45 changes: 45 additions & 0 deletions .github/workflows/common-verify-code.yaml
@@ -0,0 +1,45 @@
name: Verify code

on:
- workflow_call

jobs:
build-and-test:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v1

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
id: go

- name: Install golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.2

- name: Gofmt
run: make format

- name: Build
run: make

- name: Test
run: make test

- name: Golangci-lint
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make golangci-lint

- name: Codecov report
run: bash <(curl -s https://codecov.io/bash)

trivy-scan:
uses: "./.github/workflows/common-trivy.yaml"
with:
upload-to-github-security-tab: true

codeql-scan:
uses: "./.github/workflows/common-codeql.yaml"
23 changes: 23 additions & 0 deletions .github/workflows/publish-devel-images.yaml
@@ -0,0 +1,23 @@
name: Build and publish devel container images

on:
push:
branches: ["master"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
trivy-scan:
uses: "./.github/workflows/common-trivy.yaml"

publish-images:
uses: "./.github/workflows/common-build-images.yaml"
needs: [trivy-scan]
secrets: inherit
with:
publish: true
image-tag: "devel"
github-environment: "staging"

44 changes: 11 additions & 33 deletions .github/workflows/publish-docs.yml
@@ -1,44 +1,22 @@
name: Publish
name: Publish documentation

on:
push:
branches:
- master
- release-*
# Path filters are ignored for tags
paths:
- "docs/**"
- "Makefile"
tags:
- v*
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
update-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Turnstyle
uses: softprops/turnstyle@v1
with:
abort-after-seconds: 600
same-branch-only: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch gh-pages
run: git fetch --no-tags --prune --depth=1 origin refs/heads/gh-pages:refs/heads/gh-pages

- name: Install build dependencies
run: |
pip3 install --user -r docs/requirements.txt
echo "`python3 -m site --user-base`/bin" >> $GITHUB_PATH

- name: Add docs from this revision to gh-pages
run: |
git config user.name "Github"
git config user.email "no-reply@github.com"
./scripts/build/update-gh-pages.sh

- name: Publish/push to gh-pages
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git gh-pages
uses: "./.github/workflows/common-build-docs.yaml"
with:
publish: true
47 changes: 47 additions & 0 deletions .github/workflows/release.yaml
@@ -0,0 +1,47 @@
name: Build and publish release artifacts

on:
push:
tags: [ 'v*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
trivy-scan:
uses: "./.github/workflows/common-trivy.yaml"
with:
export-csv: true

publish-images:
uses: "./.github/workflows/common-build-images.yaml"
needs: [trivy-scan]
secrets: inherit
with:
publish: true
image-tag: ${{ github.ref_name }}
github-environment: "release"

build-packages:
needs: [trivy-scan]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build packages
run: "make cross-packages Q="

- name: Build vendored dist tarball
run: "make vendored-dist Q="

- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
draft: true
append_body: true
files: |
packages/release-assets/*
vendored-cri-resource-manager-*.tar.gz
29 changes: 29 additions & 0 deletions .github/workflows/trivy-csv.tpl
@@ -0,0 +1,29 @@
{{ range . }}
Trivy Vulnerability Scan Results ({{- .Target -}})
VulnerabilityID,Severity,CVSS Score,Title,Library,Vulnerable Version,Fixed Version,Information URL,Triage Information
{{ range .Vulnerabilities }}
{{- .VulnerabilityID }},
{{- .Severity }},
{{- range $key, $value := .CVSS }}
{{- if (eq $key "nvd") }}
{{- .V3Score -}}
{{- end }}
{{- end }},
{{- quote .Title }},
{{- quote .PkgName }},
{{- quote .InstalledVersion }},
{{- quote .FixedVersion }},
{{- .PrimaryURL }}
{{ else -}}
No vulnerabilities found at this time.
{{ end }}
Trivy Dependency Scan Results ({{ .Target }})
ID,Name,Version,Notes
{{ range .Packages -}}
{{- quote .ID }},
{{- quote .Name }},
{{- quote .Version }}
{{ else -}}
No dependencies found at this time.
{{ end }}
{{ end }}