-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add deb and rpm pkg config * Using nfpm for deb and rpm packaging * Add packaging step that builds deb and rpm * Run packaging step in CI for testing * Fix failing unit test * Execute only e2e tests in e2e step * Add promtool as dependent step for e2e target in Makefile * Update README for IPMI --------- Signed-off-by: Mahendra Paipuri <[email protected]>
- Loading branch information
1 parent
7b2de36
commit 3d6b8e0
Showing
32 changed files
with
1,013 additions
and
47 deletions.
There are no files selected for viewing
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
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,51 @@ | ||
name: cross-build | ||
run-name: Cross build | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
cross-build: | ||
name: cross-build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21.x | ||
|
||
- name: Install promu | ||
run: | | ||
make promu | ||
go mod download | ||
# These steps are taken from https://circleci.com/developer/orbs/orb/prometheus/prometheus#jobs-publish_release | ||
- name: Setup build environment | ||
run: | | ||
docker version | ||
docker run --privileged linuxkit/binfmt:v0.8 | ||
- name: Cross compile Go packages | ||
run: promu --config .promu-go.yml crossbuild -v | ||
|
||
- name: Cross compile CGo packages | ||
run: | | ||
sed -i -e 's/CGO_BUILD ?= 0/CGO_BUILD ?= 1/g' Makefile | ||
promu --config .promu-cgo.yml crossbuild -v | ||
- name: Create tarballs and checksums | ||
run: | | ||
promu crossbuild tarballs | ||
promu checksum .tarballs | ||
- name: Upload go build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build-go-artifacts | ||
path: | | ||
.build | ||
.tarballs | ||
retention-days: 1 |
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,57 @@ | ||
name: packaging | ||
run-name: Packaging | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
packaging: | ||
name: packaging | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21.x | ||
|
||
- name: Install nfpm | ||
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest | ||
|
||
- name: Download go build artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: build-go-artifacts | ||
|
||
# Build RPM and DEB packages | ||
- name: Build deb and rpm packages | ||
run: | | ||
# Replace any '/' with '-' for non tag workflows | ||
export REF_NAME=$(echo "${GITHUB_REF_NAME//\//-}") | ||
# Strip v from tag name, eg v0.1.0 -> 0.1.0 | ||
export CEEMS_VERSION=$(echo "${REF_NAME//v}") | ||
export GOOS=linux | ||
# Ensure target directory exists | ||
mkdir -p .tarballs | ||
# Build packages | ||
# Use a simple for loop instead of matrix strategy as building packages | ||
# is a very rapid process and we pay more price by repeating all the steps | ||
# if using a matrix strategy | ||
for arch in amd64 arm64; do | ||
for packager in rpm deb; do | ||
for app in ceems_exporter ceems_api_server ceems_lb; do | ||
GOARCH=${arch} nfpm pkg --config build/package/${app}/nfpm.yml --packager ${packager} --target .tarballs/${app}-${CEEMS_VERSION}-${GOOS}-${arch}.${packager} | ||
done | ||
done | ||
done | ||
- name: Upload release artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: release-artifacts | ||
path: .tarballs | ||
retention-days: 1 |
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 |
---|---|---|
|
@@ -58,3 +58,7 @@ data-backup | |
|
||
# Ignore extracted folder | ||
ceems-* | ||
|
||
# Ignore .deb and .rpm files | ||
*.deb | ||
*.rpm |
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.1.0-rc.5 | ||
0.1.0-dev |
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,33 @@ | ||
[Unit] | ||
Description=Prometheus CEEMS API Server | ||
After=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
User=ceemsapi | ||
Group=ceemsapi | ||
ExecStart=/usr/local/bin/ceems_api_server \ | ||
--storage.data.path="/var/lib/ceems_api_server" \ | ||
--storage.data.retention.period="30d" \ | ||
--storage.data.update.interval="15m" \ | ||
--web.config.file=/etc/ceems_api_server/web-config.yml | ||
|
||
SyslogIdentifier=ceems_api_server | ||
Restart=always | ||
RestartSec=1 | ||
StartLimitInterval=0 | ||
|
||
ProtectHome=read-only | ||
ReadWritePaths=/var/lib/ceems_api_server | ||
WorkingDirectory=/var/lib/ceems_api_server | ||
|
||
AmbientCapabilities=CAP_SETUID CAP_SETGID | ||
CapabilityBoundingSet=CAP_SETUID CAP_SETGID | ||
|
||
ProtectSystem=strict | ||
ProtectControlGroups=true | ||
ProtectKernelModules=true | ||
ProtectKernelTunables=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Oops, something went wrong.