### gRPC Local Installation Source: https://github.com/onepanelio/onepanel/blob/master/CONTRIBUTING.md Instructions for installing gRPC locally, including Go package installation and downloading pre-compiled protobuf binaries. Ensure your GOBIN is in your PATH for the generated binaries to be accessible. ```bash go get -u google.golang.org/grpc go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger go get -u github.com/golang/protobuf/protoc-gen-go ``` -------------------------------- ### GET /apis/v1beta1/config Source: https://context7.com/onepanelio/onepanel/llms.txt Retrieves the system configuration, including API URL and node pool options. ```APIDOC ## GET /apis/v1beta1/config ### Description Retrieves the system configuration including API URL and node pool options. ### Method GET ### Endpoint /apis/v1beta1/config ### Response #### Success Response (200) - **apiUrl** (string) - The base API URL - **domain** (string) - The system domain - **fqdn** (string) - The fully qualified domain name - **nodePool** (object) - Configuration for available node pools #### Response Example { "apiUrl": "https://api.onepanel.example.com", "domain": "onepanel.example.com", "fqdn": "api.onepanel.example.com", "nodePool": { "label": "node.kubernetes.io/instance-type", "options": [ {"name": "CPU (4 cores, 16GB)", "value": "cpu-standard"}, {"name": "GPU (Tesla V100)", "value": "gpu-v100"} ] } } ``` -------------------------------- ### Local Database Migrations with Goose Source: https://github.com/onepanelio/onepanel/blob/master/CONTRIBUTING.md Manage database migrations locally using the Goose tool. This involves installing Goose, creating migrations, applying them, rolling back, and accessing help. Up migrations are automatically executed on application start. ```bash go get -u github.com/pressly/goose/cmd/goose goose -dir db/sql create sql # Create migration in db/sql folder goose -dir db postgres "${DB_DATASOURCE_NAME}" up # Migrate the DB to the most recent version available goose -dir db postgres "${DB_DATASOURCE_NAME}" down # Roll back the version by 1 goose help # See all available commands ``` -------------------------------- ### Retrieve System Configuration Source: https://context7.com/onepanelio/onepanel/llms.txt Fetches the global system configuration, including the API URL, domain, and available node pool options. This is a GET request requiring authentication. ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/config" \ -H "Authorization: Bearer " ``` -------------------------------- ### GET /apis/v1beta1/namespaces Source: https://context7.com/onepanelio/onepanel/llms.txt Retrieves a paginated list of namespaces accessible to the authenticated user. ```APIDOC ## GET /apis/v1beta1/namespaces ### Description Returns all namespaces (projects) the authenticated user has access to, with pagination support. ### Method GET ### Endpoint /apis/v1beta1/namespaces ### Parameters #### Query Parameters - **pageSize** (integer) - Optional - Number of items per page - **page** (integer) - Optional - Page number ### Response #### Success Response (200) - **count** (integer) - Number of items in current page - **namespaces** (array) - List of namespace objects - **totalCount** (integer) - Total number of namespaces #### Response Example { "count": 2, "namespaces": [ {"name": "production", "sourceName": "production"}, {"name": "staging", "sourceName": "staging"} ], "page": 1, "pages": 1, "totalCount": 2 } ``` -------------------------------- ### Get Workspace Details Source: https://context7.com/onepanelio/onepanel/llms.txt Retrieves detailed information about a specific workspace. This is useful for monitoring workspace status and configuration. It requires the workspace ID and project name. ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123" \ -H "Authorization: Bearer " ``` -------------------------------- ### Database Migrations with Goose (Docker) Source: https://github.com/onepanelio/onepanel/blob/master/CONTRIBUTING.md Manage database migrations using the Goose tool within a Docker container. Supports creating new migrations, applying them, rolling back, and viewing help. Note that up migrations are automatically executed on application start. ```bash docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel/helper:v1.0.0 goose -dir db/sql create sql # Create migration in db/sql folder docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel/helper:v1.0.0 goose -dir db postgres "${DB_DATASOURCE_NAME}" up # Migrate the DB to the most recent version available docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel/helper:v1.0.0 goose -dir db postgres "${DB_DATASOURCE_NAME}" down # Roll back the version by 1 docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel/helper:v1.0.0 goose help # See all available commands ``` ```bash docker run --rm --mount type=bind,source="%CD%",target=/root onepanel/helper:v1.0.0 goose -dir db/sql create wow sql # Create migration in db/sql folder docker run --rm --mount type=bind,source="%CD%",target=/root onepanel/helper:v1.0.0 goose -dir db postgres "${DB_DATASOURCE_NAME}" up # Migrate the DB to the most recent version available docker run --rm --mount type=bind,source="%CD%",target=/root onepanel/helper:v1.0.0 goose -dir db postgres "${DB_DATASOURCE_NAME}" down # Roll back the version by 1 docker run --rm --mount type=bind,source="%CD%",target=/root onepanel/helper:v1.0.0 goose help # See all available commands ``` -------------------------------- ### Get Workflow Execution Details Source: https://context7.com/onepanelio/onepanel/llms.txt Retrieves comprehensive details for a specific workflow execution, including status and manifest data. ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workflow_executions/wf-xyz789" -H "Authorization: Bearer " ``` -------------------------------- ### GET /workflow_templates/{uid} Source: https://context7.com/onepanelio/onepanel/llms.txt Retrieves a specific workflow template by UID, with optional version support. ```APIDOC ## GET /apis/v1beta1/{project}/workflow_templates/{uid} ### Description Retrieves a specific workflow template by UID, optionally at a specific version. ### Method GET ### Endpoint /apis/v1beta1/{project}/workflow_templates/{uid}[/versions/{version}] ### Parameters #### Path Parameters - **project** (string) - Required - The project identifier. - **uid** (string) - Required - The workflow template UID. - **version** (integer) - Optional - The specific version of the template. ### Response #### Success Response (200) - **template** (object) - The workflow template details. ``` -------------------------------- ### Workspace Management API Source: https://context7.com/onepanelio/onepanel/llms.txt APIs for managing workspaces, including getting details, pausing, resuming, and deleting them. ```APIDOC ## GET /apis/v1beta1/{project}/workspaces/{workspaceId} ### Description Retrieves details of a specific workspace. ### Method GET ### Endpoint /apis/v1beta1/{project}/workspaces/{workspaceId} ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. - **workspaceId** (string) - Required - The ID of the workspace. ### Request Example ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **details** (object) - The workspace details. #### Response Example ```json { "details": "..." } ``` ``` ```APIDOC ## PUT /apis/v1beta1/{project}/workspaces/{workspaceId}/pause ### Description Pauses a running workspace to save resources while preserving state. ### Method PUT ### Endpoint /apis/v1beta1/{project}/workspaces/{workspaceId}/pause ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. - **workspaceId** (string) - Required - The ID of the workspace. ### Request Example ```bash curl -X PUT "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123/pause" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **status** (string) - The status of the workspace after pausing. #### Response Example ```json { "status": "paused" } ``` ``` ```APIDOC ## PUT /apis/v1beta1/{project}/workspaces/{workspaceId}/resume ### Description Resumes a paused workspace, optionally with updated parameters. ### Method PUT ### Endpoint /apis/v1beta1/{project}/workspaces/{workspaceId}/resume ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. - **workspaceId** (string) - Required - The ID of the workspace. #### Request Body - **parameters** (array) - Optional - A list of parameters to update when resuming. - **name** (string) - Required - The name of the parameter. - **value** (string) - Required - The new value for the parameter. ### Request Example ```json { "parameters": [ {"name": "sys-node-pool", "value": "cpu-pool"} ] } ``` ### Request Example (curl) ```bash curl -X PUT "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123/resume" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "parameters": [{"name": "sys-node-pool", "value": "cpu-pool"}] }' ``` ### Response #### Success Response (200) - **status** (string) - The status of the workspace after resuming. #### Response Example ```json { "status": "running" } ``` ``` ```APIDOC ## DELETE /apis/v1beta1/{project}/workspaces/{workspaceId} ### Description Terminates and deletes a workspace. ### Method DELETE ### Endpoint /apis/v1beta1/{project}/workspaces/{workspaceId} ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. - **workspaceId** (string) - Required - The ID of the workspace. ### Request Example ```bash curl -X DELETE "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Workspace deleted successfully." } ``` ``` -------------------------------- ### GET /workflow_executions/{uid}/logs Source: https://context7.com/onepanelio/onepanel/llms.txt Streams container logs from a specific pod in the workflow execution. ```APIDOC ## GET /apis/v1beta1/{project}/workflow_executions/{uid}/pods/{pod}/containers/{container}/logs ### Description Streams container logs from a specific pod in the workflow execution. ### Method GET ### Endpoint /apis/v1beta1/{project}/workflow_executions/{uid}/pods/{pod}/containers/{container}/logs ### Parameters #### Path Parameters - **uid** (string) - Required - The workflow execution UID. - **pod** (string) - Required - The pod name. - **container** (string) - Required - The container name. ### Response #### Success Response (200) - **logEntries** (array) - List of log objects with timestamp and content. ``` -------------------------------- ### Get Resource Labels Source: https://context7.com/onepanelio/onepanel/llms.txt Retrieves labels associated with a specific resource, such as a workflow template. Labels are key-value pairs used for organizing and identifying resources. This operation requires the resource type and ID. ```bash # Get labels for a workflow template curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workflow_templates/abc123/labels" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Workspace Container Logs Source: https://context7.com/onepanelio/onepanel/llms.txt Streams logs from a specific container within a workspace. This is essential for debugging and monitoring application behavior. It requires the workspace ID, container name, and an optional timestamp to filter logs. ```bash # Stream workspace logs curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123/containers/jupyterlab/logs?sinceTime=1705312800" \ -H "Authorization: Bearer " ``` -------------------------------- ### POST /workspaces Source: https://context7.com/onepanelio/onepanel/llms.txt Launches a new development workspace instance from a template. ```APIDOC ## POST /apis/v1beta1/{namespace}/workspaces ### Description Launches a new development workspace instance from a template. ### Method POST ### Endpoint /apis/v1beta1/{namespace}/workspaces ### Request Body - **workspaceTemplateUid** (string) - Required - UID of the template - **workspaceTemplateVersion** (integer) - Required - Version of the template - **parameters** (array) - Optional - Configuration parameters ### Response #### Success Response (200) - **uid** (string) - The unique ID of the created workspace - **url** (string) - Access URL for the workspace ``` -------------------------------- ### Initialize Go Helper Dependencies Source: https://github.com/onepanelio/onepanel/blob/master/helper/README.md Initializes a new Go module for helper tools to ensure dependency consistency. This process involves creating a temporary directory, initializing the module, and updating the go.mod and go.sum files. ```bash go mod init onepanel-tools go mod tidy ``` -------------------------------- ### Generate Release Markdown with Go Source: https://github.com/onepanelio/onepanel/blob/master/cmd/README.md This script automates the creation of release notes in markdown format. It requires a version number and a GitHub username as input arguments and outputs the result to standard output. ```bash go run cmd/gen-release-md/gen-release-md.go -v=0.10.0 -u=[github-username] > /tmp/release.md ``` -------------------------------- ### Manage workspaces Source: https://context7.com/onepanelio/onepanel/llms.txt Operations to create, list, and retrieve workspace instances. Workspaces are launched from templates and require specific parameters like node pools and volume sizes. ```bash # Create a JupyterLab workspace curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/workspaces" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "workspaceTemplateUid": "tpl-jupyter-123", "workspaceTemplateVersion": 1, "parameters": [ {"name": "sys-name", "value": "my-jupyter-workspace"}, {"name": "sys-node-pool", "value": "gpu-pool"}, {"name": "sys-volume-size", "value": "100Gi"} ], "labels": [ {"key": "project", "value": "image-classification"}, {"key": "user", "value": "data-scientist-1"} ] }' # List running workspaces curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workspaces?phase=Running&pageSize=20&page=1" \ -H "Authorization: Bearer " ``` -------------------------------- ### Deploy and Manage Inference Services Source: https://context7.com/onepanelio/onepanel/llms.txt Enables the deployment of machine learning models for inference using KFServing. It allows specifying model details, runtime, and resource requirements. You can also retrieve the status and prediction URL of a deployed service. ```bash # Deploy a TensorFlow model curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/inferenceservice" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "image-classifier", "predictor": { "name": "tensorflow", "runtimeVersion": "2.4.0", "storageUri": "s3://my-bucket/models/classifier", "nodeSelector": "gpu-pool", "minCpu": "1", "minMemory": "4Gi", "maxCpu": "4", "maxMemory": "16Gi" } }' ``` ```bash # Check inference service status curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/inferenceservice/image-classifier" \ -H "Authorization: Bearer " ``` -------------------------------- ### Go Code Structure: utils directory Source: https://github.com/onepanelio/onepanel/blob/master/CONTRIBUTING.md Guidelines for the 'utils' directory in Go projects. Code here should be stand-alone, not track state, and meant to mutate metadata. Avoid OnePanel-specific code like 'Client'. ```shell utils/*.go ``` -------------------------------- ### Go Code Structure: pkg directory Source: https://github.com/onepanelio/onepanel/blob/master/CONTRIBUTING.md Guidelines for the 'pkg' directory in Go projects. Code here must be package-friendly, allowing it to be easily extracted into its own package or a new version directory. Suitable for Kubernetes and database operations, as well as types. ```shell pkg/*.go ``` -------------------------------- ### Create Workflow Template Version Source: https://context7.com/onepanelio/onepanel/llms.txt Creates a new version of an existing workflow template. Requires a manifest string and optional description for version tracking. ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/workflow_templates/abc123/versions" -H "Authorization: Bearer " -H "Content-Type: application/json" -d '{"uid": "abc123", "manifest": "entrypoint: main\narguments:\n parameters:\n - name: epochs\n value: \"20\"\n - name: batch-size\n value: \"32\"\ntemplates:\n- name: main\n dag:\n tasks:\n - name: train\n template: train-model", "description": "Updated with batch size parameter"}' ``` -------------------------------- ### Local API Code Generation Source: https://github.com/onepanelio/onepanel/blob/master/CONTRIBUTING.md Generate Go and Swagger APIs locally by executing the 'make api-internal' command with a specified version. ```bash make api-internal version=1.0.0 ``` -------------------------------- ### Manage Project Namespaces Source: https://context7.com/onepanelio/onepanel/llms.txt Operations for listing existing namespaces and creating new ones to organize ML workflows and workspaces. ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/namespaces?pageSize=10&page=1" \ -H "Authorization: Bearer " curl -X POST "https://onepanel.example.com/apis/v1beta1/namespaces" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "computer-vision-project" }' ``` -------------------------------- ### Build Onepanel Helper Docker Image Source: https://github.com/onepanelio/onepanel/blob/master/helper/README.md Builds the Docker image required for code generation tasks. This command creates an image tagged as onepanel/helper:v1.0.0 using the local Dockerfile. ```bash docker build -t onepanel/helper:v1.0.0 . ``` -------------------------------- ### Manage Workflow Templates Source: https://context7.com/onepanelio/onepanel/llms.txt Create and list reusable workflow templates. Templates define DAGs, parameters, and infrastructure requirements for ML tasks. ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/workflow_templates" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "tensorflow-training", "manifest": "entrypoint: main\narguments:\n parameters:\n - name: epochs\n value: \"10\"\n - name: learning-rate\n value: \"0.001\"\ntemplates:\n- name: main\n dag:\n tasks:\n - name: train\n template: train-model\n- name: train-model\n container:\n image: tensorflow/tensorflow:2.4.0-gpu\n command: [python, train.py]\n args: [\"--epochs={{workflow.parameters.epochs}}\"]\n resources:\n limits:\n nvidia.com/gpu: 1", "labels": [ {"key": "framework", "value": "tensorflow"}, {"key": "type", "value": "training"} ], "description": "TensorFlow model training with GPU support" }' curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workflow_templates?labels=framework%3Dtensorflow&pageSize=20&page=1" \ -H "Authorization: Bearer " ``` -------------------------------- ### Manage Files in Cloud Storage Source: https://context7.com/onepanelio/onepanel/llms.txt Provides functionality to list files within cloud storage (S3, GCS, Azure Blob) and generate presigned URLs for downloading specific files. Listing requires a path and pagination parameters, while download URL generation needs the file path. ```bash # List files in a path curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/files/list/datasets/training?page=1&perPage=100" \ -H "Authorization: Bearer " ``` ```bash # Get download URL curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/files/presigned-url/models/trained-model.h5" \ -H "Authorization: Bearer " ``` -------------------------------- ### API Code Generation with Docker Source: https://github.com/onepanelio/onepanel/blob/master/CONTRIBUTING.md Generate Go and Swagger APIs using Docker. This command mounts the current directory into the container and executes the 'make api-internal' command with a specified version. ```bash docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel/helper:v1.0.0 make api-internal version=1.0.0 ``` ```bash docker run --rm --mount type=bind,source="%CD%",target=/root onepanel/helper:v1.0.0 make api-internal version=1.0.0 ``` -------------------------------- ### Manage workspace templates Source: https://context7.com/onepanelio/onepanel/llms.txt Operations to create and retrieve workspace templates. Templates define the environment configuration, such as container images and resource limits. ```bash # Create a JupyterLab workspace template curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/workspace_templates" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "jupyterlab-gpu", "manifest": "containers:\n- name: jupyterlab\n image: onepanel/jupyterlab:latest\n ports:\n - containerPort: 8888\n resources:\n limits:\n nvidia.com/gpu: 1\n memory: 16Gi\n cpu: 4", "labels": [ {"key": "type", "value": "jupyterlab"}, {"key": "gpu", "value": "true"} ], "description": "JupyterLab with GPU support for deep learning" }' # List workspace templates curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workspace_templates?labels=type%3Djupyterlab" \ -H "Authorization: Bearer " ``` -------------------------------- ### Go Code Structure: cmd directory Source: https://github.com/onepanelio/onepanel/blob/master/CONTRIBUTING.md Structure for the 'cmd' directory in Go projects. Each source file here should result in an executable and be placed in its own folder. This structure helps avoid redeclaration errors during Docker builds. ```shell cmd/flush-cache/flush_cache.go ``` -------------------------------- ### POST /apis/v1beta1/{namespace}/workflow_templates Source: https://context7.com/onepanelio/onepanel/llms.txt Creates a new reusable workflow template within a specific project namespace. ```APIDOC ## POST /apis/v1beta1/{namespace}/workflow_templates ### Description Creates a reusable workflow template with a YAML manifest defining the DAG of tasks, parameters, and resource requirements. ### Method POST ### Endpoint /apis/v1beta1/{namespace}/workflow_templates ### Parameters #### Path Parameters - **namespace** (string) - Required - The project namespace ### Request Body - **name** (string) - Required - Template name - **manifest** (string) - Required - YAML workflow definition - **labels** (array) - Optional - Key-value pairs for filtering ### Request Example { "name": "tensorflow-training", "manifest": "...", "labels": [{"key": "framework", "value": "tensorflow"}] } ``` -------------------------------- ### PUT /apis/v1beta1/{project}/workspaces/{id}/labels Source: https://context7.com/onepanelio/onepanel/llms.txt Replaces all existing labels on a workspace with a new set of labels. ```APIDOC ## PUT /apis/v1beta1/{project}/workspaces/{id}/labels ### Description Replaces all labels on a resource with a new set. ### Method PUT ### Endpoint /apis/v1beta1/{project}/workspaces/{id}/labels ### Parameters #### Path Parameters - **project** (string) - Required - The project identifier - **id** (string) - Required - The workspace identifier #### Request Body - **items** (array) - Required - A list of label objects to replace existing labels ### Request Example { "items": [ {"key": "environment", "value": "production"}, {"key": "team", "value": "ml-platform"} ] } ``` -------------------------------- ### Inference Services API Source: https://context7.com/onepanelio/onepanel/llms.txt APIs for deploying and managing inference services using KFServing. ```APIDOC ## POST /apis/v1beta1/{project}/inferenceservice ### Description Deploys a model for inference using KFServing. ### Method POST ### Endpoint /apis/v1beta1/{project}/inferenceservice ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. #### Request Body - **name** (string) - Required - The name of the inference service. - **predictor** (object) - Required - Configuration for the predictor. - **name** (string) - Required - The name of the predictor framework (e.g., "tensorflow"). - **runtimeVersion** (string) - Required - The version of the runtime (e.g., "2.4.0"). - **storageUri** (string) - Required - The URI of the model in storage (e.g., "s3://my-bucket/models/classifier"). - **nodeSelector** (string) - Optional - Node pool to use for deployment. - **minCpu** (string) - Optional - Minimum CPU resources. - **minMemory** (string) - Optional - Minimum memory resources. - **maxCpu** (string) - Optional - Maximum CPU resources. - **maxMemory** (string) - Optional - Maximum memory resources. ### Request Example ```json { "name": "image-classifier", "predictor": { "name": "tensorflow", "runtimeVersion": "2.4.0", "storageUri": "s3://my-bucket/models/classifier", "nodeSelector": "gpu-pool", "minCpu": "1", "minMemory": "4Gi", "maxCpu": "4", "maxMemory": "16Gi" } } ``` ### Request Example (curl) ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/inferenceservice" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "image-classifier", "predictor": { "name": "tensorflow", "runtimeVersion": "2.4.0", "storageUri": "s3://my-bucket/models/classifier", "nodeSelector": "gpu-pool", "minCpu": "1", "minMemory": "4Gi", "maxCpu": "4", "maxMemory": "16Gi" } }' ``` ### Response #### Success Response (200) - **ready** (boolean) - Indicates if the service is ready. - **conditions** (array) - Status conditions of the inference service. - **type** (string) - The type of condition. - **status** (string) - The status of the condition. - **lastTransitionTime** (string) - The last time the condition transitioned. - **predictUrl** (string) - The URL for making predictions. #### Response Example ```json { "ready": false, "conditions": [ {"type": "Ready", "status": "Unknown", "lastTransitionTime": "..."} ], "predictUrl": "" } ``` ``` ```APIDOC ## GET /apis/v1beta1/{project}/inferenceservice/{serviceName} ### Description Gets the status and endpoint URL of a deployed inference service. ### Method GET ### Endpoint /apis/v1beta1/{project}/inferenceservice/{serviceName} ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. - **serviceName** (string) - Required - The name of the inference service. ### Request Example ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/inferenceservice/image-classifier" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **ready** (boolean) - Indicates if the service is ready. - **conditions** (array) - Status conditions of the inference service. - **type** (string) - The type of condition. - **status** (string) - The status of the condition. - **lastTransitionTime** (string) - The last time the condition transitioned. - **predictUrl** (string) - The URL for making predictions. #### Response Example (when ready) ```json { "ready": true, "conditions": [ {"type": "Ready", "status": "True", "lastTransitionTime": "2024-01-15T10:00:00Z"} ], "predictUrl": "https://image-classifier.my-project.onepanel.example.com/v1/models/image-classifier:predict" } ``` ``` -------------------------------- ### Execute Workflow Source: https://context7.com/onepanelio/onepanel/llms.txt Triggers a new workflow execution based on a template UID and version. Allows passing custom parameters and labels for tracking. ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/workflow_executions" -H "Authorization: Bearer " -H "Content-Type: application/json" -d '{"workflowTemplateUid": "abc123", "workflowTemplateVersion": 1, "parameters": [{"name": "epochs", "value": "50"}, {"name": "learning-rate", "value": "0.0001"}, {"name": "dataset", "value": "s3://my-bucket/training-data"}], "labels": [{"key": "experiment", "value": "exp-001"}, {"key": "model", "value": "resnet50"}]}' ``` -------------------------------- ### Manage Secrets Source: https://context7.com/onepanelio/onepanel/llms.txt Handles the creation and listing of Kubernetes secrets for secure storage of sensitive data like credentials. The create operation requires a secret name and data payload, while listing only returns secret names. ```bash # Create credentials secret curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/secrets" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "aws-credentials", "data": { "AWS_ACCESS_KEY_ID": "AKIAIOSFODNN7EXAMPLE", "AWS_SECRET_ACCESS_KEY": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" } }' ``` ```bash # List secrets curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/secrets" \ -H "Authorization: Bearer " ``` -------------------------------- ### Clone workflow execution Source: https://context7.com/onepanelio/onepanel/llms.txt Creates a new workflow execution by cloning the configuration of an existing one. This is useful for re-running experiments with identical parameters. ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/workflow_executions/wf-xyz789" \ -H "Authorization: Bearer " ``` -------------------------------- ### Execute Database Migrations with Goose Source: https://github.com/onepanelio/onepanel/blob/master/cmd/README.md This utility manages database schema changes using the Goose migration tool. It supports both 'up' and 'down' commands to apply or revert migrations respectively. ```bash go run cmd/goose/goose up go run cmd/goose/goose down ``` -------------------------------- ### Add training metrics to workflow Source: https://context7.com/onepanelio/onepanel/llms.txt Sends training metrics such as accuracy, loss, and f1_score to a specific workflow execution. Requires a valid access token and a JSON payload containing the metric values. ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/workflow_executions/wf-xyz789/metric" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "override": false, "metrics": [ {"name": "accuracy", "value": 0.956, "format": "percentage"}, {"name": "loss", "value": 0.0234, "format": "raw"}, {"name": "f1_score", "value": 0.943, "format": "percentage"} ] }' ``` -------------------------------- ### Retrieve Workflow Template Source: https://context7.com/onepanelio/onepanel/llms.txt Fetches a workflow template by UID. Supports retrieving the latest version or a specific version by providing the version number. ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workflow_templates/abc123" -H "Authorization: Bearer " curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workflow_templates/abc123/versions/2" -H "Authorization: Bearer " ``` -------------------------------- ### Manage Workspace Lifecycle Source: https://context7.com/onepanelio/onepanel/llms.txt Provides endpoints to control the lifecycle of a workspace, including pausing to save resources, resuming to continue work, and deleting to terminate. Each operation requires the workspace ID and project name. ```bash # Pause a workspace curl -X PUT "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123/pause" \ -H "Authorization: Bearer " ``` ```bash # Resume with different node pool curl -X PUT "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123/resume" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "parameters": [ {"name": "sys-node-pool", "value": "cpu-pool"} ] }' ``` ```bash # Delete a workspace curl -X DELETE "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123" \ -H "Authorization: Bearer " ``` -------------------------------- ### Watch Workflow Execution Source: https://context7.com/onepanelio/onepanel/llms.txt Opens a WebSocket connection to stream real-time status updates for a specific workflow execution. ```bash wscat -c "wss://onepanel.example.com/apis/v1beta1/my-project/workflow_executions/wf-xyz789/watch" -H "Authorization: Bearer " ``` -------------------------------- ### Manage cron workflows Source: https://context7.com/onepanelio/onepanel/llms.txt Operations for creating and listing scheduled workflows. Creating a cron workflow requires a cron expression and a workflow manifest. ```bash # Create a daily training workflow curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/cron_workflow" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "daily-model-retrain", "manifest": "schedule: \"0 2 * * *\"\nconcurrencyPolicy: Replace\nworkflowSpec:\n entrypoint: main\n templates:\n - name: main\n container:\n image: my-registry/trainer:latest", "labels": [{"key": "schedule", "value": "daily"}] }' # List all scheduled workflows curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/cron_workflows?pageSize=20&page=1" \ -H "Authorization: Bearer " ``` -------------------------------- ### POST /workflow_executions Source: https://context7.com/onepanelio/onepanel/llms.txt Executes a workflow from a template with specified parameters and labels. ```APIDOC ## POST /apis/v1beta1/{project}/workflow_executions ### Description Executes a workflow from a template with specified parameters and labels. ### Method POST ### Endpoint /apis/v1beta1/{project}/workflow_executions ### Request Body - **workflowTemplateUid** (string) - Required - The UID of the template. - **workflowTemplateVersion** (integer) - Required - The version of the template. - **parameters** (array) - Optional - List of parameters. - **labels** (array) - Optional - List of labels. ### Response #### Success Response (200) - **uid** (string) - The execution UID. - **phase** (string) - The current status of the workflow. ``` -------------------------------- ### List Workflow Executions Source: https://context7.com/onepanelio/onepanel/llms.txt Retrieves a list of workflow executions. Supports filtering by template, phase, and pagination parameters. ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workflow_executions?workflowTemplateUid=abc123&phase=Running&pageSize=50&page=1&order=createdAt,desc" -H "Authorization: Bearer " ``` -------------------------------- ### Verify User Authorization Source: https://context7.com/onepanelio/onepanel/llms.txt Checks if the authenticated user has specific permissions to perform actions on a resource within a given namespace. ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/auth" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "isAuthorized": { "namespace": "my-project", "verb": "create", "group": "argoproj.io", "resource": "workflows", "resourceName": "" } }' ``` -------------------------------- ### POST /cron_workflow Source: https://context7.com/onepanelio/onepanel/llms.txt Creates a scheduled workflow that runs automatically based on a cron expression. ```APIDOC ## POST /apis/v1beta1/{namespace}/cron_workflow ### Description Creates a scheduled workflow that runs automatically based on a cron expression. ### Method POST ### Endpoint /apis/v1beta1/{namespace}/cron_workflow ### Request Body - **name** (string) - Required - Name of the cron workflow - **manifest** (string) - Required - YAML manifest defining the schedule and workflow spec - **labels** (array) - Optional - Metadata labels ### Request Example { "name": "daily-model-retrain", "manifest": "schedule: \"0 2 * * *\"..." } ``` -------------------------------- ### Authenticate with Onepanel API Source: https://context7.com/onepanelio/onepanel/llms.txt Exchanges user credentials for an API access token. This token is required for subsequent authenticated requests to the platform. ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/auth/get_access_token" \ -H "Content-Type: application/json" \ -d '{ "username": "admin", "token": "" }' ``` -------------------------------- ### POST /apis/v1beta1/auth/get_access_token Source: https://context7.com/onepanelio/onepanel/llms.txt Exchanges user credentials for an API access token required for subsequent requests. ```APIDOC ## POST /apis/v1beta1/auth/get_access_token ### Description Exchanges user credentials for an API access token. This is the primary authentication method for accessing all other API endpoints. ### Method POST ### Endpoint /apis/v1beta1/auth/get_access_token ### Request Body - **username** (string) - Required - The username for authentication - **token** (string) - Required - The Kubernetes service account token ### Request Example { "username": "admin", "token": "" } ### Response #### Success Response (200) - **accessToken** (string) - The JWT access token for API authentication - **domain** (string) - The API domain - **username** (string) - The authenticated username #### Response Example { "domain": "onepanel.example.com", "accessToken": "eyJhbGciOiJSUzI1NiIs...", "username": "admin" } ``` -------------------------------- ### Add Labels to Resource Source: https://context7.com/onepanelio/onepanel/llms.txt Appends new labels to a specified resource without affecting existing ones. Requires a valid bearer token and a JSON payload containing the items to be added. ```bash curl -X POST "https://onepanel.example.com/apis/v1beta1/my-project/workflow_executions/wf-xyz789/labels" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "items": [ {"key": "reviewed", "value": "true"}, {"key": "promoted", "value": "production"} ] }' ``` -------------------------------- ### Files API Source: https://context7.com/onepanelio/onepanel/llms.txt APIs for managing files in cloud storage, including listing and generating download URLs. ```APIDOC ## GET /apis/v1beta1/{project}/files/list/{path} ### Description Lists files in cloud storage (S3, GCS, Azure Blob) associated with the namespace. ### Method GET ### Endpoint /apis/v1beta1/{project}/files/list/{path} ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. - **path** (string) - Required - The path within the storage to list files from (e.g., "datasets/training"). #### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **perPage** (integer) - Optional - The number of items per page. ### Request Example ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/files/list/datasets/training?page=1&perPage=100" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **count** (integer) - The total number of files found. - **files** (array) - A list of file objects. - **path** (string) - The full path of the file or directory. - **name** (string) - The name of the file or directory. - **directory** (boolean) - True if it's a directory, false otherwise. - **size** (string) - The size of the file in bytes (if applicable). - **contentType** (string) - The MIME type of the file (if applicable). - **lastModified** (string) - The last modified timestamp (ISO 8601 format). #### Response Example ```json { "count": 25, "files": [ { "path": "datasets/training/images", "name": "images", "directory": true }, { "path": "datasets/training/labels.json", "name": "labels.json", "size": "1048576", "contentType": "application/json", "lastModified": "2024-01-15T08:00:00Z" } ] } ``` ``` ```APIDOC ## GET /apis/v1beta1/{project}/files/presigned-url/{filePath} ### Description Generates a presigned URL for downloading a file from cloud storage. ### Method GET ### Endpoint /apis/v1beta1/{project}/files/presigned-url/{filePath} ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. - **filePath** (string) - Required - The path to the file in cloud storage (e.g., "models/trained-model.h5"). ### Request Example ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/files/presigned-url/models/trained-model.h5" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **url** (string) - The presigned URL for downloading the file. - **size** (string) - The size of the file in bytes. #### Response Example ```json { "url": "https://s3.amazonaws.com/bucket/models/trained-model.h5?X-Amz-...", "size": "524288000" } ``` ``` -------------------------------- ### Workspace Logs API Source: https://context7.com/onepanelio/onepanel/llms.txt API for streaming logs from a container within a workspace. ```APIDOC ## GET /apis/v1beta1/{project}/workspaces/{workspaceId}/containers/{containerName}/logs ### Description Streams logs from a specified container within a workspace. ### Method GET ### Endpoint /apis/v1beta1/{project}/workspaces/{workspaceId}/containers/{containerName}/logs ### Parameters #### Path Parameters - **project** (string) - Required - The project ID. - **workspaceId** (string) - Required - The ID of the workspace. - **containerName** (string) - Required - The name of the container. #### Query Parameters - **sinceTime** (string) - Optional - Filter logs since this Unix timestamp (e.g., "1705312800"). ### Request Example ```bash curl -X GET "https://onepanel.example.com/apis/v1beta1/my-project/workspaces/ws-abc123/containers/jupyterlab/logs?sinceTime=1705312800" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **logs** (string) - The streamed log content. #### Response Example ```json { "logs": "Log line 1\nLog line 2" } ``` ```