Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The artifact scope is either 'user' or 'system'. An artifact in the 'user' scope is added by users through the CLI or RESTful APIMicroservices. A 'user' artifact belongs in a namespace and cannot be accessed in another namespace. A 'system' artifact is an artifact that is available across all namespaces. It is added by placing the artifact in a special directory on either the CDAP Master node(s) or the CDAP Sandbox.

...

Artifacts are managed using the Artifact HTTP RESTful APIsMicroservices.

Deploying an Artifact

An artifact is deployed through the RESTful APIthe Microservices. If it contains an Application class, the artifact can then be used to create applications. Once an artifact is deployed, it cannot be changed, with the exception of snapshot versions of artifacts. Snapshot artifacts can be deployed multiple times, with each deployment overwriting the previous artifact. If a program is using a snapshot artifact, changes made to the artifact are picked up when the program is started. Once a program has started, it is unaffected by changes made to the artifact.

...

System artifacts cannot be added through the RESTful APIMicroservices, but must be added by placing the artifact in a special directory. For Distributed CDAP, this directory is defined by the app.artifact.dir setting in cdap-site.xml. Multiple directories can be defined by separating them with a semicolon. It defaults to /opt/cdap/master/artifacts. For the CDAP Sandbox, the directory is set to the artifacts directory.

Any artifact in the directory will be added to CDAP when it starts up. In addition, a RESTful API call a Microservices call can be made to scan the directory for any new artifacts that may have been added since CDAP started.

...

Our build system creates a JAR named myapp-1.0.0.jar that contains the MyApp class. The JAR is deployed via the RESTful APIMicroservices:

Code Block
curl localhost:11015/v3/namespaces/default/artifacts/myapp --data-binary @myapp-1.0.0.jar

...

We can then manage the lifecycle of the flow using the Application Lifecycle RESTful APIsMicroservices. After it has been running for a while, a bug is found in the code. The development team provides a fix, and myapp-1.0.1.jar is released. The artifact is deployed:

...