Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reference docs for [deploy.release_command_vm] #1875

Merged
merged 3 commits into from
Nov 27, 2024
Merged
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
12 changes: 11 additions & 1 deletion reference/configuration.html.markerb
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,19 @@

The `release_command` value replaces `CMD` in the temporary Machine. This is useful for running database migrations before app Machines are created or updated with the new release. Note that the Docker image's `ENTRYPOINT` is not overridden by the `release_command`; `ENTRYPOINT` always runs.

The temporary Machine has full access to the network, environment variables and secrets, but *not* to persistent volumes. Changes made to the file system on the temporary Machine will not be retained or deployed. The building/compiling of your project should be done in your Dockerfile. If you need to modify persistent volumes or configure your application, consider making use of `CMD` or `ENTRYPOINT` in your Dockerfile, or of a [process group command](#the-processes-section).
By default, the temporary Machine has full access to the network, environment variables and secrets, but *not* to persistent volumes. Changes made to the file system on the temporary Machine will not be retained or deployed. The building/compiling of your project should be done in your Dockerfile. If you need to modify persistent volumes or configure your application, consider making use of `CMD` or `ENTRYPOINT` in your Dockerfile, or of a [process group command](#the-processes-section).

The temporary Machine inherits the size from the largest Machine in the default process group of the app as of flyctl v0.0.508 (they also default larger on empty/new apps, using the Machine `shared-cpu-2x` preset). The default process group is defined as either the `app` process, or the first process group in alphabetical order (if an `app` process is not present).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rephrase to "By default, the temporary Machine inherits..." yadda yadda

It is also possible to explicitly define the Machine size by setting `[deploy.release_command_vm]` like in:

```toml
[deploy]
release_command = "bin/rails db:prepare"

[deploy.release_command_vm]
size = "performance-1x"
memory = "8gb"
```

A non-zero exit status from this command will stop the deployment. `fly deploy` will display logs from the command. Logs are available via `fly logs` as well.

Expand Down Expand Up @@ -681,7 +691,7 @@
* `kill_signal`: The signal to send to the test process if it runs too long. Defaults to the signal of the image, if a custom image is set.
* `kill_timeout`: The time to wait before sending the kill signal. Defaults to the timeout of the image, if a custom image is set.

Machine checks are especially useful for canary deploys. `flyctl` will spawn a new Machine, ensure all machine capabilities are functional, and then deploy the rest of the Machines in your app.

Check warning on line 694 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 694, "column": 103}}}, "severity": "INFO"}

## The `mounts` section

Expand Down Expand Up @@ -848,13 +858,13 @@
processes = ["app"]
```

When a machine unexpectedly exits, our scheduling machinery follows a machine’s restart policy to restart it without your intervention. These policies are quite similar to docker’s container restart policies:

Check warning on line 861 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 861, "column": 7}}}, "severity": "INFO"}

Check warning on line 861 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 861, "column": 70}}}, "severity": "INFO"}

- always: we’ll attempt to restart the machine no matter the exit code.

Check warning on line 863 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 863, "column": 39}}}, "severity": "INFO"}
- never: we won’t restart the machine even if it exits with a non-zero exit code.

Check warning on line 864 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 864, "column": 30}}}, "severity": "INFO"}
- on-failure: we’ll only restart the machine if it exited with a non-zero exit code (due to a failure or crash). This is the default policy if one is not explicitly set.

Check warning on line 865 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 865, "column": 37}}}, "severity": "INFO"}

A restart policy can be targeted to a specific process group. If a group is not specified, all machines in an app will have the same default restart policy. You can also specify the number of times we should retry restarting the machine before giving up.

Check warning on line 867 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machines' instead of 'machines'. Raw Output: {"message": "[Fly.Machine] Use 'Machines' instead of 'machines'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 867, "column": 95}}}, "severity": "INFO"}

Check warning on line 867 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 867, "column": 229}}}, "severity": "INFO"}

## The `checks` section

Expand Down Expand Up @@ -975,7 +985,7 @@

The "guest path" --- the path inside your container where the files to serve are located --- can overlap with other static mappings; the URL prefix should not (so, two mappings to `/public/foo` and `/public/bar` are fine, but two mappings to `/public` are not).

Alternatively, you can serve statics directly from object storage using [Tigris](/docs/tigris/). Similar to machine statics, requests under `url_prefix` are served from static assets in your Tigris bucket under `guest_path`. The same rules apply for overlapping URL prefixes.

Check warning on line 988 in reference/configuration.html.markerb

View workflow job for this annotation

GitHub Actions / Vale linter

[vale] reported by reviewdog 🐶 [Fly.Machine] Use 'Machine' instead of 'machine'. Raw Output: {"message": "[Fly.Machine] Use 'Machine' instead of 'machine'.", "location": {"path": "reference/configuration.html.markerb", "range": {"start": {"line": 988, "column": 108}}}, "severity": "INFO"}

```toml
[[statics]]
Expand Down
Loading