BUILD_PROFILE=full; by default mlsupport is excluded

This commit is contained in:
marco 2024-11-22 16:29:24 +01:00
parent b7d1970ec1
commit d841c65b8d
8 changed files with 21 additions and 12 deletions

View file

@ -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

View file

@ -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) {

View file

@ -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

View file

@ -1,4 +1,4 @@
//go:build no_datasource_ml
//go:build no_mlsupport
package exprhelpers

View file

@ -1,3 +1,4 @@
//go:build !no_mlsupport
package ml
import (

View file

@ -1,3 +1,4 @@
//go:build !no_mlsupport
package ml
import (

View file

@ -1,5 +1,4 @@
//go:build !nomlsupport
// +build !nomlsupport
//go:build !no_mlsupport
package ml

View file

@ -1,5 +1,4 @@
//go:build !nomlsupport
// +build !nomlsupport
//go:build !no_mlsupport
package ml