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
2 changes: 1 addition & 1 deletion contributing/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ projects, backends, repos, secrets, and gateways.

The Python API consists of the low-level and high-level Python API. The low-level Python API is a Python wrapper around
the server's HTTP API. It's available as `dstack.api.server`. The high-level API provides a more convenient interface to
work with `dstack` programatically. It's available as `dstack.api`. The `dstack` CLI is implemented on top of the
work with `dstack` programmatically. It's available as `dstack.api`. The `dstack` CLI is implemented on top of the
high-level API.

When the server provisions a cloud instance for a run, it launches a Docker image with the runner inside the image. The
Expand Down
4 changes: 2 additions & 2 deletions contributing/BACKENDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ To support it, `dstack` expects the following from the cloud provider:

The examples of container-based backends include: `kubernetes`, `vastai`, etc.

Note: There are two types of compute in dstack:
Note: There are two types of computing in dstack:

When `dstack` provisions a VM, it launches there `dstack-runner`.
When `dstack` provisions a VM, it launches their `dstack-runner`.

[//]: # (TODO: Elaborate on what dstack-runner is and how it works)

Expand Down
4 changes: 2 additions & 2 deletions contributing/LOCKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ allow independent locking of different resources.
## Postgres locking

Postgres resource locking is implemented via standard SELECT FOR UPDATE.
SQLAlchemy provides `.with_for_update()` that has not effect if SELECT FOR UPDATE is not supported as in SQLite.
SQLAlchemy provides `.with_for_update()` that has no effect if SELECT FOR UPDATE is not supported as in SQLite.

There are few places that rely on advisory locks as when generating unique resource names.

Expand Down Expand Up @@ -85,4 +85,4 @@ the changes may not be visible to another transaction that acquired the lock and

**Don't use joinedload when selecting .with_for_update()**

In fact, using `joinedload` and `.with_for_update()` will trigger and error because `joinedload` produces OUTER LEFT JOIN that cannot be used with SELECT FOR UPDATE. A regular `.join()` can be used to lock related resources but it may lead to no rows if there is no row to join. Usually, you'd select with `selectinload` or first select with `.with_for_update()` without loading related attributes and then re-selecting with `joinedload` without `.with_for_update()`.
In fact, using `joinedload` and `.with_for_update()` will trigger an error because `joinedload` produces OUTER LEFT JOIN that cannot be used with SELECT FOR UPDATE. A regular `.join()` can be used to lock related resources but it may lead to no rows if there is no row to join. Usually, you'd select with `selectinload` or first select with `.with_for_update()` without loading related attributes and then re-selecting with `joinedload` without `.with_for_update()`.