Set up Application Development in an Air-Gapped Environment
C3 AI supports application development within an air-gapped environment. This document outlines the setup steps needed to develop an application in an air-gapped environment, including identifying required libraries and dependencies, adding third-party NPM packages as dependencies to application, and authentication between VS Code and the private NPM registry.
See Configure the C3 Agentic AI Platform to Bundle in an Air-Gapped Environment for instructions on identifying the list of libraries that are required in the private NPM registry for UI development, configuring the application package, and bundling the server-side UI.
Identify required libraries, packages, and dependencies
The C3 AI VS Code Extension (VSCE) supports both backend and frontend application development. Each of these types of development have dependencies in terms of external NPM packages and libraries that are necessary for core development and UI development.
Run the following commands in the C3 AI Console. Go to the application URL to access the C3 AI Console: https://<cluster>/<env>/<app>/static/console/index.html.
Identify core dependencies
To get a list of all the libraries needed for core development, run the following command in the C3 AI Console of your application:
Js.Runtime.forName('js-ide-vscode-client-node')This returns a list of NPM library dependencies in a field called libraries. These are required for any remote application development using VS Code and will need to be added into the private NPM registry that will be used in the air-gapped environment.
Add third-party NPM packages for UI development
In your package, under the metadata/ImplLanguage.Runtime directory, create a file called: js-webpack_c3.json. You can add whatever libraries you need for UI development in this file. See the following example code snippet.
{
"name": "js-webpack_c3",
"libraries": [
"npm @material-ui/core@3.9.4",
"npm react@18.2.0"
]
}In the example above, two libraries (@material-ui/core@3.9.4 and npm react@18.2.0) are added as UI dependencies to your package.
Identify UI dependencies
To get all the libraries needed for UI development, run the following command in the C3 AI Console of your application for:
NpmLibraryManager.inst().mergedRuntime('js-webpack_c3')This returns a list of all libraries that are dependencies for UI development in a field called libraries. Both Open Source and C3 AI-specific libraries are listed and need to be populated in the private NPM registry.
For Open Source libraries, work with your IT department to make sure the libraries are added to the NPM registry.
For C3 AI-specific libraries, these are the libraries that begin with
@c3/<name of library>. They are automatically downloaded for you and seeded into your private registry when you start UI bundling.
NPM Authentication
Application developers use the C3 AI VSCE to develop, test, and debug applications with the C3 Agentic AI Platform. When application developers connect VS Code to an environment in the C3 Agentic AI Platform, the extension downloads and installs NPM packages.
To connect to authenticate your local VS Code to the air-gapped private NPM registry, do the following:
Open a terminal or command prompt and run the following code snippet to set the private NPM registry and login.
Textnpm config set registry https://<your domain>.com npm loginOnce logged in, authenticate against your registry using one of the following methods that are supported in the C3 Agentic AI Platform:
- Basic Authentication
- Token-based Authentication
SSL Certificate Authentication
If the private NPM registry is configured with HTTPS and uses self-signed certificates or other non-globally trusted certificates, make sure to also configure the application developer machine to trust the certificate authority that signed the NPM registry certificate.
Complete the following steps to make sure the npm installation is verified against the specified SSL certificate.
Open a terminal or command prompt and run the following code snippet:
Textnpm config set cafile <path to your cert> npm config set strict-ssl trueThen, run one of the following:
- Windows:
$env:NODE_EXTRA_CA_CERTS='<path to your cert>' - MacOS:
export NODE_EXTRA_CA_CERTS='<path to your cert>'
- Windows: