Package: acumos-dcae-model-runner
Acumos DCAE Model RunnerThe Acumos DCAE model runner enables Acumos Python models to be run as if they were
DCAE components.Each Acumos model method is mapped to a subscriber and publisher stream,
with_subscriberand_publishersuffixes respectively. For example,
a model with atransformmethod would havetransform_subscriberandtransform_publisherstreams.The model runner implements DCAE APIs such as health checks and configuration
updates.Theacumos_dcae_model_runnerPython package provides a command line utility
that can be used to instantiate the model runner. See the tutorial for more information.Theacumos_dcae_model_runnerpackage should be installed in the docker image
that is ultimately on-boarded into DCAE. The model runner CLI utility should be
the entry point of that Docker image, as shown in the Dockerfile provided
inexample/directory in the root of theAcumos DCAE Model Runner repository.InstallationTheacumos_dcae_model_runnerpackage can be installed with pip like so:pipinstallacumos_dcae_model_runnerNote: installingacumos_dcae_model_runnerwill also install the latest version
ofdcaeapplib, which is only compatible
with DCAE Dublin or later. To useacumos_dcae_model_runnerwith earlier versions
of DCAE, be sure to pin or bound the version ofdcaeapplibappropriately. Consult
the DCAE documentation for more information.TutorialCLI UsageTo execute the model runner, use the provided CLI:$acumos_dcae_model_runner--helpusage:acumos_dcae_model_runner[-h][--timeoutTIMEOUT][--debug]model_dirpositionalarguments:model_dirDirectorythatcontainseitherthedumpedmodel.ziporitsunzippedcontents.optionalarguments:-h,--helpshowthishelpmessageandexit--timeoutTIMEOUTTimeout(ms)usedwhenfetching.--debugSetsthelogleveltoDEBUGDCAE Onboarding ExampleThepython-dcae-model-runnerrepository has anexample/directory
that shows how an Acumos model can be onboarded as a DCAE component.After executing the steps below, the directory should have this
structure:example/├──Dockerfile├──dcae-artifacts│├──component.json│├──number-out.json│└──numbers-in.json├──example-model│├──metadata.json│├──model.proto│└──model.zip├──example_model.py└──requirements.txtNote:For this example, therequirements.txtfile should reflect the
packages and versions listed inexample-model/metadata.json.Steps1) Create the Acumos modelTheexample_model.pyscript defines a simple Acumos model that can
add two integers together. The following will generateexample-model/:pythonexample_model.py2) Build the docker imagedockerbuild-tacumos-python-model-test:0.1.0.3) Onboard the Acumos model to DCAEThe onboarding procedure involves adding the component and data format
artifacts provided inexample/dcae-artifactsto the DCAE catalog.Refer to the official DCAE onboarding documentation for the full
procedure.Acumos DCAE Model Runner Release Notesv0.1.3Updated major release bound fordcaeapplibv0.1.2Removed dependency link fordcaeapplibv0.1.1Updated dependency link fordcaeapplib. It released a patch that fixed an authentication error. Thedcaeapplibdependency link will be removed oncedcaeapplibis hosted in PyPI.v0.1.0Initial release of the Acumos DCAE Python model runnerContributing GuidelinesTestingWe use a combination oftox,pytest, andflake8to testacumos. Code which is not PEP8 compliant (aside from E501) will be
considered a failing test. You can use tools likeautopep8to
“clean” your code as follows:$pipinstallautopep8$cdpython-dcae-model-runner$autopep8-r--in-place--ignoreE501acumos_dcae_model_runner/Run tox directly:$cdpython-dcae-model-runner$exportWORKSPACE=$(pwd)# env var normally provided by Jenkins$toxYou can also specify certain tox environments to test:$tox-epy34# only test against Python 3.4$tox-eflake8# only lint code