Cortex Fabric Developer ExtensionThe Fabric Developer Extension is a plugin for VS Code that is used with CognitiveScale's Cortex Fabric Enterprise Platform. It provides Fabric specific support for creating, developing, publishing, invoking, and debugging resources, especially Skills. The Fabric Developer Extension utilizes and shares a configuration file with the Fabric Console and CLI. Work done in the Extension, CLI, and/or Console is shared by all of the Cortex Fabric interfaces. NOTE: You must set a folder context in VS Code before you begin working with the Fabric Developer Extension. FeaturesThe Cortex VS Code Extension allows users to:
ConfigurationAuthenticationWhen you authenticate to the Fabric Developer Extension your instances are automatically added to the Extension. Fabric authentication for the Fabric Developer Extension is implemented using the "Personal Access Token" (PAT) that is provided in the Fabric Console. After you have downloaded the PAT file, use it to authenticate to the Fabric Developer Extension:
The Configuration PanelThe Configuration panel serves as the main configuration point for your interaction with the Fabric Developer Extension. In the Configuration panel you select:
This panel also displays the Fabric version running in the currently active instance, and it shows the current statuses of all of the running services. Active InstanceThe Fabric Developer Extension supports having multiple instances configured with different PAT's at the same time. The extension can only show the state of one instance at a time, and the "Active Instance" line shows which instance is currently active. To change the instance:
Image RepositoriesFabric pulls container images from a repository. Skill images are stored in those containers. By default, most Fabric instances are configured with an internal image repository where Skill images are stored. If your instance stores images in an external repository, the Fabric Developer Extension must be configured with the location of that repository, so your Skill images may be published there.
The URL and namespace work together to identify the registry that images are published to. For example, if your instance was configured to pull images from a registry on DockerHub, the URL would be from Active ProjectTo change the active Fabric Project:
NOTE: You can filter the Project list by typing in the filter box at the top of the list. Workspace Folder LayoutSkills (and other Cortex resources) are generated inside your VSCode workspace using a specific file/folder layout and naming convention. This folder layout is how the Cortex-Code extension is able to identify and automatically handle certain resource operations for you. The layout defines several top-level folders that are containers for specific kinds of Cortex resources. Note that not all Skills will use or require all of these folders.
Each top-level folder contains sub-folders named for each Skill in the workspace. For example, if two Skills have been saved and are named All of the Fabric top-level resources are arranged this way, with Skill names as subfolders. The Skills PanelThe Skills panel shows the current state of the Skills in your active Project and instance. When a local Skill is "published" to a Fabric instance, it appears in the Skills panel. At the top of the Skills panel is a toolbar exposing several functions available to you: Use View filtersBecause many Skills may be published in an instance, the extension provides "View Filters" that allow you to show or hide Skills based on selected attributes. These attributes include:
Create SkillsIn order to easily create a sample Skill or to bootstrap a new Skill project:
The templates provide you with a fully functional Skill that can be built and deployed into your Fabric instance as is. To generate custom Skills edit the template files, then build and deploy the Skills. Delete SkillsTo delete Skills that are saved to your workspace:
Build Skill ImagesAfter you have configured the Skill files and before you deploy a Skill to the Fabric instance, you must build it into a Docker image. Building the image does NOT deploy the Skill to the instance. To build a Skill image:
OR
The extension displays the progress of the build in the status bar at the bottom of the VSCode window. Publish SkillsAfter building the Skill image, it must published or deployed to the Fabric instance to make it available to be invoked/run. After you build the image, it must be pushed to the registry, and the Skill definition must be uploaded to the Fabric instance in order to actually run the Skill in the Kubernetes cluster. To publish Skills:
OR
The extension displays the progress of the build in the status bar at the bottom of the VSCode window. Deployment may take some time depending on several factors, including the type of Skill you are deploying. Your Skill is listed as "Deployed" when the process is complete. Invoke SkillsInvoking the Skill involves the Skill image acting upon a specific collection of data to produce insights. To invoke a Skill, you need to specify:
PayloadsThe data that is passed to a Skill is contained in a payload file, which provides the request to the Input Service Message for a specific Skill. EXAMPLE PAYLOAD:
In the extension each Skill folder has a subfolder named To invoke a Skill:
OR
If more than one payload file has been saved to the Skill's invoke folder, the extension requests that you make a selection. If only one file has been saved, the extension automatically uses it. Payload Template ParametersThe Extension automatically inserts certain information into your payload files when it invokes the Skill. For example, in the following payload file:
When this payload is invoked, the template parameters enclosed in
ActivationsOnce a Skill is invoked, Fabric generates an activation ID, so you can identify and track the invocation within the cluster. In the Skills panel, pending and completed activations can be viewed. To view activation results:
Viewing Skill LogsThe Skill type For the longer-running daemons, the log output is viewable in the Extension during runtime. To view the log:
Debugging SkillsAfter a Skill has been saved, and the image has been built, the Skill can be invoked locally for the purpose of debugging. To debug a job:
EXAMPLE: Simple job Skill
A container is created and the Skill image with the appropriate payload is launched in the extension. The Skill stops on the breakpoints. Debugging Daemon SkillsDebugging a daemon is different from debugging a job. To debug a daemon:
When the daemon is running, you can trigger the Skill using curl command, postman collection, or another method. The debugger will stop at breakpoints when requests are received. The Experiments PanelExperiments are instances of ML models (algorithms) that are stored in Fabric. A model may have multiple experiments. This panel displays the model experiments defined in Fabric. In the extension experiments are stored in the top-level Workspace folder named Inside each Skill subfolder is an Experiment RunsEach experiment can have multiple "runs" with varying parameters that are stored in the sub-folder named Each run may have artifacts that are uploaded automatically. Those artifacts are contained in the EXAMPLE:
An experiment named The Types PanelCustom data types that are used by Skills and Service Messages may be configured in Fabric. In the extension these custom types are stored in the top-level To retrieve the type resource definition:
The Managed Content PanelManaged Content is internal storage that is configured for your Fabric instance. You can uploaded data files into Managed Content using the extension. To load data to Managed Content:
The name of the file will be used as the artifact name. To download or delete a Skill resource:
Other Fabric ResourcesThere are other types of Fabric resources displayed in the Fabric Developer Extension that are not currently supported. Additional functionality is being developed. You can remove the unused resources in the Cortex extension by right-clicking the resource and selecting Delete. |