Skip to content

Commit

Permalink
NOTIC: Fix REST API when custom Slurm conf is used
Browse files Browse the repository at this point in the history
  • Loading branch information
rdjjke committed Mar 7, 2025
1 parent e2b8bf9 commit c76dc54
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 0 additions & 2 deletions images/restd/slurm_rest.conf

This file was deleted.

3 changes: 0 additions & 3 deletions images/restd/slurmrestd.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ RUN for pkg in slurm-smd slurm-smd-slurmrestd; do \
# Expose the port used for accessing slurmrestd
EXPOSE 6820

# Copy restd conf file (overwrite AuthType)
COPY restd/slurm_rest.conf /etc/slurm_rest.conf

# Copy & run the entrypoint script
COPY restd/slurmrestd_entrypoint.sh /opt/bin/slurm/
RUN chmod +x /opt/bin/slurm/slurmrestd_entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion images/restd/slurmrestd_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ rm -rf /etc/slurm && ln -s /mnt/slurm-configs /etc/slurm
chown www-data:www-data /usr/sbin/slurmrestd && chmod 500 /usr/sbin/slurmrestd

echo "Start slurmrestd daemon"
exec /usr/sbin/slurmrestd -f /etc/slurm_rest.conf -u www-data -g www-data -a rest_auth/jwt -vvvvvv :6820
exec /usr/sbin/slurmrestd -f /etc/slurm/slurm_rest.conf -u www-data -g www-data -a rest_auth/jwt -vvvvvv :6820
1 change: 1 addition & 0 deletions internal/consts/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
ConfigMapNameSupervisord = supervisord

ConfigMapKeySlurmConfig = "slurm.conf"
ConfigMapKeyRESTConfig = "slurm_rest.conf"
ConfigMapKeyCustomSlurmConfig = "custom_slurm.conf"
ConfigMapKeyCGroupConfig = "cgroup.conf"
ConfigMapKeySpankConfig = "plugstack.conf"
Expand Down
9 changes: 9 additions & 0 deletions internal/render/common/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func RenderConfigMapSlurmConfigs(cluster *values.SlurmCluster, topologyConfig co
},
Data: map[string]string{
consts.ConfigMapKeySlurmConfig: generateSlurmConfig(cluster, topologyConfig).Render(),
consts.ConfigMapKeyRESTConfig: generateRESTConfig().Render(),
consts.ConfigMapKeyCustomSlurmConfig: generateCustomSlurmConfig(cluster).Render(),
consts.ConfigMapKeyCGroupConfig: generateCGroupConfig(cluster).Render(),
consts.ConfigMapKeySpankConfig: generateSpankConfig().Render(),
Expand Down Expand Up @@ -273,6 +274,14 @@ func generateMPIConfig(cluster *values.SlurmCluster) renderutils.ConfigFile {
return res
}

func generateRESTConfig() renderutils.ConfigFile {
res := &renderutils.PropertiesConfig{}
res.AddComment("REST API config")
res.AddPropertyWithConnector("include", consts.ConfigMapKeySlurmConfig, renderutils.SpaceConnector)
res.AddProperty("AuthType", "auth/jwt")
return res
}

// region Security limits

// RenderConfigMapSecurityLimits renders new [corev1.ConfigMap] containing security limits config file
Expand Down

0 comments on commit c76dc54

Please sign in to comment.