Skip to content

Commit abc4771

Browse files
authored
[docs.rs] Add instructions for increasing build limits (#319)
* Show how to raise limits for a crate * Link to docs.rs maintenance in infra section This avoids the docs getting out of date when changes are made. * limits -> build limits
1 parent 592b16a commit abc4771

File tree

2 files changed

+28
-102
lines changed

2 files changed

+28
-102
lines changed

src/docs-rs/maintenance.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,33 @@ cratesfyi queue add <crate> <version>
5656

5757
This will add the crate with a lower priority than new crates by default, you can change the priority with the `-p` option.
5858

59+
## Raise the limits for a specific crate
60+
61+
Occasionally crates will ask for their build limits to be raised.
62+
You can raise them from the docs.rs machine with `psql`.
63+
64+
Raising a memory limit to 8 GB:
65+
66+
```psql
67+
# memory is measured in bytes
68+
cratesfyi=> INSERT INTO sandbox_overrides (crate_name, max_memory_bytes)
69+
VALUES ('crate name', 8589934592);
70+
```
71+
72+
Raising a timeout to 15 minutes:
73+
74+
```psql
75+
cratesfyi=> INSERT INTO sandbox_overrides (crate_name, timeout_seconds)
76+
VALUES ('crate name', 900);
77+
```
78+
79+
Raising limits for multiple crates at once:
80+
81+
```psql
82+
cratesfyi=> INSERT INTO sandbox_overrides (crate_name, max_memory_bytes)
83+
VALUES ('stm32f4', 8589934592), ('stm32h7', 8589934592), ('stm32g4', 8589934592);
84+
```
85+
5986
## Adding all the crates failed after a date back in the queue
6087

6188
After an outage you might want to add all the failed builds back to the queue.

src/infra/docs/docs-rs.md

Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -5,108 +5,7 @@
55
* Maintainers: [Joshua Nelson], [Pietro Albini]
66
* [Instance metrics][grafana-instance] (only available to infra team members).
77
* [Application metrics][grafana-app] (only available to infra team members).
8-
9-
## Common maintenance procedures
10-
11-
### Temporarily remove a crate from the queue
12-
13-
It might happen that a crate fails to build repeatedly due to a docs.rs bug,
14-
clogging up the queue and preventing other crates to build. In this case it's
15-
possible to temporarily remove the crate from the queue until the docs.rs's bug
16-
is fixed. To do that, log into the machine and open a PostgreSQL shell with:
17-
18-
```
19-
$ psql
20-
```
21-
22-
Then you can run this SQL query to remove the crate:
23-
24-
```
25-
UPDATE queue SET attempt = 100 WHERE name = '<CRATE_NAME>';
26-
```
27-
28-
To add the crate back in the queue you can run in the PostgreSQL shell this
29-
query:
30-
31-
```
32-
UPDATE queue SET attempt = 0 WHERE name = '<CRATE_NAME>';
33-
```
34-
35-
### Pinning a version of nightly
36-
37-
Sometimes the latest nightly might be broken, causing doc builds to fail. In
38-
those cases it's possible to tell docs.rs to stop updating to the latest
39-
nightly and instead pin a specific release. To do that you need to edit the
40-
`/home/cratesfyi/.docs-rs-env` file, adding or changing this environment
41-
variable:
42-
43-
```
44-
CRATESFYI_TOOLCHAIN=nightly-YYYY-MM-DD
45-
```
46-
47-
Once the file changed docs.rs needs to be restarted:
48-
49-
```
50-
systemctl restart docs.rs
51-
```
52-
53-
To return to the latest nightly simply remove the environment variable and
54-
restart docs.rs again.
55-
56-
### Rebuild a specific crate
57-
58-
If a bug was recently fixed, you may want to rebuild a crate so that it builds with the latest version.
59-
From the docs.rs machine:
60-
61-
```
62-
cratesfyi queue add <crate> <version>
63-
```
64-
65-
This will add the crate with a lower priority than new crates by default, you can change the priority with the `-p` option.
66-
67-
### Adding all the crates failed after a date back in the queue
68-
69-
After an outage you might want to add all the failed builds back to the queue.
70-
To do that, log into the machine and open a PostgreSQL shell with:
71-
72-
```
73-
psql
74-
```
75-
76-
Then you can run this SQL query to add all the crates failed after `YYYY-MM-DD
77-
HH:MM:SS` back in the queue:
78-
79-
```
80-
UPDATE queue SET attempt = 0 WHERE attempt >= 5 AND build_time > 'YYYY-MM-DD HH:MM:SS';
81-
```
82-
83-
### Removing a crate from the website
84-
85-
Sometimes it might be needed to remove all the content related to a crate from
86-
docs.rs (for example after receiving a DMCA). To do that, log into the server
87-
and run:
88-
89-
```
90-
cratesfyi database delete-crate CRATE_NAME
91-
```
92-
93-
The command will remove all the data from the database, and then remove the
94-
files from S3.
95-
96-
### Blacklisting crates
97-
98-
Occasionally it might be needed to prevent a crate from being built on docs.rs,
99-
for example if we can't legally host the content of those crates. To add a
100-
crate to the blacklist, preventing new builds for it, you can run:
101-
102-
```
103-
cratesfyi database blacklist add <CRATE_NAME>
104-
```
105-
106-
Other operations (such as `list` and `remove`) are also supported.
107-
108-
> **Warning:** blacklisting a crate doesn't remove existing content from the
109-
> website, it just prevents new versions from being built!
8+
* [Common maintenance procedures](../../docs-rs/maintenance.html)
1109

11110
[repo]: https://github.com/rust-lang/docs.rs
11211
[grafana-instance]: https://grafana.rust-lang.org/d/rpXrFfKWz/instance-metrics?orgId=1&var-instance=docsrs.infra.rust-lang.org:9100

0 commit comments

Comments
 (0)