Once you’ve written a custom App with the Virtualitics Developer Experience, you will need to leverage the Virtualitics CLI to deploy that App on the Virtualitics AI Platform (VAIP) so you can begin using it!
Prerequisites
To deploy an App, you’ll need to ensure you've installed and configured the CLI. To review how to do so, see this article.
Managing Dependencies
Within your App code, you'll need to install all the necessary Python packages, including the Virtualitics SDK. To see which packages we support, review the article Customizing with Python Packages.
Deploying an App
1. Setup
Navigate to the folder with your active environment that was set up when configuring the Virtualitics SDK and CLI. For more, see this article.
2. Add App To Project Folder
If you haven’t already, add the Python file(s) for your App(s) into your project folder.
Move the code for a tutorial app into the project folder (in this example, the project name is “new_demo”). Once you move a file (e.g. hello_world.py) into that folder, the folder should look like this:
You can also have multiple app files within the same project folder and they will all deploy successfully. For example:
3. Build and Deploy Your App
First, we will build a VAIP App Python wheel file. You must be in the same directory and level as the pyproject.toml file.
In your terminal, type:
vaip build
When prompted with the question “Build a wheel using pyproject.toml in current directory?”, type “y” and press Enter.
If the build was successful, you should receive success messages in the last two lines printed out:
Successfully built new_demo-1.0.1.tar.gz and new_demo-1.0.1-py3-none-any.whl
Successfully built VAIP App, check your /dist directory.
We can now deploy this successfully built whl file to the Virtualitics AI Platform so that we can start using our custom Apps.
In your terminal, type:
vaip deploy
Upon completion, this command will list the Apps that installed, failed to install, and were removed (compared to the previously deployed whl file for this project).
Navigate to your deployment of VAIP (e.g. https://abcd.virtualitics.com) and refresh the page. On the “Home” page under the “Custom” tab, you will see all of your newly deployed custom Apps!
Remove Apps from Deployment
To remove an App from your deployment, simply remove the Python file that defines that App from the project folder and then rerun the build
and deploy
commands.
This will build and deploy a project whl file that does not include the App you removed. Once the deploy
command completes, your removed App should be listed under the “Apps removed” list.
Uninstall Project from Deployment
There may come a time where you want to purge all of your work from a deployment. To accomplish this, leverage the destroy
command.
In your terminal, type:
vaip destroy
Once the command is run, you'll be prompted for a project name to delete (ie, name in pyproject.toml). In the example folders above the project name is new_demo.
This command deletes the VAIP module defined by the project name, and all the Apps of that module. However, the files will still live on your local machine. If you want these Apps back on the deployment, simply rebuild and redeploy them.