mirror of
https://github.com/ClusterCockpit/cc-docker.git
synced 2025-04-18 02:45:56 +02:00
Modified makefile rules
This commit is contained in:
parent
a2374e2b6f
commit
5dcd3ca647
@ -79,6 +79,7 @@ RUN set -x \
|
||||
/var/run/slurmdbd \
|
||||
/var/lib/slurmd \
|
||||
/var/log/slurm \
|
||||
/tmp/pika_debug \
|
||||
/data \
|
||||
&& touch /var/lib/slurmd/node_state \
|
||||
/var/lib/slurmd/front_end_state \
|
||||
|
@ -14,11 +14,11 @@ services:
|
||||
- var_lib_mysql:/var/lib/mysql
|
||||
|
||||
slurmdbd:
|
||||
image: slurm-docker-cluster:${IMAGE_TAG:-21.08}
|
||||
image: slurm-docker-cluster:${IMAGE_TAG:-22.05}
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
SLURM_TAG: ${SLURM_TAG:-slurm-21-08-6-1}
|
||||
SLURM_TAG: ${SLURM_TAG:-slurm-22-05-2-1}
|
||||
command: ["slurmdbd"]
|
||||
container_name: slurmdbd
|
||||
hostname: slurmdbd
|
||||
@ -32,7 +32,7 @@ services:
|
||||
- mysql
|
||||
|
||||
slurmctld:
|
||||
image: slurm-docker-cluster:${IMAGE_TAG:-21.08}
|
||||
image: slurm-docker-cluster:${IMAGE_TAG:-22.05}
|
||||
command: ["slurmctld"]
|
||||
container_name: slurmctld
|
||||
hostname: slurmctld
|
||||
@ -47,7 +47,7 @@ services:
|
||||
- "slurmdbd"
|
||||
|
||||
c1:
|
||||
image: slurm-docker-cluster:${IMAGE_TAG:-21.08}
|
||||
image: slurm-docker-cluster:${IMAGE_TAG:-22.05}
|
||||
command: ["slurmd"]
|
||||
hostname: c1
|
||||
container_name: c1
|
||||
@ -62,7 +62,7 @@ services:
|
||||
- "slurmctld"
|
||||
|
||||
c2:
|
||||
image: slurm-docker-cluster:${IMAGE_TAG:-21.08}
|
||||
image: slurm-docker-cluster:${IMAGE_TAG:-22.05}
|
||||
command: ["slurmd"]
|
||||
hostname: c2
|
||||
container_name: c2
|
||||
|
6
makefile
6
makefile
@ -1,8 +1,8 @@
|
||||
SLURM_ROOT_DIR = /usr
|
||||
SLURM_INC_DIR = /usr/include/slurm
|
||||
SLURM_LIB_DIR = /usr/lib64/slurm
|
||||
SLURM_BUILD = 21.08.6
|
||||
SLURM_BUILD_DIR = /srv/slurm
|
||||
SLURM_BUILD = 22.05.2
|
||||
SLURM_BUILD_DIR = /opt/slurm
|
||||
|
||||
PLUGIN_TYPE = prep
|
||||
PLUGIN_NAME = pika
|
||||
@ -11,7 +11,7 @@ PLUGIN_FILE = $(PLUGIN_TYPE)_$(PLUGIN_NAME).so
|
||||
SRC_FILE = slurm-prep-pika_v4.c
|
||||
|
||||
CC = gcc
|
||||
CFLAGS ?= -Wall -fPIC -g -I$(SLURM_INC_DIR) -I$(SLURM_BUILD_DIR) -I/srv/slurm/src/ -I/srv/slurm
|
||||
CFLAGS ?= -Wall -fPIC -g -I$(SLURM_INC_DIR) -I$(SLURM_BUILD_DIR) -I/opt/slurm/src/ -I/opt/nats.c/src
|
||||
LDFLAGS ?= --shared -L.
|
||||
|
||||
all: $(PLUGIN_FILE)
|
||||
|
@ -4,7 +4,7 @@
|
||||
*****************************************************************************
|
||||
* Written by Mike Arnhold and Frank Winkler
|
||||
*
|
||||
* https://gitlab.hrz.tu-chemnitz.de/pika/pika-packages/-/raw/master/pika-prep-plugin/slurm-prep-pika_v4.c
|
||||
* LICENSE NOTICE ?!?!?!?!
|
||||
\*****************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
@ -22,10 +22,6 @@
|
||||
#include "src/common/parse_time.h"
|
||||
#include "src/common/uid.h"
|
||||
|
||||
#include "src/interfaces/data_parser.h"
|
||||
#include "src/common/data.h"
|
||||
#include "src/common/openapi.h"
|
||||
#include "src/slurmrestd/plugins/openapi/slurmctld/api.h"
|
||||
|
||||
#define P_NAME "PrEp-pika: "
|
||||
#define BUFF_LEN 128
|
||||
@ -322,27 +318,31 @@ extern void prep_p_register_callbacks(prep_callbacks_t *callbacks)
|
||||
extern int prep_p_prolog(job_env_t *job_env, slurm_cred_t *cred)
|
||||
{
|
||||
printf("Started job id: %d\n", job_env->jobid);
|
||||
char *json;
|
||||
job_record_t *job_ptr = find_job_record(job_env->jobid);
|
||||
int rc;
|
||||
internal_error_t _rc = job_ptr_to_json(job_ptr, &json, false);
|
||||
if (_rc) {
|
||||
slurm_error(P_NAME "%s", error_to_string(_rc));
|
||||
rc = SLURM_ERROR;
|
||||
}
|
||||
|
||||
job_info_msg_t *job_info_ptr = NULL;
|
||||
int rc;
|
||||
// Some async task
|
||||
if (rc == SLURM_SUCCESS) {
|
||||
pika_metadata_log(job_ptr->job_id, json, false);
|
||||
|
||||
printf("%s: jobs handler called", __func__);
|
||||
natsConnection *nc = NULL;
|
||||
natsSubscription *sub = NULL;
|
||||
|
||||
rc = slurm_load_job(&job_info_ptr, job_env->jobid, SHOW_ALL | SHOW_DETAIL);
|
||||
// Connects to the default NATS Server running locally
|
||||
natsConnection_ConnectTo(&nc, NATS_DEFAULT_URL);
|
||||
|
||||
if (rc == SLURM_ERROR || rc == SLURM_UNEXPECTED_MSG_ERROR) {
|
||||
printf("Unable to query job: %d\n", job_env->jobid);
|
||||
slurm_free_job_info_msg(job_info_ptr);
|
||||
// Simple publisher to send the given json string to subject "slurm_start_job"
|
||||
natsConnection_PublishString(nc, "slurm_start_job", json);
|
||||
|
||||
return SLURM_ERROR;
|
||||
}
|
||||
|
||||
ctxt_t *ctxt = NULL;
|
||||
// init_connection(context_id, method, parameters, query, tag, resp, auth);
|
||||
DATA_DUMP(ctxt->parser, JOB_INFO_MSG, *job_info_ptr,
|
||||
data_key_set(resp, "jobs"));
|
||||
|
||||
slurm_free_job_info_msg(job_info_ptr);
|
||||
natsSubscription_Destroy(sub);
|
||||
natsConnection_Close(nc);
|
||||
}
|
||||
|
||||
return SLURM_SUCCESS;
|
||||
}
|
||||
@ -350,6 +350,32 @@ extern int prep_p_prolog(job_env_t *job_env, slurm_cred_t *cred)
|
||||
extern int prep_p_epilog(job_env_t *job_env, slurm_cred_t *cred)
|
||||
{
|
||||
printf("Ended job id: %d, exit code: %d\n", job_env->jobid, job_env->exit_code);
|
||||
char *json;
|
||||
job_record_t *job_ptr = find_job_record(job_env->jobid);
|
||||
int rc;
|
||||
internal_error_t _rc = job_ptr_to_json(job_ptr, &json, false);
|
||||
if (_rc) {
|
||||
slurm_error(P_NAME "%s", error_to_string(_rc));
|
||||
rc = SLURM_ERROR;
|
||||
}
|
||||
|
||||
// Some async task
|
||||
if (rc == SLURM_SUCCESS) {
|
||||
pika_metadata_log(job_ptr->job_id, json, false);
|
||||
|
||||
natsConnection *nc = NULL;
|
||||
natsSubscription *sub = NULL;
|
||||
|
||||
// Connects to the default NATS Server running locally
|
||||
natsConnection_ConnectTo(&nc, NATS_DEFAULT_URL);
|
||||
|
||||
// Simple publisher to send the given json string to subject "slurm_start_job"
|
||||
natsConnection_PublishString(nc, "slurm_start_job", json);
|
||||
|
||||
natsSubscription_Destroy(sub);
|
||||
natsConnection_Close(nc);
|
||||
}
|
||||
|
||||
return SLURM_SUCCESS;
|
||||
}
|
||||
|
||||
@ -382,18 +408,6 @@ extern int prep_p_prolog_slurmctld(job_record_t *job_ptr, bool *async)
|
||||
// Some async task
|
||||
if (rc == SLURM_SUCCESS) {
|
||||
pika_metadata_log(job_ptr->job_id, json, false);
|
||||
|
||||
natsConnection *nc = NULL;
|
||||
natsSubscription *sub = NULL;
|
||||
|
||||
// Connects to the default NATS Server running locally
|
||||
natsConnection_ConnectTo(&nc, NATS_DEFAULT_URL);
|
||||
|
||||
// Simple publisher to send the given json string to subject "slurm_start_job"
|
||||
natsConnection_PublishString(nc, "slurm_start_job", json);
|
||||
|
||||
natsSubscription_Destroy(sub);
|
||||
natsConnection_Close(nc);
|
||||
}
|
||||
|
||||
return rc;
|
||||
@ -990,7 +1004,7 @@ static int pika_metadata_log(int job_id, char *json, bool is_epilog)
|
||||
internal_error_t rc = SUCCESS;
|
||||
char file_path[100];
|
||||
sprintf(file_path, "/tmp/pika_debug/pika_prep_%d.log", job_id);
|
||||
//sprintf(file_path, "/var/log/slurm/pika.log");
|
||||
// sprintf(file_path, "/var/log/slurm/pika.log");
|
||||
|
||||
slurm_mutex_lock(&plugin_log_lock);
|
||||
|
||||
@ -1013,4 +1027,5 @@ static int pika_metadata_log(int job_id, char *json, bool is_epilog)
|
||||
slurm_mutex_unlock(&plugin_log_lock);
|
||||
|
||||
return rc >= 0 ? SUCCESS : rc;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user