Merge branch 'dev' into migrate_svelte5

This commit is contained in:
Christoph Kluge
2025-06-10 10:02:58 +02:00
28 changed files with 457 additions and 499 deletions

View File

@@ -208,7 +208,7 @@ const docTemplate = `{
"200": {
"description": "Success message",
"schema": {
"$ref": "#/definitions/api.DefaultJobApiResponse"
"$ref": "#/definitions/api.DefaultApiResponse"
}
},
"400": {
@@ -278,7 +278,7 @@ const docTemplate = `{
"200": {
"description": "Success message",
"schema": {
"$ref": "#/definitions/api.DefaultJobApiResponse"
"$ref": "#/definitions/api.DefaultApiResponse"
}
},
"400": {
@@ -348,7 +348,7 @@ const docTemplate = `{
"200": {
"description": "Success message",
"schema": {
"$ref": "#/definitions/api.DefaultJobApiResponse"
"$ref": "#/definitions/api.DefaultApiResponse"
}
},
"400": {
@@ -467,7 +467,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
"description": "Job specified in request body will be saved to database as \"running\" with new DB ID.\nJob specifications follow the 'JobMeta' scheme, API will fail to execute if requirements are not met.",
"description": "Job specified in request body will be saved to database as \"running\" with new DB ID.\nJob specifications follow the 'Job' scheme, API will fail to execute if requirements are not met.",
"consumes": [
"application/json"
],
@@ -485,7 +485,7 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schema.JobMeta"
"$ref": "#/definitions/schema.Job"
}
}
],
@@ -493,7 +493,7 @@ const docTemplate = `{
"201": {
"description": "Job added successfully",
"schema": {
"$ref": "#/definitions/api.DefaultJobApiResponse"
"$ref": "#/definitions/api.DefaultApiResponse"
}
},
"400": {
@@ -536,7 +536,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
"description": "Job to stop is specified by request body. All fields are required in this case.\nReturns full job resource information according to 'JobMeta' scheme.",
"description": "Job to stop is specified by request body. All fields are required in this case.\nReturns full job resource information according to 'Job' scheme.",
"produces": [
"application/json"
],
@@ -559,7 +559,7 @@ const docTemplate = `{
"200": {
"description": "Success message",
"schema": {
"$ref": "#/definitions/schema.JobMeta"
"$ref": "#/definitions/schema.Job"
}
},
"400": {
@@ -681,7 +681,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
"description": "Job to get is specified by database ID\nReturns full job resource information according to 'JobMeta' scheme and all metrics according to 'JobData'.",
"description": "Job to get is specified by database ID\nReturns full job resource information according to 'Job' scheme and all metrics according to 'JobData'.",
"produces": [
"application/json"
],
@@ -755,7 +755,7 @@ const docTemplate = `{
"ApiKeyAuth": []
}
],
"description": "Job to get is specified by database ID\nReturns full job resource information according to 'JobMeta' scheme and all metrics according to 'JobData'.",
"description": "Job to get is specified by database ID\nReturns full job resource information according to 'Job' scheme and all metrics according to 'JobData'.",
"consumes": [
"application/json"
],
@@ -833,6 +833,66 @@ const docTemplate = `{
}
}
},
"/api/nodestats/": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns a JSON-encoded list of users.\nRequired query-parameter defines if all users or only users with additional special roles are returned.",
"produces": [
"application/json"
],
"tags": [
"Nodestates"
],
"summary": "Deliver updated Slurm node states",
"parameters": [
{
"description": "Request body containing nodes and their states",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.UpdateNodeStatesRequest"
}
}
],
"responses": {
"200": {
"description": "Success message",
"schema": {
"$ref": "#/definitions/api.DefaultApiResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/api.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/api.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/api.ErrorResponse"
}
}
}
}
},
"/api/users/": {
"get": {
"security": [
@@ -1081,7 +1141,7 @@ const docTemplate = `{
}
}
},
"api.DefaultJobApiResponse": {
"api.DefaultApiResponse": {
"type": "object",
"properties": {
"msg": {
@@ -1175,7 +1235,7 @@ const docTemplate = `{
"description": "Array of jobs",
"type": "array",
"items": {
"$ref": "#/definitions/schema.JobMeta"
"$ref": "#/definitions/schema.Job"
}
},
"page": {
@@ -1198,6 +1258,20 @@ const docTemplate = `{
}
}
},
"api.Node": {
"type": "object",
"properties": {
"hostname": {
"type": "string"
},
"states": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"api.StopJobApiRequest": {
"type": "object",
"required": [
@@ -1231,6 +1305,21 @@ const docTemplate = `{
}
}
},
"api.UpdateNodeStatesRequest": {
"type": "object",
"properties": {
"cluster": {
"type": "string",
"example": "fritz"
},
"nodes": {
"type": "array",
"items": {
"$ref": "#/definitions/api.Node"
}
}
}
},
"schema.Accelerator": {
"type": "object",
"properties": {
@@ -1266,7 +1355,6 @@ const docTemplate = `{
}
},
"schema.Job": {
"description": "Information of a HPC job.",
"type": "object",
"properties": {
"arrayJobId": {
@@ -1364,6 +1452,12 @@ const docTemplate = `{
"type": "string",
"example": "abcd200"
},
"requestedMemory": {
"description": "in MB",
"type": "integer",
"minimum": 1,
"example": 128000
},
"resources": {
"type": "array",
"items": {
@@ -1375,7 +1469,14 @@ const docTemplate = `{
"example": 4
},
"startTime": {
"type": "string"
"type": "integer",
"example": 1649723812
},
"statistics": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/schema.JobStatistics"
}
},
"subCluster": {
"type": "string",
@@ -1423,147 +1524,6 @@ const docTemplate = `{
}
}
},
"schema.JobMeta": {
"description": "Meta data information of a HPC job.",
"type": "object",
"properties": {
"arrayJobId": {
"type": "integer",
"example": 123000
},
"cluster": {
"type": "string",
"example": "fritz"
},
"concurrentJobs": {
"$ref": "#/definitions/schema.JobLinkResultList"
},
"duration": {
"type": "integer",
"minimum": 1,
"example": 43200
},
"energy": {
"type": "number"
},
"energyFootprint": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"exclusive": {
"type": "integer",
"maximum": 2,
"minimum": 0,
"example": 1
},
"footprint": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"id": {
"type": "integer"
},
"jobId": {
"type": "integer",
"example": 123000
},
"jobState": {
"enum": [
"completed",
"failed",
"cancelled",
"stopped",
"timeout",
"out_of_memory"
],
"allOf": [
{
"$ref": "#/definitions/schema.JobState"
}
],
"example": "completed"
},
"metaData": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"monitoringStatus": {
"type": "integer",
"maximum": 3,
"minimum": 0,
"example": 1
},
"numAcc": {
"type": "integer",
"minimum": 1,
"example": 2
},
"numHwthreads": {
"type": "integer",
"minimum": 1,
"example": 20
},
"numNodes": {
"type": "integer",
"minimum": 1,
"example": 2
},
"partition": {
"type": "string",
"example": "main"
},
"project": {
"type": "string",
"example": "abcd200"
},
"resources": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.Resource"
}
},
"smt": {
"type": "integer",
"example": 4
},
"startTime": {
"type": "integer",
"minimum": 1,
"example": 1649723812
},
"statistics": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/schema.JobStatistics"
}
},
"subCluster": {
"type": "string",
"example": "main"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.Tag"
}
},
"user": {
"type": "string",
"example": "abcd100h"
},
"walltime": {
"type": "integer",
"minimum": 1,
"example": 86400
}
}
},
"schema.JobMetric": {
"type": "object",
"properties": {
@@ -1891,6 +1851,9 @@ const docTemplate = `{
},
"remove": {
"type": "boolean"
},
"unit": {
"$ref": "#/definitions/schema.Unit"
}
}
},

View File

@@ -28,11 +28,6 @@ import (
"github.com/gorilla/mux"
)
// DefaultApiResponse model
type DefaultJobApiResponse struct {
Message string `json:"msg"`
}
// StopJobApiRequest model
type StopJobApiRequest struct {
JobId *int64 `json:"jobId" example:"123000"`
@@ -224,7 +219,7 @@ func (api *RestApi) getJobs(rw http.ResponseWriter, r *http.Request) {
// @summary Get job meta and optional all metric data
// @tags Job query
// @description Job to get is specified by database ID
// @description Returns full job resource information according to 'JobMeta' scheme and all metrics according to 'JobData'.
// @description Returns full job resource information according to 'Job' scheme and all metrics according to 'JobData'.
// @produce json
// @param id path int true "Database ID of Job"
// @param all-metrics query bool false "Include all available metrics"
@@ -316,7 +311,7 @@ func (api *RestApi) getCompleteJobById(rw http.ResponseWriter, r *http.Request)
// @summary Get job meta and configurable metric data
// @tags Job query
// @description Job to get is specified by database ID
// @description Returns full job resource information according to 'JobMeta' scheme and all metrics according to 'JobData'.
// @description Returns full job resource information according to 'Job' scheme and all metrics according to 'JobData'.
// @accept json
// @produce json
// @param id path int true "Database ID of Job"
@@ -637,11 +632,11 @@ func (api *RestApi) removeTags(rw http.ResponseWriter, r *http.Request) {
// @summary Adds a new job as "running"
// @tags Job add and modify
// @description Job specified in request body will be saved to database as "running" with new DB ID.
// @description Job specifications follow the 'JobMeta' scheme, API will fail to execute if requirements are not met.
// @description Job specifications follow the 'Job' scheme, API will fail to execute if requirements are not met.
// @accept json
// @produce json
// @param request body schema.JobMeta true "Job to add"
// @success 201 {object} api.DefaultJobApiResponse "Job added successfully"
// @param request body schema.Job true "Job to add"
// @success 201 {object} api.DefaultApiResponse "Job added successfully"
// @failure 400 {object} api.ErrorResponse "Bad Request"
// @failure 401 {object} api.ErrorResponse "Unauthorized"
// @failure 403 {object} api.ErrorResponse "Forbidden"
@@ -705,7 +700,7 @@ func (api *RestApi) startJob(rw http.ResponseWriter, r *http.Request) {
log.Printf("new job (id: %d): cluster=%s, jobId=%d, user=%s, startTime=%d", id, req.Cluster, req.JobID, req.User, req.StartTime)
rw.Header().Add("Content-Type", "application/json")
rw.WriteHeader(http.StatusCreated)
json.NewEncoder(rw).Encode(DefaultJobApiResponse{
json.NewEncoder(rw).Encode(DefaultApiResponse{
Message: "success",
})
}
@@ -714,10 +709,10 @@ func (api *RestApi) startJob(rw http.ResponseWriter, r *http.Request) {
// @summary Marks job as completed and triggers archiving
// @tags Job add and modify
// @description Job to stop is specified by request body. All fields are required in this case.
// @description Returns full job resource information according to 'JobMeta' scheme.
// @description Returns full job resource information according to 'Job' scheme.
// @produce json
// @param request body api.StopJobApiRequest true "All fields required"
// @success 200 {object} schema.JobMeta "Success message"
// @success 200 {object} schema.Job "Success message"
// @failure 400 {object} api.ErrorResponse "Bad Request"
// @failure 401 {object} api.ErrorResponse "Unauthorized"
// @failure 403 {object} api.ErrorResponse "Forbidden"
@@ -762,7 +757,7 @@ func (api *RestApi) stopJobByRequest(rw http.ResponseWriter, r *http.Request) {
// @description Job to remove is specified by database ID. This will not remove the job from the job archive.
// @produce json
// @param id path int true "Database ID of Job"
// @success 200 {object} api.DefaultJobApiResponse "Success message"
// @success 200 {object} api.DefaultApiResponse "Success message"
// @failure 400 {object} api.ErrorResponse "Bad Request"
// @failure 401 {object} api.ErrorResponse "Unauthorized"
// @failure 403 {object} api.ErrorResponse "Forbidden"
@@ -793,7 +788,7 @@ func (api *RestApi) deleteJobById(rw http.ResponseWriter, r *http.Request) {
}
rw.Header().Add("Content-Type", "application/json")
rw.WriteHeader(http.StatusOK)
json.NewEncoder(rw).Encode(DefaultJobApiResponse{
json.NewEncoder(rw).Encode(DefaultApiResponse{
Message: fmt.Sprintf("Successfully deleted job %s", id),
})
}
@@ -805,7 +800,7 @@ func (api *RestApi) deleteJobById(rw http.ResponseWriter, r *http.Request) {
// @accept json
// @produce json
// @param request body api.DeleteJobApiRequest true "All fields required"
// @success 200 {object} api.DefaultJobApiResponse "Success message"
// @success 200 {object} api.DefaultApiResponse "Success message"
// @failure 400 {object} api.ErrorResponse "Bad Request"
// @failure 401 {object} api.ErrorResponse "Unauthorized"
// @failure 403 {object} api.ErrorResponse "Forbidden"
@@ -844,7 +839,7 @@ func (api *RestApi) deleteJobByRequest(rw http.ResponseWriter, r *http.Request)
rw.Header().Add("Content-Type", "application/json")
rw.WriteHeader(http.StatusOK)
json.NewEncoder(rw).Encode(DefaultJobApiResponse{
json.NewEncoder(rw).Encode(DefaultApiResponse{
Message: fmt.Sprintf("Successfully deleted job %d", job.ID),
})
}
@@ -855,7 +850,7 @@ func (api *RestApi) deleteJobByRequest(rw http.ResponseWriter, r *http.Request)
// @description Remove all jobs with start time before timestamp. The jobs will not be removed from the job archive.
// @produce json
// @param ts path int true "Unix epoch timestamp"
// @success 200 {object} api.DefaultJobApiResponse "Success message"
// @success 200 {object} api.DefaultApiResponse "Success message"
// @failure 400 {object} api.ErrorResponse "Bad Request"
// @failure 401 {object} api.ErrorResponse "Unauthorized"
// @failure 403 {object} api.ErrorResponse "Forbidden"
@@ -888,7 +883,7 @@ func (api *RestApi) deleteJobBefore(rw http.ResponseWriter, r *http.Request) {
rw.Header().Add("Content-Type", "application/json")
rw.WriteHeader(http.StatusOK)
json.NewEncoder(rw).Encode(DefaultJobApiResponse{
json.NewEncoder(rw).Encode(DefaultApiResponse{
Message: fmt.Sprintf("Successfully deleted %d jobs", cnt),
})
}
@@ -927,7 +922,7 @@ func (api *RestApi) checkAndHandleStopJob(rw http.ResponseWriter, job *schema.Jo
log.Printf("archiving job... (dbid: %d): cluster=%s, jobId=%d, user=%s, startTime=%d, duration=%d, state=%s", job.ID, job.Cluster, job.JobID, job.User, job.StartTime, job.Duration, job.State)
// Send a response (with status OK). This means that erros that happen from here on forward
// Send a response (with status OK). This means that errors that happen from here on forward
// can *NOT* be communicated to the client. If reading from a MetricDataRepository or
// writing to the filesystem fails, the client will not know.
rw.Header().Add("Content-Type", "application/json")

View File

@@ -24,7 +24,7 @@ type UpdateNodeStatesRequest struct {
Cluster string `json:"cluster" example:"fritz"`
}
// this routine assumes that only one of them applies per node
// this routine assumes that only one of them exists per node
func determineState(states []string) schema.NodeState {
for _, state := range states {
switch strings.ToLower(state) {
@@ -46,16 +46,16 @@ func determineState(states []string) schema.NodeState {
// updateNodeStates godoc
// @summary Deliver updated Slurm node states
// @tags node
// @tags Nodestates
// @description Returns a JSON-encoded list of users.
// @description Required query-parameter defines if all users or only users with additional special roles are returned.
// @produce json
// @param request body UpdateNodeStatesRequest true "Request body containing nodes and their states"
// @success 200 {array} api.SuccessResponse "Success"
// @failure 400 {string} string "Bad Request"
// @failure 401 {string} string "Unauthorized"
// @failure 403 {string} string "Forbidden"
// @failure 500 {string} string "Internal Server Error"
// @success 200 {object} api.DefaultApiResponse "Success message"
// @failure 400 {object} api.ErrorResponse "Bad Request"
// @failure 401 {object} api.ErrorResponse "Unauthorized"
// @failure 403 {object} api.ErrorResponse "Forbidden"
// @failure 500 {object} api.ErrorResponse "Internal Server Error"
// @security ApiKeyAuth
// @router /api/nodestats/ [post]
func (api *RestApi) updateNodeStates(rw http.ResponseWriter, r *http.Request) {

View File

@@ -124,6 +124,11 @@ type ErrorResponse struct {
Error string `json:"error"` // Error Message
}
// DefaultApiResponse model
type DefaultApiResponse struct {
Message string `json:"msg"`
}
func handleError(err error, statusCode int, rw http.ResponseWriter) {
log.Warnf("REST ERROR : %s", err.Error())
rw.Header().Add("Content-Type", "application/json")

View File

@@ -361,12 +361,21 @@ func (r *queryResolver) AllocatedNodes(ctx context.Context, cluster string) ([]*
// Node is the resolver for the node field.
func (r *queryResolver) Node(ctx context.Context, id string) (*schema.Node, error) {
panic(fmt.Errorf("not implemented: Node - node"))
repo := repository.GetNodeRepository()
numericId, err := strconv.ParseInt(id, 10, 64)
if err != nil {
log.Warn("Error while parsing job id")
return nil, err
}
return repo.GetNode(numericId, false)
}
// Nodes is the resolver for the nodes field.
func (r *queryResolver) Nodes(ctx context.Context, filter []*model.NodeFilter, order *model.OrderByInput) (*model.NodeStateResultList, error) {
panic(fmt.Errorf("not implemented: Nodes - nodes"))
repo := repository.GetNodeRepository()
nodes, err := repo.QueryNodes(ctx, filter, order)
count := len(nodes)
return &model.NodeStateResultList{Items: nodes, Count: &count}, err
}
// NodeStats is the resolver for the nodeStats field.
@@ -815,10 +824,12 @@ func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} }
// SubCluster returns generated.SubClusterResolver implementation.
func (r *Resolver) SubCluster() generated.SubClusterResolver { return &subClusterResolver{r} }
type clusterResolver struct{ *Resolver }
type jobResolver struct{ *Resolver }
type metricValueResolver struct{ *Resolver }
type mutationResolver struct{ *Resolver }
type nodeResolver struct{ *Resolver }
type queryResolver struct{ *Resolver }
type subClusterResolver struct{ *Resolver }
type (
clusterResolver struct{ *Resolver }
jobResolver struct{ *Resolver }
metricValueResolver struct{ *Resolver }
mutationResolver struct{ *Resolver }
nodeResolver struct{ *Resolver }
queryResolver struct{ *Resolver }
subClusterResolver struct{ *Resolver }
)

View File

@@ -15,13 +15,13 @@ import (
type Hooks struct{}
// Before hook will print the query with it's args and return the context with the timestamp
func (h *Hooks) Before(ctx context.Context, query string, args ...interface{}) (context.Context, error) {
func (h *Hooks) Before(ctx context.Context, query string, args ...any) (context.Context, error) {
log.Debugf("SQL query %s %q", query, args)
return context.WithValue(ctx, "begin", time.Now()), nil
}
// After hook will get the timestamp registered on the Before hook and print the elapsed time
func (h *Hooks) After(ctx context.Context, query string, args ...interface{}) (context.Context, error) {
func (h *Hooks) After(ctx context.Context, query string, args ...any) (context.Context, error) {
begin := ctx.Value("begin").(time.Time)
log.Debugf("Took: %s\n", time.Since(begin))
return ctx, nil

View File

@@ -5,6 +5,7 @@
package repository
import (
"context"
"database/sql"
"encoding/json"
"fmt"
@@ -12,6 +13,7 @@ import (
"sync"
"time"
"github.com/ClusterCockpit/cc-backend/internal/graph/model"
"github.com/ClusterCockpit/cc-backend/pkg/archive"
"github.com/ClusterCockpit/cc-backend/pkg/log"
"github.com/ClusterCockpit/cc-backend/pkg/lrucache"
@@ -177,6 +179,7 @@ func (r *NodeRepository) UpdateNodeState(hostname string, cluster string, nodeSt
return err
}
log.Infof("Added node '%s' to database", hostname)
return nil
} else {
log.Warnf("Error while querying node '%v' from database", id)
@@ -188,7 +191,7 @@ func (r *NodeRepository) UpdateNodeState(hostname string, cluster string, nodeSt
log.Errorf("error while updating node '%s'", hostname)
return err
}
log.Infof("Updated node '%s' in database", hostname)
return nil
}
@@ -211,8 +214,53 @@ func (r *NodeRepository) DeleteNode(id int64) error {
return nil
}
func (r *NodeRepository) QueryNodes() ([]*schema.Node, error) {
return nil, nil
// TODO: Implement order by
func (r *NodeRepository) QueryNodes(
ctx context.Context,
filters []*model.NodeFilter,
order *model.OrderByInput,
) ([]*schema.Node, error) {
query, qerr := SecurityCheck(ctx, sq.Select(jobColumns...).From("node"))
if qerr != nil {
return nil, qerr
}
for _, f := range filters {
if f.Hostname != nil {
query = buildStringCondition("node.hostname", f.Hostname, query)
}
if f.Cluster != nil {
query = buildStringCondition("node.cluster", f.Cluster, query)
}
if f.NodeState != nil {
query = query.Where("node.node_state = ?", f.NodeState)
}
if f.HealthState != nil {
query = query.Where("node.health_state = ?", f.HealthState)
}
}
rows, err := query.RunWith(r.stmtCache).Query()
if err != nil {
queryString, queryVars, _ := query.ToSql()
log.Errorf("Error while running query '%s' %v: %v", queryString, queryVars, err)
return nil, err
}
nodes := make([]*schema.Node, 0, 50)
for rows.Next() {
node := schema.Node{}
if err := rows.Scan(&node.Hostname, &node.Cluster, &node.SubCluster,
&node.NodeState, &node.HealthState); err != nil {
rows.Close()
log.Warn("Error while scanning rows (Nodes)")
return nil, err
}
nodes = append(nodes, &node)
}
return nodes, nil
}
func (r *NodeRepository) ListNodes(cluster string) ([]*schema.Node, error) {

View File

@@ -686,7 +686,7 @@ func (r *JobRepository) jobsMetricStatisticsHistogram(
mainQuery := sq.Select(
fmt.Sprintf(`%s + 1 as bin`, binQuery),
fmt.Sprintf(`count(*) as count`),
`count(*) as count`,
// For Debug: // fmt.Sprintf(`CAST((%f / %d) as INTEGER ) * %s as min`, peak, *bins, binQuery),
// For Debug: // fmt.Sprintf(`CAST((%f / %d) as INTEGER ) * (%s + 1) as max`, peak, *bins, binQuery),
).From("job").Where(

View File

@@ -0,0 +1 @@
alf

View File

@@ -0,0 +1,7 @@
calc_rate
qmdffgen
dynamic
evbopt
explore
black_box
poly_qmdff

View File

@@ -0,0 +1,3 @@
chroma
qdp
qmp

View File

@@ -0,0 +1 @@
cp2k

View File

@@ -0,0 +1 @@
cpmd

View File

@@ -0,0 +1 @@
flame

View File

@@ -1,4 +1,3 @@
GROMACS
gromacs
GMX
gmx
mdrun

View File

@@ -0,0 +1 @@
lmp

View File

@@ -0,0 +1 @@
orca

View File

@@ -1,3 +1,4 @@
python
pip
anaconda
conda

View File

@@ -0,0 +1,3 @@
pw
neb
ph

View File

@@ -0,0 +1,10 @@
dscf
grad
ridft
rdgrad
ricc2
statpt
aoforce
escf
egrad
odft

View File

@@ -1,2 +1 @@
VASP
vasp

View File

@@ -111,7 +111,7 @@ func (t *AppTagger) Match(job *schema.Job) {
for _, a := range t.apps {
tag := a.tag
for _, s := range a.strings {
if strings.Contains(jobscript, s) {
if strings.Contains(strings.ToLower(jobscript), s) {
if !r.HasTag(id, t.tagType, tag) {
r.AddTagOrCreateDirect(id, t.tagType, tag)
break out

View File

@@ -35,8 +35,8 @@ func TestRegister(t *testing.T) {
err := tagger.Register()
noErr(t, err)
if len(tagger.apps) != 4 {
t.Errorf("wrong summary for diagnostic \ngot: %d \nwant: 3", len(tagger.apps))
if len(tagger.apps) != 14 {
t.Errorf("wrong summary for diagnostic \ngot: %d \nwant: 14", len(tagger.apps))
}
}