Skip to content

Commit 2920b0d

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/fork-support
2 parents 3875ca2 + d7f582a commit 2920b0d

40 files changed

Lines changed: 1175 additions & 680 deletions

.github/workflows/pgo-profile.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Refresh PGO profile
2+
# Regenerates caddy/frankenphp/default.pgo by hammering frankenphp with wrk in
3+
# both regular and worker mode (see build-pgo.sh) and opens a PR with the
4+
# new merged profile. Direct `go build` and the Dockerfile auto-detect it;
5+
# xcaddy users still need an explicit --pgo flag.
6+
concurrency:
7+
cancel-in-progress: false
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
on:
10+
push:
11+
branches:
12+
- main
13+
paths:
14+
- "**/*.go"
15+
- "frankenphp.c"
16+
- "profiles/**"
17+
- ".github/workflows/pgo-profile.yaml"
18+
workflow_dispatch:
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
jobs:
23+
refresh:
24+
environment: pgo
25+
name: Generate PGO profile
26+
runs-on: ubuntu-latest
27+
env:
28+
GOTOOLCHAIN: local
29+
GOFLAGS: "-tags=nobadger,nomysql,nopgx"
30+
LIBRARY_PATH: ${{ github.workspace }}/watcher/target/lib
31+
BENCH_SEC: "30"
32+
steps:
33+
- uses: actions/checkout@v6
34+
with:
35+
fetch-depth: 0
36+
# zizmor: ignore[artipacked]
37+
# persist-credentials is intentionally left enabled because this
38+
# workflow needs to push a branch via git push (mirrors translate.yaml).
39+
- uses: actions/setup-go@v6
40+
with:
41+
go-version: "1.26"
42+
cache-dependency-path: |
43+
go.sum
44+
caddy/go.sum
45+
- uses: shivammathur/setup-php@v2
46+
with:
47+
php-version: "8.5"
48+
ini-file: development
49+
coverage: none
50+
tools: none
51+
env:
52+
phpts: ts
53+
debug: true
54+
- name: Install e-dant/watcher
55+
uses: ./.github/actions/watcher
56+
- name: Set CGO flags
57+
run: echo "CGO_CFLAGS=-I${PWD}/watcher/target/include $(php-config --includes)" >> "${GITHUB_ENV}"
58+
- name: Install wrk
59+
run: sudo apt-get update && sudo apt-get install -y wrk
60+
- name: Generate profile
61+
run: ./profiles/build-pgo.sh
62+
- name: Show pprof summary
63+
run: |
64+
go install github.com/google/pprof@latest
65+
"$(go env GOPATH)/bin/pprof" -top -cum -nodecount=25 caddy/frankenphp/default.pgo || true
66+
- name: Open PR with refreshed profile
67+
env:
68+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
ACTOR: ${{ github.actor }}
70+
ACTOR_ID: ${{ github.actor_id }}
71+
RUN_ID: ${{ github.run_id }}
72+
SOURCE_SHA: ${{ github.sha }}
73+
BENCH_SEC: ${{ env.BENCH_SEC }}
74+
run: |
75+
git config user.name "github-actions[bot]"
76+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
77+
BRANCH="pgo/refresh-$RUN_ID"
78+
git checkout -b "$BRANCH"
79+
git add caddy/frankenphp/default.pgo
80+
git diff --cached --quiet && exit 0
81+
git commit -m "perf(pgo): refresh PGO profile" --author="$ACTOR <$ACTOR_ID+$ACTOR@users.noreply.github.com>"
82+
git push origin "$BRANCH"
83+
gh pr create \
84+
--title "perf(pgo): refresh PGO profile" \
85+
--body "Automated refresh of \`caddy/frankenphp/default.pgo\` from \`$SOURCE_SHA\`, generated with \`BENCH_SEC=$BENCH_SEC\` across every script in \`profiles/app/\` in both regular and worker mode." \
86+
--label "perf" \
87+
--label "bot"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/caddy/frankenphp/Build
22
/caddy/frankenphp/Caddyfile.test
33
/caddy/frankenphp/frankenphp
4+
/caddy/frankenphp/frankenphp-pgo
45
/caddy/frankenphp/frankenphp.exe
56
/caddy/frankenphp/public
67
/dist

caddy/frankenphp/default.pgo

282 KB
Binary file not shown.

caddy/go.mod

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ replace github.com/dunglas/frankenphp => ../
77
retract v1.0.0-rc.1 // Human error
88

99
require (
10-
github.com/caddyserver/caddy/v2 v2.11.2
11-
github.com/caddyserver/certmagic v0.25.2
10+
github.com/caddyserver/caddy/v2 v2.11.3
11+
github.com/caddyserver/certmagic v0.25.3
1212
github.com/dunglas/caddy-cbrotli v1.0.1
1313
github.com/dunglas/frankenphp v1.12.2
14-
github.com/dunglas/mercure v0.22.1
15-
github.com/dunglas/mercure/caddy v0.22.1
14+
github.com/dunglas/mercure v0.24.0
15+
github.com/dunglas/mercure/caddy v0.24.0
1616
github.com/dunglas/vulcain/caddy v1.4.0
1717
github.com/prometheus/client_golang v1.23.2
1818
github.com/spf13/cobra v1.10.2
1919
github.com/stretchr/testify v1.11.1
2020
)
2121

22-
require github.com/smallstep/go-attestation v0.4.4-0.20241119153605-2306d5b464ca // indirect
22+
require github.com/smallstep/go-attestation v0.4.9 // indirect
2323

2424
require (
25-
cel.dev/expr v0.25.1 // indirect
25+
cel.dev/expr v0.25.2 // indirect
2626
cloud.google.com/go/auth v0.20.0 // indirect
2727
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
2828
cloud.google.com/go/compute/metadata v0.9.0 // indirect
@@ -31,16 +31,16 @@ require (
3131
filippo.io/edwards25519 v1.2.0 // indirect
3232
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
3333
github.com/BurntSushi/toml v1.6.0 // indirect
34-
github.com/DeRuina/timberjack v1.4.1 // indirect
34+
github.com/DeRuina/timberjack v1.4.2 // indirect
3535
github.com/KimMachineGun/automemlimit v0.7.5 // indirect
3636
github.com/Masterminds/goutils v1.1.1 // indirect
37-
github.com/Masterminds/semver/v3 v3.4.0 // indirect
37+
github.com/Masterminds/semver/v3 v3.5.0 // indirect
3838
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
3939
github.com/MauriceGit/skiplist v0.0.0-20211105230623-77f5c8d3e145 // indirect
4040
github.com/MicahParks/jwkset v0.11.0 // indirect
4141
github.com/MicahParks/keyfunc/v3 v3.8.0 // indirect
42-
github.com/RoaringBitmap/roaring/v2 v2.16.0 // indirect
43-
github.com/alecthomas/chroma/v2 v2.23.1 // indirect
42+
github.com/RoaringBitmap/roaring/v2 v2.18.0 // indirect
43+
github.com/alecthomas/chroma/v2 v2.24.1 // indirect
4444
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
4545
github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b // indirect
4646
github.com/beorn7/perks v1.0.1 // indirect
@@ -59,24 +59,24 @@ require (
5959
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
6060
github.com/dgraph-io/ristretto v0.2.0 // indirect
6161
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da // indirect
62-
github.com/dlclark/regexp2 v1.11.5 // indirect
62+
github.com/dlclark/regexp2 v1.12.0 // indirect
6363
github.com/dunglas/httpsfv v1.1.0 // indirect
6464
github.com/dunglas/skipfilter v1.0.0 // indirect
6565
github.com/dunglas/vulcain v1.4.0 // indirect
6666
github.com/dustin/go-humanize v1.0.1 // indirect
6767
github.com/e-dant/watcher v0.0.0-20260223030516-06f84a1314be // indirect
6868
github.com/felixge/httpsnoop v1.0.4 // indirect
69-
github.com/fsnotify/fsnotify v1.9.0 // indirect
70-
github.com/fxamacker/cbor/v2 v2.9.1 // indirect
71-
github.com/getkin/kin-openapi v0.134.0 // indirect
69+
github.com/fsnotify/fsnotify v1.10.1 // indirect
70+
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
71+
github.com/getkin/kin-openapi v0.138.0 // indirect
7272
github.com/go-chi/chi/v5 v5.2.5 // indirect
7373
github.com/go-jose/go-jose/v3 v3.0.5 // indirect
7474
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
7575
github.com/go-logr/logr v1.4.3 // indirect
7676
github.com/go-logr/stdr v1.2.2 // indirect
77-
github.com/go-openapi/jsonpointer v0.22.5 // indirect
78-
github.com/go-openapi/swag/jsonname v0.25.5 // indirect
79-
github.com/go-sql-driver/mysql v1.9.3 // indirect
77+
github.com/go-openapi/jsonpointer v0.23.1 // indirect
78+
github.com/go-openapi/swag/jsonname v0.26.0 // indirect
79+
github.com/go-sql-driver/mysql v1.10.0 // indirect
8080
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
8181
github.com/gofrs/uuid v4.4.0+incompatible // indirect
8282
github.com/gofrs/uuid/v5 v5.4.0 // indirect
@@ -90,26 +90,26 @@ require (
9090
github.com/google/go-tspi v0.3.0 // indirect
9191
github.com/google/s2a-go v0.1.9 // indirect
9292
github.com/google/uuid v1.6.0 // indirect
93-
github.com/googleapis/enterprise-certificate-proxy v0.3.14 // indirect
94-
github.com/googleapis/gax-go/v2 v2.21.0 // indirect
93+
github.com/googleapis/enterprise-certificate-proxy v0.3.15 // indirect
94+
github.com/googleapis/gax-go/v2 v2.22.0 // indirect
9595
github.com/gorilla/handlers v1.5.2 // indirect
9696
github.com/gorilla/mux v1.8.1 // indirect
97-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
97+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
9898
github.com/huandu/xstrings v1.5.0 // indirect
9999
github.com/inconshreveable/mousetrap v1.1.0 // indirect
100100
github.com/jackc/pgpassfile v1.0.0 // indirect
101101
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
102-
github.com/jackc/pgx/v5 v5.9.1 // indirect
102+
github.com/jackc/pgx/v5 v5.9.2 // indirect
103103
github.com/jackc/puddle/v2 v2.2.2 // indirect
104104
github.com/josharian/intern v1.0.0 // indirect
105-
github.com/klauspost/compress v1.18.5 // indirect
105+
github.com/klauspost/compress v1.18.6 // indirect
106106
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
107107
github.com/kylelemons/godebug v1.1.0 // indirect
108108
github.com/libdns/libdns v1.1.1 // indirect
109109
github.com/mailru/easyjson v0.9.2 // indirect
110110
github.com/manifoldco/promptui v0.9.0 // indirect
111111
github.com/mattn/go-colorable v0.1.14 // indirect
112-
github.com/mattn/go-isatty v0.0.21 // indirect
112+
github.com/mattn/go-isatty v0.0.22 // indirect
113113
github.com/maypok86/otter/v2 v2.3.0 // indirect
114114
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
115115
github.com/mholt/acmez/v3 v3.1.6 // indirect
@@ -120,24 +120,25 @@ require (
120120
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
121121
github.com/mschoch/smat v0.2.0 // indirect
122122
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
123-
github.com/oasdiff/yaml v0.0.1 // indirect
124-
github.com/oasdiff/yaml3 v0.0.1 // indirect
123+
github.com/oasdiff/yaml v0.0.9 // indirect
124+
github.com/oasdiff/yaml3 v0.0.12 // indirect
125125
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
126-
github.com/pelletier/go-toml/v2 v2.3.0 // indirect
126+
github.com/pelletier/go-toml/v2 v2.3.1 // indirect
127127
github.com/perimeterx/marshmallow v1.1.5 // indirect
128-
github.com/pires/go-proxyproto v0.11.0 // indirect
128+
github.com/pires/go-proxyproto v0.12.0 // indirect
129129
github.com/pkg/errors v0.9.1 // indirect
130130
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
131131
github.com/prometheus/client_model v0.6.2 // indirect
132132
github.com/prometheus/common v0.67.5 // indirect
133133
github.com/prometheus/otlptranslator v1.0.0 // indirect
134134
github.com/prometheus/procfs v0.20.1 // indirect
135135
github.com/quic-go/qpack v0.6.0 // indirect
136-
github.com/quic-go/quic-go v0.59.0 // indirect
136+
github.com/quic-go/quic-go v0.59.1 // indirect
137137
github.com/rs/cors v1.11.1 // indirect
138138
github.com/rs/xid v1.6.0 // indirect
139139
github.com/russross/blackfriday/v2 v2.1.0 // indirect
140140
github.com/sagikazarmark/locafero v0.12.0 // indirect
141+
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
141142
github.com/shopspring/decimal v1.4.0 // indirect
142143
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
143144
github.com/sirupsen/logrus v1.9.4 // indirect
@@ -156,7 +157,7 @@ require (
156157
github.com/subosito/gotenv v1.6.0 // indirect
157158
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
158159
github.com/tailscale/tscert v0.0.0-20251216020129-aea342f6d747 // indirect
159-
github.com/tidwall/gjson v1.18.0 // indirect
160+
github.com/tidwall/gjson v1.19.0 // indirect
160161
github.com/tidwall/match v1.2.0 // indirect
161162
github.com/tidwall/pretty v1.2.1 // indirect
162163
github.com/tidwall/sjson v1.2.5 // indirect
@@ -197,30 +198,30 @@ require (
197198
go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect
198199
go.opentelemetry.io/otel/trace v1.43.0 // indirect
199200
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
200-
go.step.sm/crypto v0.77.2 // indirect
201+
go.step.sm/crypto v0.79.0 // indirect
201202
go.uber.org/automaxprocs v1.6.0 // indirect
202203
go.uber.org/multierr v1.11.0 // indirect
203-
go.uber.org/zap v1.27.1 // indirect
204+
go.uber.org/zap v1.28.0 // indirect
204205
go.uber.org/zap/exp v0.3.0 // indirect
205206
go.yaml.in/yaml/v2 v2.4.4 // indirect
206207
go.yaml.in/yaml/v3 v3.0.4 // indirect
207-
golang.org/x/crypto v0.49.0 // indirect
208-
golang.org/x/crypto/x509roots/fallback v0.0.0-20260323153451-8400f4a93807 // indirect
209-
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
210-
golang.org/x/mod v0.34.0 // indirect
211-
golang.org/x/net v0.52.0 // indirect
208+
golang.org/x/crypto v0.51.0 // indirect
209+
golang.org/x/crypto/x509roots/fallback v0.0.0-20260511143831-44decbfe70e2 // indirect
210+
golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a // indirect
211+
golang.org/x/mod v0.36.0 // indirect
212+
golang.org/x/net v0.54.0 // indirect
212213
golang.org/x/oauth2 v0.36.0 // indirect
213214
golang.org/x/sync v0.20.0 // indirect
214-
golang.org/x/sys v0.43.0 // indirect
215-
golang.org/x/term v0.41.0 // indirect
216-
golang.org/x/text v0.35.0 // indirect
215+
golang.org/x/sys v0.44.0 // indirect
216+
golang.org/x/term v0.43.0 // indirect
217+
golang.org/x/text v0.37.0 // indirect
217218
golang.org/x/time v0.15.0 // indirect
218-
golang.org/x/tools v0.43.0 // indirect
219-
google.golang.org/api v0.275.0 // indirect
220-
google.golang.org/genproto/googleapis/api v0.0.0-20260406210006-6f92a3bedf2d // indirect
221-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260406210006-6f92a3bedf2d // indirect
222-
google.golang.org/grpc v1.80.0 // indirect
223-
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.1 // indirect
219+
golang.org/x/tools v0.45.0 // indirect
220+
google.golang.org/api v0.278.0 // indirect
221+
google.golang.org/genproto/googleapis/api v0.0.0-20260511170946-3700d4141b60 // indirect
222+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260511170946-3700d4141b60 // indirect
223+
google.golang.org/grpc v1.81.0 // indirect
224+
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.2 // indirect
224225
google.golang.org/protobuf v1.36.11 // indirect
225226
gopkg.in/yaml.v3 v3.0.1 // indirect
226227
howett.net/plist v1.0.1 // indirect

0 commit comments

Comments
 (0)