From 63b62a7a4fd84f2134e727ce18ac824c9ab020ff Mon Sep 17 00:00:00 2001
From: Nate Rini <nate@schedmd.com>
Date: Thu, 1 Jul 2021 15:22:38 -0600
Subject: [PATCH] Revert "Add OCI container parameters to slurm.conf"

This reverts commit 37b2792775995adbab5d720ff4ea7d731b9290da.
---
 doc/man/man5/slurm.conf.5        | 28 ----------------------------
 slurm/slurm.h.in                 |  2 --
 src/api/config_info.c            | 10 ----------
 src/common/read_config.c         | 12 ------------
 src/common/read_config.h         |  2 --
 src/common/slurm_protocol_pack.c |  6 ------
 src/slurmctld/proc_req.c         |  3 ---
 7 files changed, 63 deletions(-)

diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5
index 3d12d6a5c37..d4dd740db71 100644
--- a/doc/man/man5/slurm.conf.5
+++ b/doc/man/man5/slurm.conf.5
@@ -1192,34 +1192,6 @@ the job step being killed. Using JobAcctGather is polling based and there is a
 delay before a job is killed, which could lead to system Out of Memory events.
 .RE
 
-.TP
-\fBOCIRunTime\fR
-Path to the OCI compliant runtime to start container tasks.
-.sp
-Default: /usr/sbin/runc
-
-.TP
-\fBOCIContainerIDPattern\fR
-Pattern to use to generate <container id> passed to OCI runtime. Certain OCI
-runtimes may have different rules or requirements on <container id> field.
-.sp
-Default: %n.%u.%j.%s.%t
-.sp
-Possible replacements:
-.IP \(bu 10
-%% - replace as "%"
-.IP \(bu
-%j - replace as numeric job id
-.IP \(bu
-%n - replace as nodename
-.IP \(bu
-%s - replace as numeric step id
-.IP \(bu
-%t - replace as numeric step task id
-.IP \(bu
-%u - replace as user name
-.RE
-
 .TP
 \fBJobCompHost\fR
 The name of the machine hosting the job completion database.
diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in
index d357815c574..3fdedf4c36f 100644
--- a/slurm/slurm.h.in
+++ b/slurm/slurm.h.in
@@ -2850,8 +2850,6 @@ typedef struct {
 	char *node_features_plugins; /* List of node_features plugins to use */
 	char *node_prefix;      /* prefix of nodes in partition, only set in
 				   bluegene clusters NULL otherwise */
-	char *oci_runtime;	/* OCI runtime to execute for containers */
-	char *oci_container_id_pattern; /* OCI container id pattern */
 	uint16_t over_time_limit; /* job's time limit can be exceeded by this
 				   * number of minutes before cancellation */
 	char *plugindir;	/* pathname to plugins */
diff --git a/src/api/config_info.c b/src/api/config_info.c
index 0a360f8ae32..e1b7736e0a7 100644
--- a/src/api/config_info.c
+++ b/src/api/config_info.c
@@ -1143,16 +1143,6 @@ extern void *slurm_ctl_conf_2_key_pairs(slurm_conf_t *slurm_ctl_conf_ptr)
 	key_pair->value = xstrdup(tmp_str);
 	list_append(ret_list, key_pair);
 
-	key_pair = xmalloc(sizeof(config_key_pair_t));
-	key_pair->name = xstrdup("OCIRunTime");
-	key_pair->value = xstrdup(slurm_ctl_conf_ptr->oci_runtime);
-	list_append(ret_list, key_pair);
-
-	key_pair = xmalloc(sizeof(config_key_pair_t));
-	key_pair->name = xstrdup("OCIContainerIDPattern");
-	key_pair->value = xstrdup(slurm_ctl_conf_ptr->oci_container_id_pattern);
-	list_append(ret_list, key_pair);
-
 	key_pair = xmalloc(sizeof(config_key_pair_t));
 	key_pair->name = xstrdup("PluginDir");
 	key_pair->value = xstrdup(slurm_ctl_conf_ptr->plugindir);
diff --git a/src/common/read_config.c b/src/common/read_config.c
index 2d0f4502634..7a9ce7fac9b 100644
--- a/src/common/read_config.c
+++ b/src/common/read_config.c
@@ -303,8 +303,6 @@ s_p_options_t slurm_conf_options[] = {
 	{"MpiParams", S_P_STRING},
 	{"NodeFeaturesPlugins", S_P_STRING},
 	{"OverTimeLimit", S_P_UINT16},
-	{"OCIRunTime", S_P_STRING},
-	{"OCIContainerIDPattern", S_P_STRING},
 	{"PluginDir", S_P_STRING},
 	{"PlugStackConfig", S_P_STRING},
 	{"PowerParameters", S_P_STRING},
@@ -2998,8 +2996,6 @@ void init_slurm_conf(slurm_conf_t *ctl_conf_ptr)
 	ctl_conf_ptr->next_job_id		= NO_VAL;
 	xfree(ctl_conf_ptr->node_features_plugins);
 	xfree (ctl_conf_ptr->node_prefix);
-	xfree(ctl_conf_ptr->oci_runtime);
-	xfree(ctl_conf_ptr->oci_container_id_pattern);
 	ctl_conf_ptr->over_time_limit           = 0;
 	xfree (ctl_conf_ptr->plugindir);
 	xfree (ctl_conf_ptr->plugstack);
@@ -4206,14 +4202,6 @@ static int _validate_and_set_defaults(slurm_conf_t *conf,
 		conf->accounting_storage_user = xstrdup("N/A");
 	}
 
-	if (!s_p_get_string(&conf->oci_runtime, "OCIRunTime", hashtbl))
-		conf->oci_runtime = xstrdup(DEFAULT_OCI_RUNTIME);
-
-	if (!s_p_get_string(&conf->oci_container_id_pattern,
-			    "OCIContainerIDPattern", hashtbl))
-		conf->oci_container_id_pattern =
-			xstrdup(DEFAULT_OCI_CONTAINER_ID_PATTERN);
-
 	(void) s_p_get_uint16(&conf->over_time_limit, "OverTimeLimit", hashtbl);
 
 	if (!s_p_get_string(&conf->plugindir, "PluginDir", hashtbl))
diff --git a/src/common/read_config.h b/src/common/read_config.h
index 8b335326853..38f5a56d91b 100644
--- a/src/common/read_config.h
+++ b/src/common/read_config.h
@@ -127,8 +127,6 @@ extern uint16_t drop_priv_flag;
 #define DEFAULT_MSG_AGGR_WINDOW_MSGS 1
 #define DEFAULT_MSG_AGGR_WINDOW_TIME 100
 #define DEFAULT_MSG_TIMEOUT         10
-#define DEFAULT_OCI_CONTAINER_ID_PATTERN "%n.%u.%j.%s.%t"
-#define DEFAULT_OCI_RUNTIME         "/usr/sbin/runc"
 #define DEFAULT_POWER_PLUGIN        ""
 #if defined WITH_CGROUP
 #  define DEFAULT_PROCTRACK_TYPE      "proctrack/cgroup"
diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c
index 99d3676525a..9a05ed8f1b0 100644
--- a/src/common/slurm_protocol_pack.c
+++ b/src/common/slurm_protocol_pack.c
@@ -4380,8 +4380,6 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, buf_t *buffer,
 		packstr(build_ptr->node_features_plugins, buffer);
 		packstr(build_ptr->node_prefix, buffer);
 
-		packstr(build_ptr->oci_container_id_pattern, buffer);
-		packstr(build_ptr->oci_runtime, buffer);
 		pack16(build_ptr->over_time_limit, buffer);
 
 		packstr(build_ptr->plugindir, buffer);
@@ -5314,10 +5312,6 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpackstr_xmalloc(&build_ptr->node_prefix,
 		                       &uint32_tmp, buffer);
 
-		safe_unpackstr_xmalloc(&build_ptr->oci_container_id_pattern,
-				       &uint32_tmp, buffer);
-		safe_unpackstr_xmalloc(&build_ptr->oci_runtime,
-				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->over_time_limit, buffer);
 
 		safe_unpackstr_xmalloc(&build_ptr->plugindir,
diff --git a/src/slurmctld/proc_req.c b/src/slurmctld/proc_req.c
index b131b67ab73..10330a76c83 100644
--- a/src/slurmctld/proc_req.c
+++ b/src/slurmctld/proc_req.c
@@ -397,9 +397,6 @@ static void _fill_ctld_conf(slurm_conf_t *conf_ptr)
 	conf_ptr->node_features_plugins = xstrdup(conf->node_features_plugins);
 	conf_ptr->node_prefix         = xstrdup(conf->node_prefix);
 
-	conf_ptr->oci_container_id_pattern =
-		xstrdup(conf->oci_container_id_pattern);
-	conf_ptr->oci_runtime = xstrdup(conf->oci_runtime);
 	conf_ptr->over_time_limit     = conf->over_time_limit;
 
 	conf_ptr->plugindir           = xstrdup(conf->plugindir);
-- 
GitLab