-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at adding CI
- Loading branch information
Showing
10 changed files
with
155 additions
and
33 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
name: build-dev-image | ||
on: [workflow_dispatch] | ||
jobs: | ||
build-dev-image: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to registry | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: ghcr.io | ||
- name: Build dev image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: build/ | ||
pull: true | ||
push: true | ||
tags: ghcr.io/olcf/greggd/dev-image:8.3_20210513 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: build | ||
on: [push] | ||
jobs: | ||
build-binary: | ||
runs-on: ubuntu-20.04 | ||
container: ghcr.io/olcf/greggd/dev-image:8.3_20210513 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Build | ||
run: go build -v ./cmd/greggd/ | ||
- name: Test | ||
run: go test -v ./... | ||
- name: Save artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: greggd | ||
path: greggd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: release | ||
on: {push: {tags: ['*.*.*']}} | ||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
container: ghcr.io/olcf/greggd/dev-image:8.3_20210513 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# No shallow clone | ||
with: | ||
fetch-depth: 0 | ||
- name: Export release vars | ||
id: vars | ||
shell: bash | ||
run: | | ||
echo "::set-output name=version::$(git describe --tags --abbrev=0)" | ||
echo "::set-output name=release::$(git rev-parse --short HEAD)" | ||
- name: Build | ||
run: go build -v ./cmd/greggd/ | ||
- name: Test | ||
run: go test -v ./... | ||
- name: Build RPM | ||
env: | ||
VERSION: ${{ steps.vars.outputs.version }} | ||
RELEASE: ${{ steps.vars.outputs.release }} | ||
run: | | ||
envsubst < build/nfpm-template.yaml > build/nfpm.yaml | ||
nfpm -f build/nfpm.yaml pkg --packager rpm | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: greggd*.rpm | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Docker file for development image for greggd | ||
# | ||
# Builds image with all needed dependecies | ||
# | ||
|
||
FROM centos:8.3.2011 | ||
|
||
LABEL name="greggd-devel" \ | ||
version="centos8.3-297" | ||
|
||
RUN dnf install --enablerepo=powertools -y \ | ||
@development git golang kernel-devel bcc-devel; \ | ||
yum clean all | ||
RUN \ | ||
curl -LO https://github.com/goreleaser/nfpm/releases/download/v2.5.1/nfpm_amd64.rpm; \ | ||
rpm -i nfpm_amd64.rpm; rm nfpm_amd64.rpm | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: "greggd" | ||
arch: "amd64" | ||
version: "${VERSION}" | ||
release: "${RELEASE}" | ||
homepage: "github.com/olcf/greggd" | ||
description: | | ||
Global runtime for eBPF-enabled gathering (w/ gumption) daemon | ||
depends: | ||
- bcc | ||
contents: | ||
- src: ./greggd | ||
dst: /usr/sbin/greggd | ||
- src: ./csrc/** | ||
dst: /usr/share/greggd/c/ | ||
- src: ./init/greggd.service | ||
dst: /usr/lib/systemd/system/greggd.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
globals: | ||
socketPath: /run/greggd.sock | ||
verboseFormat: influx | ||
verbose: true | ||
maxRetryCount: 1 | ||
retryDelay: 100ms | ||
retryExponentialBackoff: true | ||
|
||
# Hash of all programs to load | ||
programs: | ||
- source: /usr/share/greggd/c/opensnoop.c | ||
# Events to bind program to | ||
events: | ||
- type: kprobe | ||
loadFunc: trace_entry | ||
attachTo: do_sys_open | ||
- type: kretprobe | ||
loadFunc: trace_return | ||
attachTo: do_sys_open | ||
# What should we read from | ||
outputs: | ||
- type: BPF_PERF_OUTPUT | ||
id: opensnoop | ||
format: | ||
- name: id | ||
type: u64 | ||
- name: fname | ||
type: char[255] | ||
isTag: true |