mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
BUILD_PROFILE=full; by default mlsupport is excluded
This commit is contained in:
parent
b7d1970ec1
commit
d841c65b8d
8 changed files with 21 additions and 12 deletions
12
Makefile
12
Makefile
|
@ -141,7 +141,8 @@ COMPONENTS := \
|
|||
datasource_s3 \
|
||||
datasource_syslog \
|
||||
datasource_wineventlog \
|
||||
cscli_setup
|
||||
cscli_setup \
|
||||
mlsupport
|
||||
|
||||
comma := ,
|
||||
space := $(empty) $(empty)
|
||||
|
@ -151,6 +152,9 @@ space := $(empty) $(empty)
|
|||
# keep only datasource-file
|
||||
EXCLUDE_MINIMAL := $(subst $(space),$(comma),$(filter-out datasource_file,,$(COMPONENTS)))
|
||||
|
||||
# ml-support requires pre-built static libraries and weights 20MB
|
||||
EXCLUDE_DEFAULT := mlsupport
|
||||
|
||||
# example
|
||||
# EXCLUDE_MEDIUM := datasource_kafka,datasource_kinesis,datasource_s3
|
||||
|
||||
|
@ -159,8 +163,10 @@ BUILD_PROFILE ?= default
|
|||
# Set the EXCLUDE_LIST based on the chosen profile, unless EXCLUDE is already set
|
||||
ifeq ($(BUILD_PROFILE),minimal)
|
||||
EXCLUDE ?= $(EXCLUDE_MINIMAL)
|
||||
else ifneq ($(BUILD_PROFILE),default)
|
||||
$(error Invalid build profile specified: $(BUILD_PROFILE). Valid profiles are: minimal, default)
|
||||
else ifeq ($(BUILD_PROFILE),default)
|
||||
EXCLUDE ?= $(EXCLUDE_DEFAULT)
|
||||
else ifneq ($(BUILD_PROFILE),full)
|
||||
$(error Invalid build profile specified: $(BUILD_PROFILE). Valid profiles are: minimal, default, full)
|
||||
endif
|
||||
|
||||
# Create list of excluded components from the EXCLUDE variable
|
||||
|
|
|
@ -17,12 +17,12 @@ var Built = map[string]bool{
|
|||
"datasource_kafka": false,
|
||||
"datasource_kinesis": false,
|
||||
"datasource_loki": false,
|
||||
"datasource_ml": false,
|
||||
"datasource_s3": false,
|
||||
"datasource_syslog": false,
|
||||
"datasource_wineventlog": false,
|
||||
"datasource_http": false,
|
||||
"cscli_setup": false,
|
||||
"mlsupport": false,
|
||||
}
|
||||
|
||||
func Register(name string) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//go:build !no_datasource_ml
|
||||
//go:build !no_mlsupport
|
||||
|
||||
package exprhelpers
|
||||
|
||||
|
@ -13,13 +13,16 @@ import (
|
|||
|
||||
var robertaInferencePipeline *ml.RobertaClassificationInferencePipeline
|
||||
|
||||
//nolint:gochecknoinits
|
||||
func init() {
|
||||
component.Register("mlsupport")
|
||||
}
|
||||
|
||||
func InitRobertaInferencePipeline(modelBundleFilename string, datadir string) error {
|
||||
var err error
|
||||
|
||||
fmt.Println("Initializing Roberta Inference Pipeline")
|
||||
|
||||
component.Register("datasource_ml")
|
||||
|
||||
robertaInferencePipeline, err = ml.NewRobertaInferencePipeline(modelBundleFilename, datadir)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//go:build no_datasource_ml
|
||||
//go:build no_mlsupport
|
||||
|
||||
package exprhelpers
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build !no_mlsupport
|
||||
package ml
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//go:build !no_mlsupport
|
||||
package ml
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
//go:build !nomlsupport
|
||||
// +build !nomlsupport
|
||||
//go:build !no_mlsupport
|
||||
|
||||
package ml
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
//go:build !nomlsupport
|
||||
// +build !nomlsupport
|
||||
//go:build !no_mlsupport
|
||||
|
||||
package ml
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue