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

feat: enhance munge key management API #34

Merged
merged 13 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[Makefile]
[{Makefile,go.mod,go.sum,*.go}]
indent_style = tab
indent_size = 4

Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: python3 -m pip install tox
run: |
sudo snap install golangci-lint --classic
python3 -m pip install tox
- name: Run linters
run: tox run -e lint
run: make lint

unit-test:
name: Unit tests
Expand All @@ -49,7 +51,7 @@ jobs:
- name: Install dependencies
run: python3 -m pip install tox
- name: Run tests
run: tox run -e unit
run: make unit

integration-test:
name: Integration tests
Expand Down
38 changes: 32 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,46 @@ FORMAT_YELLOW = \033[0;33m
FORMAT_BLUE = \033[0;34m
FORMAT_END = \033[0m

MUNGECTL := $(CURDIR)/src/mungectl
define INTEGRATION_TESTS
integration-configless
endef

define mungectl
@make -f $(MUNGECTL)/Makefile -C $(MUNGECTL) $(1)
endef

define slurmhelpers
@tox run -e $(1)
endef

##@ Build

.PHONY: snap
snap: ## Build Slurm snap package
@snapcraft -v pack
snap: ## Build snap package
snapcraft -v pack

##@ Lint

.PHONY: fmt
fmt: ## Format snap code
@$(call mungectl, "fmt")
@$(call slurmhelpers, "fmt")

.PHONY:
lint: ## Lint snap code
@$(call mungectl, "lint")
@$(call slurmhelpers, "lint")

##@ Test

define INTEGRATION_TESTS
integration-configless
endef
.PHONY: unit
unit: ## Run snap unit tests
@$(call mungectl, "unit")
@$(call slurmhelpers, "unit")

.PHONY: integration
integration: $(INTEGRATION_TESTS) ## Run Slurm integration tests with gambol
integration: $(INTEGRATION_TESTS) ## Run snap integration tests with gambol

.PHONY: check-snap-exists
check-snap-exists:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ name = "slurm-helpers"
version = "0.1.0"

[tool.setuptools.packages.find]
where = ["src"]
include = ["slurmhelpers"]

# Hook configuration for snaphelpers utility.
Expand Down
8 changes: 8 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ apps:
command: bin/remunge --socket $SNAP_COMMON/run/munge/munged.socket.2
mungekey:
command: sbin/mungekey
mungectl:
command: bin/mungectl

slurmctld:
command: sbin/slurmctld.wrapper
Expand Down Expand Up @@ -189,6 +191,12 @@ parts:
- --with-munge-socket=/var/snap/${SNAPCRAFT_PROJECT_NAME}/common/run/munge/munged.socket.2
- --with-crypto-lib=openssl

mungectl:
source: src/mungectl
plugin: go
build-snaps:
- go/1.22/stable

slurm:
plugin: nil
after: [munge, patch]
Expand Down
Loading