Once you have an idea what Types, methods, and ActionRuntimes you want in your Package, it's time to put it all together. This serves as an overview for the rules surrounding the creation of a C3 AI Suite package.
As an example, here is a typical directory tree you might find:
- repository.json - myPackageDirectory - package.json - seed - CanonicalTypeName - TypeName.csv - FileSourceCollection - CanonicalTypeName.json - src - canonicals - CanonicalTypeName.c3typ - transforms - TransformCanonicalTypeNameToTypeName.c3typ - types - TypeName.c3typ - TypeName.py - TypeName.js - ui ... - dependencyDirectory - package.json - seed ... - src ... - ui ... ... |
Generally, at the top we have the 'repository.json' file. This describes the repository. Then, we have package subdirectories. One for each package. Within each package subdirectory, we have a 'package.json' file which describes the package, as detailed below.
At the top of your package you need a repository.json file. Here's an example from the base covid datalake repository:
{ "name": "dtiTraining", "version": "1.0.0", "description": "DTI research/training environment", "dependencies": { "base": "7.12.0+1206", "c3aiDataLake": "1.0.4+4", "server": "7.12.0.10137" } } |
The fields of note here are:
Within the package subdirectory, we have the package.json file:
{ "name": "baseCovidDataLake", "description": "Base Covid Datalake", "author": "Matthew Krafczyk <krafczyk.matthew@gmail.com>", "dependencies": [ "covid19DataLake", "uiFramework" ] } |
The fields of note here are:
The seed directory contains seed data for your package. This includes Data for canonicals, .json files defining metrics, AcitionRuntimes, and other Types such as FileSourceCollections.
TheĀ src
directory contains all the .c3typ and method implementation files your package needs. There is no rule about where specific .c3typ files should go, they should just be somewhere under the src
directory. Usually people organize this directory into compartments for broad type categories such as 'types', 'canonicals', and 'transforms'. The implementation files should appear in the same directory as the Type definition that requires them.
See https://developer.c3.ai/docs/7.12.25/topic/resource.
All files for your application UI are placed in the /ui/c3/meta
subdirectory of your application package. This subdirectory contains the:
The /ui/c3/meta/
directory of your package can be organized in any manner desired.
See the official C3 AI developer documentation here for more details.