Skip to content
Draft
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ jobs:
uses: durable-workflow/.github/.github/actions/bootstrap-patched-pip@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
with:
clients: pip,python,composer,cargo,curl,git
- name: Install Rust 1.86
- name: Install Rust 1.99
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: 1.86.0
toolchain: 1.99.0
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy --locked --all-targets -- -D warnings
Expand Down Expand Up @@ -367,10 +367,10 @@ jobs:
uses: durable-workflow/.github/.github/actions/bootstrap-patched-pip@75587fc33ff40c34f32ef777293dad56bb6f48c7 # clean-trust
with:
clients: pip,python,cargo,curl,git
- name: Install Rust 1.86
- name: Install Rust 1.99
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: 1.86.0
toolchain: 1.99.0
- run: cargo build --locked
- name: Fetch the pinned 2.x reference CLI
run: parity/fetch-reference.sh
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/rust-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ jobs:
with:
clients: pip,python,cargo,curl,git

- name: Install Rust 1.86
- name: Install Rust 1.99
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: 1.86.0
toolchain: 1.99.0
targets: ${{ matrix.target }}

- name: Install the musl C toolchain
Expand Down Expand Up @@ -128,12 +128,14 @@ jobs:
export DW_CLI_BUILD_DATE SOURCE_DATE_EPOCH="$epoch"
# Keep runner paths out of the binary.
registry="${CARGO_HOME:-$HOME/.cargo}/registry/src"
git_sources="${CARGO_HOME:-$HOME/.cargo}/git/checkouts"
workspace="$GITHUB_WORKSPACE"
if [ "$RUNNER_OS" = "Windows" ]; then
registry="$(cygpath -w "$registry")"
git_sources="$(cygpath -w "$git_sources")"
workspace="$(cygpath -w "$workspace")"
fi
flags="--remap-path-prefix=$registry=/cargo/registry/src --remap-path-prefix=$workspace=/build"
flags="--remap-path-prefix=$registry=/cargo/registry/src --remap-path-prefix=$git_sources=/cargo/git/checkouts --remap-path-prefix=$workspace=/build"
if [ "$RUNNER_OS" = "Windows" ]; then
flags="$flags -C target-feature=+crt-static"
fi
Expand Down Expand Up @@ -196,6 +198,11 @@ jobs:
exit 1
fi

- name: Exercise the built-in native development Server
env:
ASSET: ${{ matrix.asset }}
run: python3 -I -S scripts/ci/smoke-native-dev.py --binary "dist/$ASSET"

- name: Write the dependency inventory
env:
ASSET: ${{ matrix.asset }}
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ See the [distribution guide](docs/distribution.md) for exact-version installs,
direct downloads, checksum and attestation verification, Homebrew, and
reproducible builds.

## Start a local Server

The native CLI includes a development Server and SQLite. Installing `dw` is
all you need to start the runtime:

```bash
dw server:start-dev
```

It listens on `127.0.0.1:8080`, initializes the database and default namespace,
and runs timers and maintenance. In another terminal, connect the CLI:

```bash
dw env:set local --server=http://127.0.0.1:8080 --token=dev-token --make-default
dw doctor
```

Data persists in `dev-server` under the CLI config directory. Use
`--data-dir=./workflow-data` to choose a directory or `--port=9000` to choose a
port. Ctrl+C stops the runtime and preserves its data. Application workers
still run your workflow and activity code through an SDK.

## Connect

Named profiles keep a runtime URL, namespace, token source, TLS policy, and
Expand Down
54 changes: 32 additions & 22 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,29 +430,39 @@ dw server:info
dw doctor
dw doctor --env=prod --output=json

# Serve an existing, configured Laravel project (requires PHP on PATH)
# Start the built-in native development Server
dw server:start-dev
dw server:start-dev --port=9090 --db=sqlite
```

`server:start-dev` runs `php artisan serve` in the current directory and defaults
to `127.0.0.1`. Use `--host=0.0.0.0` explicitly to bind to all interfaces. Install
the project's dependencies, configure its database and run migrations first.
The native CLI still requires a separate PHP executable for this command.
The selected `--db` value is passed as `DB_CONNECTION`. Clear Laravel's cached
configuration when changing drivers.
Restart the command after editing `.env`. Artisan's automatic environment reload
is disabled so the selected database driver stays applied to HTTP requests.

MySQL and PostgreSQL modes require Docker Compose services named `mysql` or
`pgsql`, respectively, and `redis` in that project. A failed dependency launch
stops startup. Compose services remain running when the HTTP process ends.
Run queue workers and the scheduler separately as your application requires.

POSIX native binaries forward SIGINT and SIGTERM to the active HTTP or Compose
process and wait up to five seconds before stopping it. Source and PHAR installs
use this forwarding when their PHP runtime provides `pcntl` and `posix`. Windows uses its
console interruption behavior. Existing Compose services remain caller-owned.
dw server:start-dev --port=9090 --data-dir=./workflow-data
```

`server:start-dev` runs the native Server and bundled SQLite compiled into
`dw`. No PHP, Docker, Redis, separate Server installation or runtime download
is needed. It works from an empty directory, creates the schema and default
namespace, and runs its own timers and maintenance. Application SDK workers
run separately.

The default address is `127.0.0.1:8080`. Only loopback binds are accepted.
`--host=localhost` and `--host=::1` are supported. `--port=0` chooses an available
port and prints the selected URL. The bundled database driver is `sqlite`.

Data persists in `dev-server` beside the CLI's config file. `--data-dir` selects
another directory. Only one development Server can use a directory at a time.
The development runtime refuses incompatible existing database ownership.
It does not take over or upgrade an unrelated PHP database.

The default development bearer token is `dev-token`. Pass `--token` to use a
custom token, which is not printed. Connect from another terminal:

```bash
dw env:set local --server=http://127.0.0.1:8080 --token=dev-token --make-default
dw doctor
```

Existing native `DW_*` payload, query and storage limits also apply. The runtime
reports itself as a development build. Its source is pinned in the CLI
dependency lock. It is not the separately qualified published Server image.
Ctrl+C and SIGTERM shut down HTTP and native maintenance and preserve the data.
No background dependency services are launched or left running.

For a standalone Server using published images, follow the
[service quickstart](https://durable-workflow.com/docs/quickstart/).
Expand Down
Loading
Loading