Skip to content

feat: add initial port mapping example#435

Open
stancu-anamaria wants to merge 5 commits into
unikraft-cloud:mainfrom
stancu-anamaria:port-mapping
Open

feat: add initial port mapping example#435
stancu-anamaria wants to merge 5 commits into
unikraft-cloud:mainfrom
stancu-anamaria:port-mapping

Conversation

@stancu-anamaria

Copy link
Copy Markdown

No description provided.

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 port-mapping/ example demonstrating how to expose an internal HTTP service (port 8080) via Unikraft Cloud port mapping to external 443 over TLS/HTTP, including both kraft CLI and direct API workflows.

Changes:

  • Introduces a minimal Python HTTP server plus container/Kraft packaging files for deployment.
  • Adds a step-by-step README covering deploy/operate flows via kraft CLI and via API helper scripts.
  • Adds configuration templates (ukc.config.template, app.config) and API shell scripts for instance/image operations.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
port-mapping/ukc.config.template Adds UKC user/token/metro config template and derived UKC_API base URL.
port-mapping/server.py Adds a minimal HTTP server that listens on port 8080.
port-mapping/README.md Documents CLI + API workflows for port mapping example.
port-mapping/Kraftfile Defines Unikraft Cloud runtime, rootfs build, and command.
port-mapping/Dockerfile Builds a Python slim OCI image containing the server.
port-mapping/app.config Adds shared env vars for image/instance naming and port mapping.
port-mapping/api/stop-instance.sh Adds API helper script to stop an instance.
port-mapping/api/start-instance.sh Adds API helper script to start an instance.
port-mapping/api/query.sh Adds API helper script to discover FQDN and query the service.
port-mapping/api/push-image.sh Adds API workflow helper to push a packaged image.
port-mapping/api/pkg-image.sh Adds API workflow helper to package an image.
port-mapping/api/get-instance-info.sh Adds API helper script to list instance info.
port-mapping/api/delete-instance.sh Adds API helper script to delete an instance.
port-mapping/api/create-instance.sh Adds API helper script to create an instance with explicit port mapping.
port-mapping/.gitignore Prevents committing the real ukc.config file.

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

Comment thread port-mapping/api/start-instance.sh Outdated
Comment thread port-mapping/api/stop-instance.sh Outdated
Comment thread port-mapping/api/delete-instance.sh Outdated
Comment thread port-mapping/api/create-instance.sh Outdated
Comment thread port-mapping/README.md
@stancu-anamaria stancu-anamaria marked this pull request as ready for review July 11, 2026 07:59

@Roxanacmaria Roxanacmaria 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.

I reviewed the implementation and tested it on my side. Everything worked as expected, and I was able to follow the implementation without any issues. The code is clear, the documentation is easy to understand, and I did not encounter any problems while running the project.

Looks good to me. Nice work!

@Dan-Andrei-Simionescu Dan-Andrei-Simionescu 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.

I went through the code and tested the functionality locally. Everything behaves as intended. The code structure is clean, the instructions provided in the documentation are straightforward to follow.

@razvand razvand self-assigned this Jul 11, 2026
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.

5 participants