Skip to content

Commit

Permalink
Remove --nnf-node-name and --node-name from service files
Browse files Browse the repository at this point in the history
Both nnf-dm and clientmountd default to the system hostname if these
options are not provided, so there is no need to keep providing them via
the systemd service file. LLNL does not plan on setting these command
line options to make configuration easier on their end - we should
follow suit.

The formatting for the overrides file has been cleaned up a bit as well.

Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Jan 19, 2024
1 parent a5561fd commit e947f64
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
17 changes: 9 additions & 8 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,21 @@ func (cmd *InstallCmd) Run(ctx *Context) error {
overrideContents += "ExecStart=\n"
overrideContents += "ExecStart=/usr/bin/" + d.Bin + " \\\n"
overrideContents += " --kubernetes-service-host=" + k8sServerHost + " \\\n"
overrideContents += " --kubernetes-service-port=" + k8sServerPort + " \\\n"
overrideContents += " --node-name=" + compute + " "
if !d.SkipNnfNodeName {
overrideContents += "\\\n" + " --nnf-node-name=" + rabbit + " "
}
overrideContents += " --kubernetes-service-port=" + k8sServerPort

// optional command line arguments
if len(token) != 0 {
overrideContents += "\\\n" + " --service-token-file=" + path.Join(serviceTokenPath, "service.token") + " "
overrideContents += " \\\n" + " --service-token-file=" + path.Join(serviceTokenPath, "service.token")
}
if len(cert) != 0 {
overrideContents += "\\\n" + " --service-cert-file=" + path.Join(certFilePath, "service.cert") + " "
overrideContents += " \\\n" + " --service-cert-file=" + path.Join(certFilePath, "service.cert")
}
if len(d.ExtraArgs) > 0 {
overrideContents += "\\\n" + d.ExtraArgs + " "
overrideContents += " \\\n " + d.ExtraArgs
}

// Add environment variables - there should not be a \ on the preceding line
// otherwise the first env var will not work
for _, e := range d.Environment {
overrideContents += "\n" + "Environment=" + e.Name + "=" + e.Value
}
Expand Down
13 changes: 6 additions & 7 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,12 @@ func GetThirdPartyServices(configPath string) ([]ThirdPartyService, error) {
}

type Daemon struct {
Name string `yaml:"name"`
Bin string `yaml:"bin"`
BuildCmd string `yaml:"buildCmd"`
Repository string `yaml:"repository"`
Path string `yaml:"path"`
SkipNnfNodeName bool `yaml:"skipNnfNodeName"`
ServiceAccount struct {
Name string `yaml:"name"`
Bin string `yaml:"bin"`
BuildCmd string `yaml:"buildCmd"`
Repository string `yaml:"repository"`
Path string `yaml:"path"`
ServiceAccount struct {
Name string `yaml:"name"`
Namespace string `yaml:"namespace"`
} `yaml:"serviceAccount,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion config/daemons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ daemons:
buildCmd: make build-daemon
path: bin/
repository: nnf-sos
skipNnfNodeName: true
serviceAccount:
name: nnf-clientmount
namespace: nnf-system
Expand Down

0 comments on commit e947f64

Please sign in to comment.