Skip to content
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
10 changes: 9 additions & 1 deletion .github/workflows/csi_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ on:
required: false
type: string
workflow_dispatch:
inputs:
# A guest built from a vela-os branch publishes only commit-pinned
# pnfsos-<sha> tags, so testing it in an MDS image takes a manual run.
guest_image:
description: "pnfs-os guest image the MDS image is built from"
required: false
type: string
default: docker.io/simplyblock/spdkcsi:pnfsos

env:
IMAGE_NAME: docker.io/simplyblock/spdkcsi
Expand Down Expand Up @@ -186,7 +194,7 @@ jobs:
file: csi-driver/deploy/image/Dockerfile.mds
platforms: linux/amd64,linux/arm64
build-args: |
GUEST_IMAGE=docker.io/simplyblock/spdkcsi:pnfsos
GUEST_IMAGE=${{ inputs.guest_image || 'docker.io/simplyblock/spdkcsi:pnfsos' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha,scope=mds
Expand Down
8 changes: 6 additions & 2 deletions csi-driver/cmd/mds-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// and serves the export service and gRPC's health service there. The health
// is what the pod's readiness follows: the state disk mounted and nfsd running.
// It also watches nfsd and logs its state to the console (nfsd_watchdog.go),
// names the pNFS clients whose data goes through it (mds_data_watch.go),
// and keeps every export's namespace on all its paths (paths.go).
// It holds no credentials. The namespace's connection arrives with each call,
// resolved by the runner.
Expand Down Expand Up @@ -71,6 +72,8 @@ func main() {
stateDir := flag.String("state-dir", nfsexport.NFSStateDir, "Where the state disk is mounted")
watchdog := flag.Duration("nfsd-watchdog-interval", agent.DefaultNFSDWatchdogInterval,
"How often nfsd's threads and pool counters are read and judged; 0 turns the watchdog off")
mdsDataWatch := flag.Duration("mds-data-interval", agent.DefaultMDSDataWatchInterval,
"How often each pNFS client's data through this server is read; 0 turns the watch off")
pathInterval := flag.Duration("path-interval", agent.DefaultPathInterval,
"How often every export's namespace is reconnected over the paths it is missing")
klog.InitFlags(nil)
Expand All @@ -81,7 +84,7 @@ func main() {

ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGINT)
defer stop()
if err := run(ctx, *listen, *stateDir, *watchdog, *pathInterval); err != nil {
if err := run(ctx, *listen, *stateDir, *watchdog, *mdsDataWatch, *pathInterval); err != nil {
klog.Errorf("mds-agent: %v", err)
klog.Flush()
os.Exit(1)
Expand Down Expand Up @@ -115,7 +118,7 @@ func runCommand(ctx context.Context, name string, args ...string) ([]byte, error
return exec.CommandContext(ctx, name, args...).CombinedOutput()
}

func run(ctx context.Context, listen, stateDir string, watchdog, pathInterval time.Duration) error {
func run(ctx context.Context, listen, stateDir string, watchdog, mdsData, pathInterval time.Duration) error {
// No host NQN function: the identity arrives with every call, decided by
// the operator and resolved by the runner.
assembler, err := nfsexport.NewAssembler(
Expand Down Expand Up @@ -160,6 +163,7 @@ func run(ctx context.Context, listen, stateDir string, watchdog, pathInterval ti
StuckLimit: nfsdStuckLimit,
}.Check, healthInterval, healthTimeout)
go agent.RunNFSDWatchdog(ctx, nfsdWatchdog, watchdog)
go agent.RunMDSDataWatch(ctx, &agent.MDSDataWatch{Log: agent.KlogLogger{}}, mdsData)
go keeper.Run(ctx, pathInterval)

lis, err := net.Listen("tcp", listen)
Expand Down
Loading
Loading