Upload Packages

The platform provides a command-line tool violet, which is used to upload packages downloaded from the Marketplace in the Custom Portal to the platform.

violet supports uploading the following types of packages:

  • Operator
  • Cluster Plugin
  • Helm Chart

When the status of a package in Cluster Plugins or OperatorHub is shown as Absent, you need to use this tool to upload the corresponding package.

The upload process of violet mainly includes the following steps:

  1. Extract and retrieve information from the package
  2. Push images to the image registry
  3. Create Artifact and ArtifactVersion resources on the platform

TOC

Download the Tool

Supported operating systems and architectures

  • Linux, macOS, Windows
  • Both Linux and macOS support x86 and ARM architectures

Steps to download

  1. Log into the Web Console of the global cluster and switch to Administrator view.
  2. Navigate to Marketplace > Upload Packages.
  3. Click Download Packaging and Listing Tool.
  4. Select the binary that matches your operating system and architecture.

After downloading, install the tool on your server or PC.

For Linux or macOS

For non-root users:

# Linux x86
sudo mv -f violet_linux_amd64 /usr/local/bin/violet && sudo chmod +x /usr/local/bin/violet
# Linux ARM
sudo mv -f violet_linux_arm64 /usr/local/bin/violet && sudo chmod +x /usr/local/bin/violet
# macOS x86
sudo mv -f violet_darwin_amd64 /usr/local/bin/violet && sudo chmod +x /usr/local/bin/violet
# macOS ARM
sudo mv -f violet_darwin_arm64 /usr/local/bin/violet && sudo chmod +x /usr/local/bin/violet

For root users:

# Linux x86
mv -f violet_linux_amd64 /usr/bin/violet && chmod +x /usr/bin/violet
# Linux ARM
mv -f violet_linux_arm64 /usr/bin/violet && chmod +x /usr/bin/violet
# macOS x86
mv -f violet_darwin_amd64 /usr/bin/violet && chmod +x /usr/bin/violet
# macOS ARM
mv -f violet_darwin_arm64 /usr/bin/violet && chmod +x /usr/bin/violet

For Windows

  1. Download the file and rename it to violet.exe, or use PowerShell to rename it:

    # Windows x86
    mv -Force violet_windows_amd64.exe violet.exe
  2. Run the tool in PowerShell.

Note: If the tool path is not added to your environment variables, you must specify the full path when running commands.

Prerequisites

Permission requirements

  • You must provide a valid platform user account (username and password).
  • The account must have the role property set to System and the role name must be platform-admin-system.

Note: If the role property of your account is set to Custom, you cannot use this tool.

Using the Tool

The following examples illustrate common usage scenarios.

View Package Information

Before uploading a package, use the violet show command to preview its details.

violet show topolvm-operator.v2.3.0.tgz
Name: NativeStor
Type: bundle
Arch: [linux/amd64]
Version: 2.3.0

violet show topolvm-operator.v2.3.0.tgz --all
Name: NativeStor
Type: bundle
Arch: []
Version: 2.3.0
Artifact: harbor.demo.io/acp/topolvm-operator-bundle:v3.11.0
RelateImages: [harbor.demo.io/acp/topolvm-operator:v3.11.0 harbor.demo.io/acp/topolvm:v3.11.0 harbor.demo.io/3rdparty/k8scsi/csi-provisioner:v3.00 ...]

Upload an Operator to Multiple Clusters

Use the --clusters parameter to specify the target clusters.

violet push opensearch-operator.v3.14.2.tgz \
  --platform-address https://192.168.0.1 \
  --platform-username <user> \
  --platform-password <password> \
  --clusters region1,region2

Note: If --clusters is not specified, the Operator is uploaded to the global cluster by default.

Upload a Cluster Plugin

violet push plugins-cloudedge-v0.3.16-hybrid.tgz \
  --platform-address https://192.168.0.1 \
  --platform-username <user> \
  --platform-password <password>

Note: You do not need to specify the --clusters parameter when uploading a Cluster Plugin, as the platform will automatically distribute it based on its affinity configuration. If you specify --clusters, the parameter will be ignored.

Upload All Packages in a Directory

When multiple packages are downloaded from the Marketplace, you can place them in the same directory and upload them all at once:

violet push <packages_dir_name> \
  --platform-address https://192.168.0.1 \
  --platform-username <user> \
  --platform-password <password>

The tool automatically detects the package types in the directory.

Upload a Helm Chart

Upload a Helm Chart to the chart repository:

violet push plugins-cloudedge-v0.3.16-hybrid.tgz \
  --platform-address https://192.168.0.1 \
  --platform-username <user> \
  --platform-password <password>

Note: Helm Charts can only be uploaded to the default public-charts repository provided by the platform.

For more details, run:

violet --help