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

My release 0.21 from dev branch #115

Open
wants to merge 49 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0f8f66b
nodes: Add partition and feature_set labels to nodes collector
fihuer Dec 13, 2019
f8fb30d
queue: Collect jobs with user, partition and reason information
fihuer Dec 13, 2019
2ff4fba
scheduler: Collect rpc stats
fihuer Dec 13, 2019
7538040
vendor dependencies
fihuer Dec 16, 2019
895c7c6
Merge branch '74_Correct_spec_file_path'
mtds Mar 29, 2022
df50ddf
nodes: Add partition and feature_set labels to nodes collector
fihuer Dec 13, 2019
214e48a
queue: Collect jobs with user, partition and reason information
fihuer Dec 13, 2019
dff6df3
scheduler: Collect rpc stats
fihuer Dec 13, 2019
4b7ac9f
Create go.yml
fihuer Jul 1, 2024
867002b
nodes_tests: Fix tests with new test data according to new way of par…
fihuer Jul 3, 2024
fd17889
lint & static checks fixes
fihuer Jul 3, 2024
8b24889
nodes: Also count the nodes that are not parsed correctly
fihuer Jul 3, 2024
b909964
Merge branch 'master' into rebase_020
fihuer Jul 3, 2024
903630b
Merge pull request #2 from cea-hpc/rebase_020
fihuer Jul 3, 2024
228bd94
Create go-ossf-slsa3-publish.yml
fihuer Jul 3, 2024
fc1338b
Create go.yml
fihuer Jul 3, 2024
641544a
Remove tests that cannot run without slurm
fihuer Jul 3, 2024
73303e7
Update go-ossf-slsa3-publish.yml
fihuer Jul 3, 2024
d6fd92e
Add the "planned" node state
fihuer Jul 3, 2024
c57324f
Add goreleaser configuration files
fihuer Jul 3, 2024
ee0e8a7
Add .slsa-goreleaser.yml configuration file
fihuer Jul 3, 2024
fc28823
Update gpus.go for Slurm>=19.05.0rc1
SckyzO Sep 11, 2024
6721bb3
import packages update
SckyzO Sep 11, 2024
ecc3d5c
Add TLS & BasicAuth support
SckyzO Sep 11, 2024
9efe0d1
update gitignore
SckyzO Sep 11, 2024
b1dd3b1
fix log package + go.sum + rename bin to slurm_exporter
Sep 18, 2024
1ef9293
update README
Sep 18, 2024
3c10b49
Add CGO_ENABLED
Sep 18, 2024
39a5021
update workflow to go 1.20wq
Sep 18, 2024
81776ef
Create FUNDING.yml
SckyzO Oct 9, 2024
7075a83
Update README.md
SckyzO Oct 9, 2024
b4ba665
Update README.md
SckyzO Oct 9, 2024
14fa4d9
Add new metric slurm_node_status
Oct 9, 2024
7e35a22
Merge branch 'master' of github.com:SckyzO/slurm_exporter
Oct 9, 2024
00339fc
replace io/ioutil by io (deprecated)
Oct 9, 2024
614337b
update gitignore
Oct 9, 2024
8a7e81a
update makefile
Oct 9, 2024
b0717ae
update go modules
Oct 9, 2024
12f9363
add Slurm Binaries informations metrics
Oct 9, 2024
7ce0a14
add release workflow
Oct 9, 2024
75d30ad
update slurm_binary_info
Oct 9, 2024
b377b21
update go version
Oct 9, 2024
3866f2d
update workflow
Oct 9, 2024
6e8207f
update workfow
Oct 10, 2024
b3c8a67
dev update workflow
Oct 10, 2024
faef9f9
update
Oct 10, 2024
48e8c8d
Merge branch 'development' into master
SckyzO Jan 14, 2025
ceea63c
Update go-slsa-release.yml
SckyzO Feb 19, 2025
81a78c7
Update go-release.yml
SckyzO Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: sckyzo # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
38 changes: 38 additions & 0 deletions .github/workflows/go-ossf-slsa3-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow lets you compile your Go project using a SLSA3 compliant builder.
# This workflow will generate a so-called "provenance" file describing the steps
# that were performed to generate the final binary.
# The project is an initiative of the OpenSSF (openssf.org) and is developed at
# https://github.com/slsa-framework/slsa-github-generator.
# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier.
# For more information about SLSA and how it improves the supply-chain, visit slsa.dev.

name: SLSA Go releaser
on:
workflow_dispatch:
release:
types: [created]

permissions: read-all

jobs:
# ========================================================================================================================================
# Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project.
# See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file
#=========================================================================================================================================
build:
permissions:
id-token: write # To sign.
contents: write # To upload release assets.
actions: read # To read workflow path.
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
go-version: 1.22.2
# =============================================================================================================
# Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects
# =============================================================================================================

41 changes: 41 additions & 0 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
tags:
- '[0-9]+.*' # Trigger on version tags like 0.20, 1.0, etc.
branches:
- master # Trigger on the master branch
- dev # Trigger on the dev branch
workflow_dispatch: # Allow manual triggering

jobs:
goreleaser:
name: GoReleaser
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the source code
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Set up Go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22 # Match your project's Go version

# Step 3: Install GoReleaser
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v4

# Step 4: Run GoReleaser based on the branch or tag
- name: Run GoReleaser
run: |
if [[ "${GITHUB_REF}" == refs/heads/master || "${GITHUB_REF}" == refs/heads/dev ]]; then
goreleaser --snapshot --rm-dist # Use --snapshot for branches
else
goreleaser release --rm-dist # Create a full release for tags
fi
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_TOKEN }} # Use the GitHub Actions token
56 changes: 56 additions & 0 deletions .github/workflows/go-slsa-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: SLSA Go releaser

on:
push:
tags:
- '[0-9]+.*' # Trigger on version tags like 0.20, 1.0, etc.
branches:
- master
- dev # Also build on master and dev branches
workflow_dispatch: # Allow manual triggering

permissions:
contents: write
id-token: write
actions: read

jobs:
build:
permissions:
id-token: write # Required for signing and SLSA provenance.
contents: write # Needed for uploading release assets.
name: SLSA GoReleaser Build
runs-on: ubuntu-latest
strategy:
matrix:
goarch: [amd64, 386, arm64] # Multi-architecture builds
steps:
# Step 1: Check out the source code
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Set up Go environment
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.2

# Step 3: Build using SLSA generator for Go
- name: Build using SLSA
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
go-version: 1.22.2
# We define architectures directly in the matrix
goarch: ${{ matrix.goarch }}

# Step 4: Upload the artifact to the release if on a tag
- name: Upload binary to GitHub
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "binary-${{ matrix.goarch }}"
asset_name: "slurm_exporter-${{ github.ref_name }}-linux-${{ matrix.goarch }}"
asset_content_type: application/octet-stream
28 changes: 28 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
86 changes: 86 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Release

on:
push:
tags:
- '[0-9]+.*' # Trigger the workflow for tags like 0.20, 1.0, etc.
workflow_dispatch: # Allows manual triggering of the workflow

jobs:
release:
name: Multi-Arch Build and Release
runs-on: ubuntu-latest

strategy:
matrix:
goos: [linux]
goarch: [386, amd64, arm64] # Build for x86, x64, and arm64 architectures
go_version: [1.22]

steps:
# Step 1: Check out the source code from the repository
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up the Go environment
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go_version }}

# Step 3: Install Go dependencies
- name: Install Go dependencies
run: |
go mod tidy
go mod download

# Step 4: Build the binary for each architecture
- name: Build binary for ${{ matrix.goos }}-${{ matrix.goarch }}
run: |
mkdir -p bin
PROJECT_NAME=slurm_exporter
VERSION=${{ github.ref_name || github.event.inputs.version }} # Use the version provided by tag or manual input
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o bin/${PROJECT_NAME}

# Step 5: Create release archives in the desired format
- name: Create release archive for ${{ matrix.goos }}-${{ matrix.goarch }}
run: |
mkdir -p release
PROJECT_NAME=slurm_exporter
VERSION=${{ github.ref_name || github.event.inputs.version }} # Handle manual version input
ARCHIVE_NAME=${PROJECT_NAME}-${VERSION}.${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
tar -czf release/${ARCHIVE_NAME} -C bin ${PROJECT_NAME}

# Step 6: Create a new GitHub release using a custom secret (only once)
- name: Create GitHub Release
if: matrix.goos == 'linux' && matrix.goarch == 'amd64'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_TOKEN }} # Use the custom secret token
with:
tag_name: ${{ github.ref_name || github.event.inputs.version }}
release_name: Release ${{ github.ref_name || github.event.inputs.version }}
body: "Release version ${{ github.ref_name || github.event.inputs.version }} with multi-architecture support."
draft: false
prerelease: false

# Step 7: Define the release URL as an output variable for all steps
- name: Set release upload URL
if: matrix.goos == 'linux' && matrix.goarch == 'amd64'
run: echo "UPLOAD_URL=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV

# Step 8: Upload the release assets for each architecture
- name: Upload Release Asset
env:
UPLOAD_URL: ${{ env.UPLOAD_URL }}
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_TOKEN }} # Use the custom secret for upload
run: |
asset_path=release/slurm_exporter-${{ github.ref_name || github.event.inputs.version }}.${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
asset_name=slurm_exporter-${{ github.ref_name || github.event.inputs.version }}.${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
curl \
-X POST \
-H "Authorization: token ${{ secrets.MY_RELEASE_TOKEN }}" \
-H "Content-Type: application/gzip" \
--data-binary @"$asset_path" \
"${UPLOAD_URL}?name=$asset_name"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
bin/
dist/
go/
*.snap
*.tar.gz*
*.swp
43 changes: 43 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# .goreleaser.yml

project_name: slurm_exporter

# Release configuration
release:
github:
owner: sckyzo # Replace with your GitHub username or organization
name: slurm_exporter
name_template: "{{ .ProjectName }} v{{ .Version }}"

builds:
- id: slurm_exporter
goos:
- linux
- windows
- darwin
goarch:
- amd64
- 386
- arm64
binary: "{{ .ProjectName }}"
main: .
ldflags:
- "-s -w -X main.version={{ .Version }}"
env:
- CGO_ENABLED=0

archives:
- format: tar.gz
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
files:
- README.md
- LICENSE
- CHANGELOG.md
- bin/slurm_exporter

checksum:
name_template: "{{ .ProjectName }}_checksums.txt"

# Define signing settings (if Cosign is set up later)
signs:
- artifacts: checksum
16 changes: 16 additions & 0 deletions .slsa-goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .slsa-goreleaser.yml

version: 1

env:
- CGO_ENABLED=0

# Specify Go options for SLSA build
goos: linux
goarch:
- amd64
- 386
- arm64

# Name of the generated binary (use GoReleaser's `binary` field for naming)
binary: slurm_exporter-{{ .Os }}-{{ .Arch }}
Loading