|
5 | 5 | * Maintainers: [Joshua Nelson], [Pietro Albini]
|
6 | 6 | * [Instance metrics][grafana-instance] (only available to infra team members).
|
7 | 7 | * [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) |
110 | 9 |
|
111 | 10 | [repo]: https://github.com/rust-lang/docs.rs
|
112 | 11 | [grafana-instance]: https://grafana.rust-lang.org/d/rpXrFfKWz/instance-metrics?orgId=1&var-instance=docsrs.infra.rust-lang.org:9100
|
|
0 commit comments