...
To use this in a project, open the Enrichments tab in the Squirro user interface and press "Add Enrichment". In the resulting dialog, the pipelet can be selected in the drop-down menu.
Using additional files with Pipelets
In many cases, additional files like libraries and pre-trained models must be uploaded and used by a pipelet when it is run.
To accomplish this, additional files can be uploaded and accessed by the pipelet by following these steps:
Specify the additional files in the pipelet upload command. For Example:
Code Block language bash pipelet upload \ --data-file 'resource.txt' \ --cluster <cluster> \ --token <your_token> \ 'pipelet.py' \ 'TestPipelet'
In this example, we are uploading a file "resource.txt" along with the pipelet.
Access the contents of the file(s) from within the pipelet
Code Block language py from squirro.sdk import require, PipeletV1 @require('files') class TestPipelet(PipeletV1): def consume(self, item): with self.files.get_file('resource.txt') as f: data = f.read()
Processing old items
Pipelets are only run for items that are processed in the system after the enrichment has been configured. For information on how to process old items with a pipelet, see Rerunning a Pipelet.
...