For support: support@kinetica.com
-
Clone and rename the repository
container-kml-blackbox-dep-base
-
Rename references to the container name in both
./build.sh
and./publish.sh
to reflect the new name of your container
Derive a class from KineticaBlackBox. This base class is implemented in kinetica_black_box.py)
-
Create a module file for the black box (eg. bb_module.py)
-
In this file, import the base class:
from kinetica_black_box import KineticaBlackBox
- Then, in this file, derive a new class from this:
class MyBlackBox(KineticaBlackBox): def blackbox_function(self, inMap): # Call other functions in this file, in other files or insert blackbox code here # inMap and outMap are dicts() of the input and output parameters
return outMap
- In the main() routine of bb_runner.py, import the new black box class:
from bb_module import MyBlackBox
- Then, also in the main routine, instantiate this class:
bb = MyBlackBox(schema_inbound, schema_outbound, zmq_host, zmq_port, zmq_topic, db_table, db_host, db_port, db_user, db_pass)
- Then call the run method of this object:
bb.run()
- ADD the new black box model file created above to the container image
-
run ./build.sh then ./publish.sh to build the container according to the Docker file instructions and push to DockerHub or a private registry
-
See blackbox pytest and API documentation for details on interacting with the deployed black box