Skip to content

feat: Introduce guide on basic operations#250

Merged
dragosgheorghioiu merged 1 commit into
mainfrom
razvand/feature/basic-ops
Mar 23, 2026
Merged

feat: Introduce guide on basic operations#250
dragosgheorghioiu merged 1 commit into
mainfrom
razvand/feature/basic-ops

Conversation

@razvand

@razvand razvand commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

This guide presents the basic operations when working with Unikraft Cloud instances and images. Namely, it presents:

  • deploying an instance (and an image)
  • creating an image
  • pushing an image
  • creating an instance
  • starting an instance
  • listing instances
  • listing images
  • getting information about an instance
  • getting logs from an instance
  • stopping an instance
  • deleting an instance

The guide explains how to do the above basic operations both using the kraft CLI tool and directly using the underlying Unikraft Cloud platform API.

The target application in the guide is a simple C HTTP server.

For now, the commands assume a current (March 2026) stable version of the Unikraft Cloud platform. The guide is to be updated when a new stable release comes about.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “basic operations” guide and accompanying sample artifacts to demonstrate deploying and managing Unikraft Cloud instances/images via both the kraft CLI and direct Platform API calls.

Changes:

  • Introduces a comprehensive basic-ops/ guide documenting common instance/image workflows.
  • Adds a minimal C HTTP server example with Dockerfile + Kraftfile for packaging/deployment.
  • Adds shell scripts under basic-ops/api/ to exercise Platform API endpoints for instance lifecycle operations.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
basic-ops/README.md New end-to-end guide for CLI + API workflows (commands, outputs, and steps).
basic-ops/ukc.config.template Template for UKC credentials/metro (to be sourced by scripts).
basic-ops/app.config Centralized app/image/instance naming variables for scripts.
basic-ops/Kraftfile Kraft spec for building/running the example via kraft cloud.
basic-ops/Dockerfile Builds the example HTTP server into a minimal scratch-based rootfs.
basic-ops/http_server.c Minimal HTTP server used as the deployed workload.
basic-ops/api/pkg-image.sh Packages the image via kraft pkg.
basic-ops/api/push-image.sh Pushes the packaged image to the registry.
basic-ops/api/list-images.sh Lists images via the Platform API.
basic-ops/api/create-instance.sh Creates an instance via the Platform API.
basic-ops/api/start-instance.sh Starts an instance via the Platform API.
basic-ops/api/stop-instance.sh Stops an instance via the Platform API.
basic-ops/api/delete-instance.sh Deletes an instance via the Platform API.
basic-ops/api/list-instances.sh Lists instances via the Platform API.
basic-ops/api/get-instance-info.sh Fetches instance info via the Platform API.
basic-ops/api/get-instance-logs.sh Fetches/decodes instance logs via the Platform API.
basic-ops/api/query.sh Queries the deployed service using the discovered FQDN.
basic-ops/api/list-services.sh Lists services via the Platform API.
basic-ops/api/get-image-sha.sh Extracts the local packaged image index/digest via kraft pkg ls.
basic-ops/.gitignore Prevents committing ukc.config credentials file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread basic-ops/README.md Outdated
Create a `ukc.config` file as a copy of the `ukc.config.template`.
Replace the `TODO` entries in the `ukc.config` file with your corresponding Unikraft Cloud configuration values: user, token and metro.

## TLDR: Deploy and Operate and Instance

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Section title has a grammatical typo: "Operate and Instance" should be "Operate an Instance" (or similar) for readability.

Suggested change
## TLDR: Deploy and Operate and Instance
## TLDR: Deploy and Operate an Instance

Copilot uses AI. Check for mistakes.
Comment thread basic-ops/README.md Outdated

## Detailed Operations with the Kraft CLI

Below are detailed commands to deploy and operate instances with the [`kraft` CLI](https://unikraft.org/docs/cli/install)).

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra closing parenthesis in the markdown link ("...install))"), which breaks the rendered link.

Suggested change
Below are detailed commands to deploy and operate instances with the [`kraft` CLI](https://unikraft.org/docs/cli/install)).
Below are detailed commands to deploy and operate instances with the [`kraft` CLI](https://unikraft.org/docs/cli/install).

Copilot uses AI. Check for mistakes.
Comment thread basic-ops/README.md Outdated
Before anything, make sure you source the Unikraft Cloud configuration file `ukc.config`:

```console
source uk.config

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command sources uk.config, but the setup section and repository file are ukc.config. As written, users will get a "file not found" error.

Suggested change
source uk.config
source ukc.config

Copilot uses AI. Check for mistakes.
Comment thread basic-ops/README.md Outdated
These scripts make HTTP requests (via `curl`) to the REST API exposed by the platform.

> [!NOTE]
> Image related operations are do not interact with the platform API.

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar issue: "Image related operations are do not interact" should be corrected (e.g., "Image-related operations do not interact...").

Suggested change
> Image related operations are do not interact with the platform API.
> Image-related operations do not interact with the platform API.

Copilot uses AI. Check for mistakes.
Comment thread basic-ops/api/create-instance.sh Outdated
Comment on lines +6 to +7
IMAGE_SHA=$(./api/get-image-sha.sh)

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMAGE_SHA is computed but never used, which is confusing and suggests the request payload is incomplete (especially since the image reference later hard-codes :latest). Either use IMAGE_SHA in the payload or remove it.

Suggested change
IMAGE_SHA=$(./api/get-image-sha.sh)

Copilot uses AI. Check for mistakes.
Comment thread basic-ops/api/get-image-sha.sh
Comment thread basic-ops/api/create-instance.sh Outdated
Comment on lines +8 to +9
curl \
--insecure \

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All API calls pass --insecure, which disables TLS certificate verification and makes the examples vulnerable to MITM. Prefer verifying TLS by default and only document --insecure as an explicit troubleshooting option (or gate it behind an env var).

Suggested change
curl \
--insecure \
# Set UKC_INSECURE=1 to disable TLS certificate verification (for troubleshooting only).
if [ "${UKC_INSECURE}" = "1" ]; then
INSECURE_FLAG="--insecure"
else
INSECURE_FLAG=""
fi
curl \
${INSECURE_FLAG} \

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be removed completely for this guide

Comment thread basic-ops/api/list-services.sh
Comment thread basic-ops/ukc.config.template
Comment thread basic-ops/README.md
Comment thread basic-ops/README.md Outdated

1. Packages the image locally.
1. Pushes the image to the remote Unikraft Cloud image registry.
1. Creates and starts an instance from the image.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steps should be incremented here instead of 1,1,1.

Comment thread basic-ops/api/create-instance.sh Outdated
Comment on lines +8 to +9
curl \
--insecure \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be removed completely for this guide

@dragosgheorghioiu dragosgheorghioiu force-pushed the razvand/feature/basic-ops branch from 88a20b9 to 7ff63d1 Compare March 23, 2026 20:09
This guide presents the basic operations when working with Unikraft
Cloud instances and images. Namely, it presents:

- deploying an instance (and an image)
- creating an image
- pushing an image
- creating an instance
- starting an instance
- listing instances
- listing images
- getting information about an instance
- getting logs from an instance
- stopping an instance
- deleting an instance

The guide explains how to do the above basic operations both using the
`kraft` CLI tool and directly using the underlying Unikraft Cloud
platform API.

The target application in the guide is a simple C HTTP server.

For now, the commands assume a current (March 2026) stable version of
the Unikraft Cloud platform. The guide is to be updated when a new
stable release comes about.

Signed-off-by: Razvan Deaconescu <razvand@unikraft.io>
@dragosgheorghioiu dragosgheorghioiu force-pushed the razvand/feature/basic-ops branch from 7ff63d1 to 572b0a9 Compare March 23, 2026 20:12
@dragosgheorghioiu dragosgheorghioiu merged commit 57eb313 into main Mar 23, 2026
7 checks passed
@dragosgheorghioiu dragosgheorghioiu deleted the razvand/feature/basic-ops branch March 23, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants