From d51bc351fb34082173bfb6f15f4ace05f8290206 Mon Sep 17 00:00:00 2001 From: Blake Devcich Date: Tue, 1 Oct 2024 14:00:01 -0500 Subject: [PATCH] update sos --- go.mod | 2 +- go.sum | 4 ++-- internal/controller/datamovement_controller.go | 5 ++--- .../nnf-sos/api/v1alpha2/nnfdatamovementprofile_types.go | 4 ++-- .../bases/nnf.cray.hpe.com_nnfdatamovementprofiles.yaml | 9 ++++----- vendor/modules.txt | 2 +- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 8c26c82a..8953ab1d 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20240925185149-26d9d6071a1c - github.com/NearNodeFlash/nnf-sos v0.0.1-0.20240925191626-b418b8044027 + github.com/NearNodeFlash/nnf-sos v0.0.1-0.20241001184546-1305185d0cbd github.com/onsi/ginkgo/v2 v2.17.1 github.com/onsi/gomega v1.32.0 github.com/prometheus/client_golang v1.16.0 diff --git a/go.sum b/go.sum index 8cba75a7..b8622e2a 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20240925185149-26d9d6071a1c github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20240925185149-26d9d6071a1c/go.mod h1:3wENUqk1b7V0q5L5kNQ2ZE3z/NywL4sqXqVYolsiJ94= github.com/NearNodeFlash/nnf-ec v0.0.1-0.20240912200758-f862bc773739 h1:T49ixk8TBeiYQ3CPpx463GL2gKk94dD9nXpoLBfdmqg= github.com/NearNodeFlash/nnf-ec v0.0.1-0.20240912200758-f862bc773739/go.mod h1:oxdwMqfttOF9dabJhqrWlirCnMk8/8eyLMwl+hducjk= -github.com/NearNodeFlash/nnf-sos v0.0.1-0.20240925191626-b418b8044027 h1:5mdG1KNxPdN7TRpZBk11TBEigA2HIkgK/9neruqOZSs= -github.com/NearNodeFlash/nnf-sos v0.0.1-0.20240925191626-b418b8044027/go.mod h1:dZD9Kx+kHdKCig6My2uA3JNU0Hy8Sz7vb4A+RZel3m4= +github.com/NearNodeFlash/nnf-sos v0.0.1-0.20241001184546-1305185d0cbd h1:/hI3IVlKCKGFDiyqoPpiazWAnC1qhjMKAf+ARv35t2o= +github.com/NearNodeFlash/nnf-sos v0.0.1-0.20241001184546-1305185d0cbd/go.mod h1:dZD9Kx+kHdKCig6My2uA3JNU0Hy8Sz7vb4A+RZel3m4= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= diff --git a/internal/controller/datamovement_controller.go b/internal/controller/datamovement_controller.go index 771883bf..0e80653c 100644 --- a/internal/controller/datamovement_controller.go +++ b/internal/controller/datamovement_controller.go @@ -896,10 +896,9 @@ func createDestinationDir(profile *nnfv1alpha2.NnfDataMovementProfile, dm *nnfv1 return nil } - // TODO mkdir command? // Use setpriv to create the directory with the specified UID/GID - cmd := fmt.Sprintf("mpirun --allow-run-as-root --hostfile %s -- setpriv --euid %d --egid %d --clear-groups mkdir -p %s", - mpiHostfile, dm.Spec.UserId, dm.Spec.GroupId, dest) + cmd := fmt.Sprintf("setpriv --euid %d --egid %d --clear-groups mpirun --hostfile %s mkdir -p %s", + dm.Spec.UserId, dm.Spec.GroupId, mpiHostfile, dest) output, err := command.Run(cmd, log) if err != nil { return fmt.Errorf("data movement mkdir failed ('%s'): %w output: %s", cmd, err, output) diff --git a/vendor/github.com/NearNodeFlash/nnf-sos/api/v1alpha2/nnfdatamovementprofile_types.go b/vendor/github.com/NearNodeFlash/nnf-sos/api/v1alpha2/nnfdatamovementprofile_types.go index cb2b2301..271bc06f 100644 --- a/vendor/github.com/NearNodeFlash/nnf-sos/api/v1alpha2/nnfdatamovementprofile_types.go +++ b/vendor/github.com/NearNodeFlash/nnf-sos/api/v1alpha2/nnfdatamovementprofile_types.go @@ -55,7 +55,7 @@ type NnfDataMovementProfileData struct { // GID: Group ID that is inherited from the Workflow // SRC: source for the data movement // DEST destination for the data movement - // +kubebuilder:default:="ulimit -n 2048 && mpirun --allow-run-as-root --hostfile $HOSTFILE dcp --progress 1 --uid $UID --gid $GID $SRC $DEST" + // +kubebuilder:default:="ulimit -n 2048 && setpriv --euid $UID --egid $GID --clear-groups mpirun --hostfile $HOSTFILE dcp --progress 1 $SRC $DEST" Command string `json:"command"` // If true, enable the command's stdout to be saved in the log when the command completes @@ -92,7 +92,7 @@ type NnfDataMovementProfileData struct { // UID: User ID that is inherited from the Workflow // GID: Group ID that is inherited from the Workflow // PATH: Path to stat - // +kubebuilder:default:="mpirun --allow-run-as-root -np 1 --hostfile $HOSTFILE -- setpriv --euid $UID --egid $GID --clear-groups stat --cached never -c '%F' $PATH" + // +kubebuilder:default:="setpriv --euid $UID --egid $GID --clear-groups mpirun -np 1 --hostfile $HOSTFILE stat --cached never -c '%F' $PATH" StatCommand string `json:"statCommand"` } diff --git a/vendor/github.com/NearNodeFlash/nnf-sos/config/crd/bases/nnf.cray.hpe.com_nnfdatamovementprofiles.yaml b/vendor/github.com/NearNodeFlash/nnf-sos/config/crd/bases/nnf.cray.hpe.com_nnfdatamovementprofiles.yaml index 475817b3..1480e739 100644 --- a/vendor/github.com/NearNodeFlash/nnf-sos/config/crd/bases/nnf.cray.hpe.com_nnfdatamovementprofiles.yaml +++ b/vendor/github.com/NearNodeFlash/nnf-sos/config/crd/bases/nnf.cray.hpe.com_nnfdatamovementprofiles.yaml @@ -165,8 +165,8 @@ spec: description: NnfDataMovementProfileData defines the desired state of NnfDataMovementProfile properties: command: - default: ulimit -n 2048 && mpirun --allow-run-as-root --hostfile $HOSTFILE - dcp --progress 1 --uid $UID --gid $GID $SRC $DEST + default: ulimit -n 2048 && setpriv --euid $UID --egid $GID --clear-groups + mpirun --hostfile $HOSTFILE dcp --progress 1 $SRC $DEST description: |- Command to execute to perform data movement. $VARS are replaced by the nnf software and must be present in the command. @@ -225,9 +225,8 @@ spec: minimum: 0 type: integer statCommand: - default: mpirun --allow-run-as-root -np 1 --hostfile $HOSTFILE -- - setpriv --euid $UID --egid $GID --clear-groups stat --cached never - -c '%F' $PATH + default: setpriv --euid $UID --egid $GID --clear-groups mpirun -np + 1 --hostfile $HOSTFILE stat --cached never -c '%F' $PATH description: |- If CreateDestDir is true, then use StatCommand to perform the stat commands. Use setpriv to stat the path with the specified UID/GID. diff --git a/vendor/modules.txt b/vendor/modules.txt index a2c4a037..8b46aa06 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -10,7 +10,7 @@ github.com/NearNodeFlash/lustre-fs-operator/config/crd/bases # github.com/NearNodeFlash/nnf-ec v0.0.1-0.20240912200758-f862bc773739 ## explicit; go 1.19 github.com/NearNodeFlash/nnf-ec/pkg/rfsf/pkg/models -# github.com/NearNodeFlash/nnf-sos v0.0.1-0.20240925191626-b418b8044027 +# github.com/NearNodeFlash/nnf-sos v0.0.1-0.20241001184546-1305185d0cbd ## explicit; go 1.21 github.com/NearNodeFlash/nnf-sos/api/v1alpha2 github.com/NearNodeFlash/nnf-sos/config/crd/bases