Skip to content

Commit 6efccc8

Browse files
committed
Merge branch 'claude/migrate-to-bun-N6zGf' into 'master'
Migrate to Bun + Upgrade Docusaurus to 3.9.2 Closes #157 See merge request postgres-ai/docs!848
2 parents 3abe4ec + 55de985 commit 6efccc8

File tree

18 files changed

+3390
-26000
lines changed

18 files changed

+3390
-26000
lines changed

.ci/validate-feeds.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -e
55

66
echo "Building site to generate feeds..."
7-
npm run build
7+
bun run build
88

99
echo ""
1010
echo "Validating RSS/Atom feeds..."

.gitlab-ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ variables:
2525
# Validate RSS/Atom feeds before building and deploying
2626
validate_feeds:
2727
stage: validate
28-
image: node:18
28+
image: oven/bun:1.3-debian
2929
before_script:
3030
# Install xmllint for XML validation
3131
- apt-get update && apt-get install -y libxml2-utils jq
32-
- npm ci
32+
- bun install --frozen-lockfile
3333
script:
3434
- bash .ci/validate-feeds.sh
3535
artifacts:
@@ -39,8 +39,7 @@ validate_feeds:
3939
- build/blog/*.json
4040
expire_in: 1 week
4141
only:
42-
- merge_requests
43-
- master
42+
- branches
4443

4544
# Stages templates.
4645
.job_template: &build_and_push_definition

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
FROM node:18.20
1+
FROM oven/bun:1.3-debian
2+
3+
# Install only libvips runtime (not -dev) so sharp uses prebuilt binaries
4+
# This is much faster than compiling from source (~2 min saved)
5+
RUN apt-get update && apt-get install -y --no-install-recommends libvips42 && rm -rf /var/lib/apt/lists/*
26

37
ARG ARG_REACT_APP_API_SERVER
48
ENV REACT_APP_API_SERVER=$ARG_REACT_APP_API_SERVER
@@ -26,15 +30,11 @@ ENV UMAMI_SCRIPT_URL=$ARG_UMAMI_SCRIPT_URL
2630

2731
WORKDIR /docs
2832

29-
COPY package.json ./
30-
COPY package-lock.json ./
31-
RUN npm ci
33+
COPY package.json bun.lock ./
34+
RUN bun install --frozen-lockfile
3235

3336
COPY . .
34-
# Make cache folder if not exists.
35-
RUN mkdir -p .cache
36-
RUN mv .cache node_modules
37-
RUN npm run build
37+
RUN bun run build
3838

3939
EXPOSE 3000
40-
CMD ["npm", "run", "serve"]
40+
CMD ["bun", "run", "serve"]

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ Learn more: https://documentation.divio.com/
1313

1414
## Engine
1515

16-
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
16+
This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.
1717

18-
### Installation / Build
18+
### Installation
1919

2020
```shell
21-
$ npm install
21+
bun install
2222
```
2323

2424
### Local Development
2525

2626
```shell
27-
$ npm run start
27+
bun start
2828
```
2929

30-
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
30+
This command starts a local development server and opens a browser window. Most changes are reflected live without having to restart the server.

blog/20250721-dblab-engine-4-0-released.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ When creating a branch or a clone takes a second and costs nothing extra, teams
226226
## Performance at scale
227227

228228
Testing with production workloads demonstrates:
229-
- **Clone creation**: <2 seconds for any database, regardless of size (even if it's 50 TiB!)
229+
- **Clone creation**: &lt;2 seconds for any database, regardless of size (even if it's 50 TiB!)
230230
- **Snapshot creation**: O(1) operation regardless of database size
231231
- **Branch switching**: Instant (pointer update only)
232232
- **Concurrent users**: 15 users on 10 TiB database with 30-second clone creation under load

blog/20251105-postgres-marathon-2-012.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ time pgbackrest \
150150
# Start with --process-max=8 for a balance of speed and resource usage
151151
# Increase to 16-32 for maximum speed on fast networks (10+ Gbps)
152152
# Network compression (--compress-level-network=1) provides minimal benefit
153-
# on fast networks (<6% improvement) but is useful for slower networks (<10 Gbps)
153+
# on fast networks (&lt;6% improvement) but is useful for slower networks (&lt;10 Gbps)
154154
```
155155

156156
If CPU resources are constrained on the source server, reduce priority for pgBackRest processes on the primary:
@@ -297,7 +297,7 @@ For production deployments:
297297

298298
1. Start with `--process-max=$(($(nproc)/2))` to balance performance with system load
299299
2. Monitor CPU usage on both source and destination during backup
300-
3. Network compression (`--compress-level-network=1`) doesn't seem to be providing a significant improvement on fast networks (10+ Gbps). Use it for slower networks (<10 Gbps) where it can be more beneficial
300+
3. Network compression (`--compress-level-network=1`) doesn't seem to be providing a significant improvement on fast networks (10+ Gbps). Use it for slower networks (&lt;10 Gbps) where it can be more beneficial
301301
4. Consider using `renice` on the source server if CPU contention affects production workload
302302
5. Ensure sufficient I/O capacity on the destination to handle parallel writes
303303
6. For high parallelism (64+), increase SSH limits: `MaxStartups=200:30:300` and `MaxSessions=200` in `/etc/ssh/sshd_config`. Alternatively, SSH ControlMaster creates a single persistent connection that all subsequent SSH sessions multiplex through — we haven't tested this approach yet, but it's worth exploring for reducing connection overhead at high parallelism levels

bun.lock

Lines changed: 3309 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/dblab-howtos/administration/ci-observer-postgres-log-masking.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ Replacement rules are applied to all log fields of the incoming PostgreSQL CSV l
5656
## Regular expressions
5757
The syntax of the regular expressions accepted is the same general syntax used by Perl, Python, and other languages. You can find syntax details here: https://github.com/google/re2/wiki/Syntax.
5858

59-
In a template, a variable is denoted by a substring of the form $name or ${name}, where name is a non-empty sequence of letters, digits, and underscores.
60-
A purely numeric name like `$1` refers to a submatch with the corresponding index; other names refer to capturing parentheses named with the `(?P<name>...)` syntax.
59+
In a template, a variable is denoted by a substring of the form `$name` or `${name}`, where name is a non-empty sequence of letters, digits, and underscores.
60+
A purely numeric name like `$1` refers to a submatch with the corresponding index; other names refer to capturing parentheses named with the `(?P<name>...)` syntax.
6161
A reference to an out-of-range or unmatched index or a name that is not present in the regular expression is replaced by an empty string.
6262

6363
To insert a literal `$` in the output, use `$$` in the template.

docs/reference-guides/database-lab-engine-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The clone's container name is associated with its port number, such as `dblab_cl
2929

3030
#### Container labels
3131
- `dblab_clone`
32-
- <pool_name>
32+
- `<pool_name>`
3333

3434
#### Responsibility
3535
- Provides a thin clone: an independent PostgreSQL database server with thinly cloned / branched data directory

docusaurus.config.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ module.exports = {
4040
organizationName: 'postgres-ai',
4141
projectName: 'docs',
4242

43+
// Use CommonMark for .md files to avoid MDX parsing issues
44+
markdown: {
45+
format: 'detect',
46+
},
47+
4348
customFields: {
4449
signInUrl: SIGN_IN_URL,
4550
apiUrlPrefix: API_URL_PREFIX,
@@ -376,14 +381,29 @@ module.exports = {
376381
},
377382

378383
prism: {
379-
theme: require('prism-react-renderer/themes/nightOwlLight'),
380-
darkTheme: require('prism-react-renderer/themes/nightOwl'),
384+
theme: require('prism-react-renderer').themes.nightOwlLight,
385+
darkTheme: require('prism-react-renderer').themes.nightOwl,
381386
},
382387
},
383388

384389
clientModules: [],
385390

386391
plugins: [
392+
// Fix cytoscape module resolution for mermaid
393+
function () {
394+
return {
395+
name: 'webpack-cytoscape-fix',
396+
configureWebpack() {
397+
return {
398+
resolve: {
399+
alias: {
400+
'cytoscape/dist/cytoscape.umd.js': require.resolve('cytoscape'),
401+
},
402+
},
403+
};
404+
},
405+
};
406+
},
387407
[
388408
'@docusaurus/plugin-ideal-image',
389409
{
@@ -587,6 +607,7 @@ module.exports = {
587607
showReadingTime: true,
588608
editUrl: 'https://gitlab.com/postgres-ai/docs/-/edit/master/',
589609
path: 'blog',
610+
onInlineTags: 'ignore',
590611
routeBasePath: 'blog',
591612
postsPerPage: 10,
592613
blogSidebarTitle: 'Categories',

0 commit comments

Comments
 (0)