Skip to content
Open
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
23 changes: 16 additions & 7 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ on:
push:
branches: [main, master]
paths: ['doc/**']
pull_request:
paths: ['doc/**']

concurrency:
group: ${{ github.workflow }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
DeployDocs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout actions
uses: actions/checkout@v4
Expand All @@ -35,6 +32,18 @@ jobs:
with:
path: doc/site

DeployDocs:
needs: Build
if: github.event_name == 'push'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions doc/docs/api-reference/cpp/core-classes/container.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Container

**Methods**

- `Start()`
- `Stop(Signal signal, TimeSpan timeout)`
- `Delete(DeleteContainerOption options)`
Expand All @@ -12,6 +13,7 @@
- `Close()`

**Behavior notes**

- `Start()` automatically sets `WSLC_CONTAINER_START_FLAG_ATTACH` if an init process exists and its output mode is `Event` or `Stream`.
- `Stop()` converts the timeout to **seconds**, rejects negative values, and rejects values that exceed `uint32_t`.
- `InitProcess()` throws if the container was not configured with one.
Expand Down
2 changes: 2 additions & 0 deletions doc/docs/api-reference/cpp/core-classes/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`Process` objects are returned by `Container::CreateProcess()` and `Container::InitProcess()`.

**Methods / events**

- `Start()`
- `Signal(Signal signal)`
- `GetOutputStream(ProcessOutputHandle outputHandle)`
Expand All @@ -16,6 +17,7 @@
- `Close()`

**Behavior notes**

- `Start()` cannot be called on the init process.
- `Start()` requires a non-empty `ProcessSettings::CommandLine()`.
- `GetOutputStream()` requires `ProcessOutputMode::Stream`.
Expand Down
11 changes: 7 additions & 4 deletions doc/docs/api-reference/cpp/core-classes/session.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Session

**Constructor**

- `Session(SessionSettings settings)`
- rejects `nullptr` settings.

**Methods**

- `Start()`
- `Terminate()`
- `CreateContainer(ContainerSettings containerSettings)`
Expand All @@ -27,6 +29,7 @@
- `Close()`

**Behavior notes**

- `Start()` is one-shot; calling it twice throws.
- Most methods call `EnsureStarted()` first.
- `ImportImage` / `ImportImageAsync` and `LoadImage` / `LoadImageAsync` are path-based only.
Expand Down Expand Up @@ -83,18 +86,18 @@ for (auto const& image : images)
```

```cpp
PullImageOptions pullOptions = ;
PullImageOptions pullOptions = {};
auto pullOp = session.PullImageAsync(pullOptions);
pullOp.Progress([](auto&&, ImageProgress const& p) { /* progress */ });
co_await pullOp;

PushImageOptions pushOptions = ;
PushImageOptions pushOptions = {};
co_await session.PushImageAsync(pushOptions);

TagImageOptions tagOptions = ;
TagImageOptions tagOptions = {};
session.TagImage(tagOptions);

VhdOptions vhdOptions = ;
VhdOptions vhdOptions = {};
session.CreateVhdVolume(vhdOptions);
session.DeleteVhdVolume(L"build-cache");
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Attaches a named session VHD volume to a container.

**Constructors / properties**

- `ContainerNamedVolume(hstring name, hstring containerPath, bool readOnly)`
- `Name()` / setter
- `ContainerPath()` / setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
Maps a Windows host port to a container port.

**Constructors / properties**

- `ContainerPortMapping(uint16_t windowsPort, uint16_t containerPort, PortProtocol protocol)`
- `WindowsPort()` / setter
- `ContainerPort()` / setter
- `Protocol()` / setter
- `WindowsAddress()` / setter

**Important notes**

- `WindowsAddress` is implemented.
- The setter accepts only `Windows::Networking::HostName` values whose type is `Ipv4` or `Ipv6`.
- `ToStruct()` uses `inet_pton` and stores a real `sockaddr_in` / `sockaddr_in6`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Binds a Windows path into the container.

**Constructors / properties**

- `ContainerVolume(hstring windowsPath, hstring containerPath, bool readOnly)`
- `WindowsPath()` / setter
- `ContainerPath()` / setter
Expand Down
1 change: 1 addition & 0 deletions doc/docs/api-reference/cpp/data-classes/imageinfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Read-only wrapper created from `WslcImageInfo`.

**Properties**

- `Name()` → image name
- `Sha256()` → 32-byte buffer
- `Size()` → image size
Expand Down
1 change: 1 addition & 0 deletions doc/docs/api-reference/cpp/data-classes/imageprogress.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Progress item reported by image pull/import/load/push operations.

**Properties**

- `Id()`
- `Status()`
- `CurrentBytes()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Progress item reported by `WslcService::InstallWithDependenciesAsync()`.

**Properties**

- `Component()`
- `Progress()`
- `Total()`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ProcessCrashHandler

Observed use:

- `Session::ProcessCrashed` raises one `ProcessCrashInformation` argument.

```cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ProcessExitHandler

Observed use:

- `Process::Exited` raises one `int32_t exitCode`.

```cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ProcessOutputHandler

Observed use:

- `Process::OutputReceived` and `Process::ErrorReceived` raise one argument containing raw output bytes.
- The wrapper forwards a `winrt::array_view<const uint8_t>` produced from the C callback buffer.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SessionTerminationHandler

Observed use:

- `Session::Terminated` raises one argument: `SessionTerminationReason reason`.

```cpp
Expand Down
1 change: 1 addition & 0 deletions doc/docs/api-reference/cpp/enumerations/component.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`WslcService::GetMissingComponents()` returns a `Component` bitmask.

Underlying values:

- `VirtualMachinePlatform = 1`
- `WslPackage = 2`
- `SdkNeedsUpdate = 4`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# ContainerNetworkingMode

`winrt_ContainerSettings.cpp` explicitly validates only:

- `None`
- `Bridged`

Underlying C values:

- `None = 0`
- `Bridged = 1`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`Container::State()` casts directly from `WslcContainerState`.

Underlying C values:

- `Invalid = 0`
- `Created = 1`
- `Running = 2`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`Container::Delete()` takes `DeleteContainerOption`.

Underlying values:

- `None = 0`
- `Force = 1`

Expand Down
1 change: 1 addition & 0 deletions doc/docs/api-reference/cpp/enumerations/error.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Error

Underlying HRESULT values:

- `ImageNotFound = -2147219967`
- `ContainerPrefixAmbiguous = -2147219966`
- `ContainerNotFound = -2147219965`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`ImageProgress` casts directly from `WslcImageProgressStatus`.

Underlying C values:

- `Unknown = 0`
- `Pulling = 1`
- `Waiting = 2`
Expand Down
1 change: 1 addition & 0 deletions doc/docs/api-reference/cpp/enumerations/portprotocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- The value is passed directly to `WslcContainerPortMapping::protocol`.

Underlying C values:

- `TCP = 0`
- `UDP = 1`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ProcessOutputHandle

`Process::GetOutputStream(ProcessOutputHandle)` accepts these values:

- `StandardOutput = 1`
- `StandardError = 2`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# ProcessOutputMode

Underlying values:

- `Discard = 0`
- `Stream = 1`
- `Event = 2`

Behavior:

- `Discard`: no stdout/stderr events or output streams.
- `Stream`: `GetOutputStream(...)` can be used.
- `Event`: stdout/stderr are delivered by callbacks and `OutputReceived` / `ErrorReceived`.
Expand Down
1 change: 1 addition & 0 deletions doc/docs/api-reference/cpp/enumerations/processstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`Process::State()` casts directly from `WslcProcessState`.

Underlying C values:

- `Unknown = 0`
- `Running = 1`
- `Exited = 2`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`Session::OnTerminated` converts `WslcSessionTerminationReason` directly to the WinRT enum.

Underlying C values:

- `Unknown = 0`
- `Shutdown = 1`
- `Crashed = 2`
Expand Down
1 change: 1 addition & 0 deletions doc/docs/api-reference/cpp/enumerations/signal.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
`Container::Stop()` and `Process::Signal()` cast directly to `WslcSignal`.

Underlying values:

- `None = 0`
- `SIGHUP = 1`
- `SIGINT = 2`
Expand Down
1 change: 1 addition & 0 deletions doc/docs/api-reference/cpp/enumerations/vhdtype.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# VhdType

Underlying values:

- `Dynamic = 0`
- `Fixed = 1`

Expand Down
2 changes: 2 additions & 0 deletions doc/docs/api-reference/cpp/service-class/wslcservice.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
Static entry points over the service-level C API.

**Methods**

- `GetMissingComponents()`
- `GetVersion()`
- `InstallWithDependencies()`
- `InstallWithDependenciesAsync()`

**Behavior notes**

- `GetMissingComponents()` returns a `Component` bitmask.
- `GetVersion()` returns a `ServiceVersion` constructed from `major`, `minor`, and `revision`.
- `InstallWithDependencies()` installs dependencies synchronously.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# ContainerSettings

**Constructor**

- `ContainerSettings(hstring imageName)`
- `imageName` must be non-empty.

**Properties**

- `ImageName()` / setter
- `Name()` / setter
- `InitProcess()` / setter
Expand All @@ -19,6 +21,7 @@
- `NamedVolumes()` / setter

**Important notes**

- Collection setters reject `nullptr`.
- When converting to the C struct, null elements inside the collections are rejected.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# ProcessSettings

**Properties**

- `WorkingDirectory()` / setter
- `CommandLine()` / setter
- `EnvironmentVariables()` / setter
- `OutputMode()` / setter

**Important notes**

- `CommandLine(nullptr)` and `EnvironmentVariables(nullptr)` are rejected.
- `Process::Start()` later requires a **non-empty** `CommandLine()`.
- `ProcessOutputMode::Event` installs C callbacks; `ProcessOutputMode::Stream` expects stream access; `Discard` is the default.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# SessionSettings

**Constructor**

- `SessionSettings(hstring name, hstring storagePath)`
- `name` must be non-empty.
- `storagePath` must be non-empty.

**Properties**

- `Name()` / setter
- `StoragePath()` / setter
- `CpuCount()` / setter (`0` rejected)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# VhdOptions

**Properties**

- `Name()` / setter
- `Size()` / setter
- `Type()` / setter
Expand Down
Loading
Loading