Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/actions/setup-www/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ inputs:
posthog-key:
required: false
description: The key to authenticate with PostHog.
docs-channel:
channel:
required: false
default: prod-staging
description: The docs channel to use for the OpenAPI spec.
default: staging
description: |
The branch/channel of dependency repos (openapi, x) to pull when
building the site. One of `staging` or `stable`.
Comment on lines +45 to +46

outputs:
domain:
Expand Down Expand Up @@ -101,7 +103,7 @@ runs:
--build-arg PUBLIC_STATUS_PAGE_SUMMARY_URL="https://status.unikraft.cloud/api/v1/summary" \
--build-arg PUBLIC_POSTHOG_HOST="${{ inputs.posthog-host }}" \
--build-arg PUBLIC_POSTHOG_KEY="${{ inputs.posthog-key }}" \
--build-arg DOCS_CHANNEL="${{ inputs.docs-channel }}" \
--build-arg CHANNEL="${{ inputs.channel }}" \
--memory "${{ inputs.memory }}" \
--service "${{ inputs.name }}" \
--image "${{ inputs.name }}" \
Expand Down
86 changes: 8 additions & 78 deletions .github/workflows/check-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,19 @@ name: check/pr

on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- prod-staging

permissions:
pull-requests: write
contents: read
types: [opened, synchronize, reopened, edited]
branches: [prod-staging]

jobs:
commits:
check-pr:
runs-on: ubuntu-latest
steps:
- name: format
if: always()
uses: taskmedia/action-conventional-commits@v1.1.20
with:
types: "build|ci|docs|feat|fix|perf|refactor|style|test|revert|chore"
token: ${{ secrets.GH_PAT }}

- name: length
if: ${{ github.actor != 'dependabot' && github.actor != 'dependabot[bot]' }}
uses: gsactions/commit-message-checker@v2
with:
pattern: '((^(?=(?:.|\n)*(?:^|\n)\[\d\]: .{69,}(?:$|\n)(?:.|\n)*)(?:.|\n)*$)|(^(?!(?:.|\n)*(?:^|\n).{74,}(?:$|\n)(?:.|\n)*)(?:.|\n)*$))'
flags: ''
error: 'The maximum line length of 74 characters is exceeded.'
excludeDescription: 'true'
excludeTitle: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GH_PAT }}

- name: signed-off-by
if: always()
uses: gsactions/commit-message-checker@v2
with:
pattern: '^Signed-off-by: .+ \<.+\@.+\..+\>$'
error: 'Signed-off-by line is missing.'
excludeDescription: 'true'
excludeTitle: 'true'
checkAllCommitMessages: 'true'
accessToken: ${{ secrets.GH_PAT }}

pr:
runs-on: ubuntu-latest
steps:
- name: title-format
if: always()
uses: gsactions/commit-message-checker@v2
with:
pattern: '^(build|ci|docs|feat|fix|perf|refactor|style|test|revert|chore)(\([\w\-\_\d]+\))?!?: '
error: 'The PR title must follow the conventional commits format.'
excludeDescription: 'true'
excludeTitle: 'false'
checkAllCommitMessages: 'false'
accessToken: ${{ secrets.GH_PAT }}

- name: title-length
if: ${{ github.actor != 'dependabot' && github.actor != 'dependabot[bot]' }}
uses: gsactions/commit-message-checker@v2
with:
pattern: '^(?!.{75,}).*'
flags: ''
error: 'The maximum line length of 75 characters is exceeded.'
excludeDescription: 'true'
excludeTitle: 'false'
checkAllCommitMessages: 'false'
accessToken: ${{ secrets.GH_PAT }}

- name: description
if: ${{ github.actor != 'dependabot' && github.actor != 'dependabot[bot]' }}
uses: gsactions/commit-message-checker@v2
with:
pattern: '^\S+( \S+)*$'
error: 'The PR description must not be empty.'
flags: 'gm'
excludeDescription: 'false'
excludeTitle: 'true'
checkAllCommitMessages: 'false'
accessToken: ${{ secrets.GH_PAT }}
- uses: actions/checkout@v6
with:
fetch-depth: 0
Comment on lines +9 to +14

- name: Run check-pr
uses: unikraft-cloud/x/.github/actions/check-pr@prod-staging

lint:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
name: com-docs-pr-${{ github.event.number }}
metro: ${{ vars.UKC_METRO }}
log-level: trace
docs-channel: prod-staging
channel: staging

- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/prod-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
name: com-docs-stable
metro: ${{ vars.UKC_METRO }}
log-level: trace
docs-channel: prod-stable
channel: stable

- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
Expand Down Expand Up @@ -83,3 +83,13 @@ jobs:
shell: bash
run: |
exit 1

- name: Trigger www prod-stable deploy
if: ${{ steps.www.outcome == 'success' }}
shell: bash
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
gh workflow run prod-stable.yaml \
--repo unikraft-cloud/www \
--ref prod-stable
12 changes: 11 additions & 1 deletion .github/workflows/prod-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
name: com-docs-staging
metro: ${{ vars.UKC_METRO }}
log-level: trace
docs-channel: prod-staging
channel: staging

- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
Expand Down Expand Up @@ -83,3 +83,13 @@ jobs:
shell: bash
run: |
exit 1

- name: Trigger www prod-staging deploy
if: ${{ steps.www.outcome == 'success' }}
shell: bash
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
gh workflow run prod-staging.yaml \
--repo unikraft-cloud/www \
--ref prod-staging
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
################################################################################
FROM golang:1.26 AS build-kraft-docs

ARG CHANNEL=staging

WORKDIR /kraftkit
ADD https://github.com/unikraft/kraftkit.git /kraftkit
ADD https://github.com/unikraft/kraftkit.git#${CHANNEL} /kraftkit

RUN make docs

Expand All @@ -15,8 +17,10 @@ RUN make docs
################################################################################
FROM golang:1.26 AS build-cli-docs

ARG CHANNEL=staging

WORKDIR /cli
ADD https://github.com/unikraft/cli.git /cli
ADD https://github.com/unikraft/cli.git#${CHANNEL} /cli

RUN make docs

Expand Down Expand Up @@ -49,11 +53,11 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
COPY . .

# Grab the latest OpenAPI spec based on the desired channel.
ARG DOCS_CHANNEL=prod-staging
ADD https://raw.githubusercontent.com/unikraft-cloud/openapi/refs/heads/${DOCS_CHANNEL}/platform.yaml apis/platform.yaml
ARG CHANNEL=staging
ADD https://raw.githubusercontent.com/unikraft-cloud/openapi/refs/heads/prod-${CHANNEL}/platform.yaml apis/platform.yaml

# Kraftfile v0.7 schema docs (from unikraft-cloud/x)
ADD https://raw.githubusercontent.com/unikraft-cloud/x/refs/heads/${DOCS_CHANNEL}/kraftfile/schema.md pages/kraftfile/v0.7.md
ADD https://raw.githubusercontent.com/unikraft-cloud/x/refs/heads/prod-${CHANNEL}/kraftfile/schema.md pages/kraftfile/v0.7.md

# Kraft (old CLI) docs -> /cli/kraft/
COPY --from=build-kraft-docs /kraftkit/docs/kraft/cloud /docs/pages/cli/kraft
Expand Down
6 changes: 3 additions & 3 deletions pages/cli/registries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You can also refer to images by digest to pin to an exact version.
Registry authentication uses the same API token as the rest of the platform.
The new CLI uses profiles, while the legacy CLI reads `UKC_TOKEN` directly.

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft login
Expand Down Expand Up @@ -134,7 +134,7 @@ For more control, for example when packaging [ROMs](/features/roms) or base imag

## Listing images

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft images list
Expand Down Expand Up @@ -168,7 +168,7 @@ There may be a delay of a few minutes between pushing or removing an image and t

## Removing images

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
# Not supported yet for direct pushing to node registries.
Expand Down
6 changes: 3 additions & 3 deletions pages/features/autoscale.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Autoscale, as well as load balancing in general, currently supports only Interne

First, create an instance, in this example using NGINX:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
git clone https://github.com/unikraft-cloud/examples
Expand Down Expand Up @@ -182,7 +182,7 @@ type: step
You can further check that the master instance is on `standby` (scaled to zero), assuming your service hasn't received any traffic yet.
You can get the UUID of your master instance from the legacy CLI scale get command above.

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft instances get f840ac12-f485-4f02-9f33-6a0a7de46f1f -o list
Expand Down Expand Up @@ -222,7 +222,7 @@ curl https://small-leaf-rafirkw7.fra.unikraft.app
You should get an immediate response, even though the instance was on `standby`.
You can use a watch command to see if you catch the instance changing state from `standby` to `running`:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft instances list --watch
Expand Down
6 changes: 3 additions & 3 deletions pages/features/load-balancing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ In case there are no other instances available, the load balancer blocks excess
To set load balancing up, first use the deploy or run flow with the publish flag to create the service as part of the instance creation.
For example, use NGINX as the app:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
git clone https://github.com/unikraft-cloud/examples
Expand Down Expand Up @@ -72,7 +72,7 @@ This single command will (a) create a service via the `-p` flag and (b) start an

With this in place, it's now time to start a second instance and attach it to the created service (in this case, named `wandering-shape-n6mhimgn`):

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
cd examples/nginx/
Expand Down Expand Up @@ -111,7 +111,7 @@ The command's output should look like this:
Both the `url` and `service` fields in the 2 instances are the same.
To check that it worked, run the following command:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft services list
Expand Down
8 changes: 4 additions & 4 deletions pages/features/roms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ kraft pkg \

Wait a few seconds for propagation and check that the image is present:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft images list
Expand Down Expand Up @@ -258,7 +258,7 @@ kraft pkg \

Wait a few seconds for propagation and check that the ROMs are present:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft images list
Expand Down Expand Up @@ -356,7 +356,7 @@ curl -X POST \

Check that the instances are up:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft instances get test-http-python-rom1
Expand Down Expand Up @@ -543,7 +543,7 @@ Hi from 2nd ROM!

When done, remove the instances:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft instances delete test-http-python-rom1 test-http-python-rom2
Expand Down
6 changes: 3 additions & 3 deletions pages/features/scale-to-zero.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ You can disable scale-to-zero either by setting the label to `false`, or with th

Since Unikraft Cloud has scale-to-zero on by default, all you need to do is to start an instance normally:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
git clone https://github.com/unikraft-cloud/examples
Expand Down Expand Up @@ -249,7 +249,7 @@ This command will create the NGINX instance with scale-to-zero enabled:
Note that at first the system lists the status as `running` in the output of the deploy or run flow.
Check the instance's status:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft instances list
Expand Down Expand Up @@ -310,7 +310,7 @@ curl https://twilight-gorilla-ui5b6kwt.fra.unikraft.app
You should get an NGINX response with no noticeable delay.
For fun, try to use the following command to see if you can catch the instance's `STATE` field changing from `standby` to `running`:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft instances list --watch
Expand Down
2 changes: 1 addition & 1 deletion pages/features/snapshots.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can see an example of such a `Kraftfile` and label in the [Spring Boot examp

Once deployed, you can check whether this mechanism works for your app via the CLI:

<CodeTabs syncKey="cli-tool">
<CodeTabs syncKey="cli">

```bash title="unikraft"
unikraft instances get <instance-name>
Expand Down
2 changes: 1 addition & 1 deletion pages/guides/httpserver-go1.21.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ curl https://red-dew-jtk6yxk1.fra.unikraft.app
```

```text
hello, world!
Hello, World!
```

You can list information about the instance by running:
Expand Down
Loading
Loading