mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-01 00:27:07 +01:00
* weed: report the host transparent huge page policy at startup Go maps the heap with MADV_HUGEPAGE, so the host THP policy applies to a SeaweedFS process whether or not the operator asked for it, and the advice in the Go GC guide depends on the heap size. Operators had no way to see which mode a node actually runs in. Log enabled/defrag/khugepaged.max_ptes_none once at startup from the long-running commands, and print the Go toolchain in `weed version` so a support bundle identifies the runtime that produced the binary. Nothing changes the policy: THP is host-wide, and GODEBUG=disablethp=1 remains the only per-process control. Refs #5437 * build: declare Go 1.27.4, the toolchain the releases already use The 4.55 release binaries report go1.27.4 (`go version -m` on the published tarball), while go.mod still said 1.26.6, the Dockerfiles pinned golang:1.26, and the release workflows left the Go version to the action default of "the latest stable at build time". A source build, a container and a downloaded tarball therefore ran different toolchains from the same tag, and the next release could silently pick up another one. Set the go directive to 1.27.4 in the root module and in the four modules that build in CI, bump the 16 Dockerfiles, and pin goversion: 1.27.4 in the 16 release and dev action steps. `go mod tidy` now emits the two require blocks Go 1.27 expects; no dependency version changed. Go 1.27's gofmt realigns 8 files. * weed mini: report the THP policy after quieting stderr The startup line ran from the dispatch point before runMini applied quietMiniLogs, so every weed mini start on Linux printed it to stderr, which mini keeps for the welcome banner, warnings and errors. Log it from runMini after quietMiniLogs so it lands in the log file only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: report whether the Go heap can use huge pages The runtime advises only GC metadata with MADV_HUGEPAGE and leaves the heap arenas to the host default, so under enabled=madvise the heap stays on small pages. The log still printed go_heap_disabled=false there, which reads as "the heap uses THP". Report go_heap_thp, true only under enabled=always without GODEBUG=disablethp, and drop the struct comment that said the heap is mapped with MADV_HUGEPAGE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: count an inherited PR_SET_THP_DISABLE in go_heap_thp A launcher can disable THP for the process with prctl, and children inherit it, so enabled=always alone does not mean the heap gets huge pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: read GODEBUG disablethp the way the runtime does The runtime applies GODEBUG left to right, so with disablethp=1,disablethp=0 the heap keeps THP, while the helper stopped at the first disablethp=1. The helper also missed other nonzero values such as disablethp=2, which the runtime treats as disabled, and trimmed spaces around keys, which the runtime keeps. Take the last disablethp with an integer value, treat any nonzero value as disabled, and match keys exactly. The parser now takes the GODEBUG string, so it is tested without changing the environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: honor per-size THP policies in go_heap_thp Since Linux 6.8 each anonymous huge page size has its own policy in hugepages-<size>kB/enabled, and only "inherit" follows the top-level knob. A 64kB size set to "always" gives the unadvised heap huge pages under a top-level "madvise" or "never", and a 2048kB size set to "never" takes them away under "always", but the log judged only the top-level value. Read the per-size policies and report go_heap_thp=true when any size reaches the heap. Under a top-level "never", the "disabled by the host" line is now printed only when no size reaches the heap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: report go_heap_thp=unknown when the process setting is unreadable If PR_GET_THP_DISABLE fails, for example because a seccomp profile rejects it, the process THP setting is not known, but the log treated it as allowed and could print go_heap_thp=true. Print go_heap_thp=unknown in that case. It stays false when the host or GODEBUG already rules out heap huge pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * util: report go_heap_thp=unknown when a per-size THP policy is unreadable An unreadable hugepages-<size>kB/enabled was skipped, so the log could say the host disabled THP while that size allowed it. Keep it as an empty mode and report unknown unless a readable size already allows huge pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: take the Go version from go.mod in tests and releases posix-compliance pinned GO_VERSION 1.26 and built go 1.27.4 modules only through the GOTOOLCHAIN auto-switch; nine workflows used go-version ^1.26 and the kafka jobs ran in golang:1.26-alpine. Read the version from go.mod with go-version-file, as the other setup-go steps already do, moving checkout ahead of setup-go where it came after so the file exists. The posix report takes the version from the setup-go output. The release and dev builds pinned goversion 1.27.4 in 16 places. The pinned go-release-action reads the go directive when goversion is go.mod, so the binaries now follow go.mod without a second copy of the version. * weed: report the THP policy from every long-running command mount, worker, iam, master.follower, the filer sync/backup/remote/replicate daemons and the mq agent and kafka gateway keep serving after startup like the commands already listed; mount is likely where heap size matters most. fuse is not listed: its first process starts a child with the same arguments and waits, so logging at dispatch would print the line twice. It logs in runFuse just before handing over to runMount, which only the child reaches. --------- Co-authored-by: Konstantin Lebedev <whitefox@mayflower.work> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
137 lines
4.7 KiB
YAML
137 lines
4.7 KiB
YAML
name: "test s3 over https using aws-cli"
|
|
|
|
on:
|
|
push:
|
|
branches: [master, test-https-s3-awscli]
|
|
paths:
|
|
- 'weed/s3api/**'
|
|
- 'weed/server/**'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- '.github/workflows/test-s3-over-https-using-awscli.yml'
|
|
pull_request:
|
|
branches: [master, test-https-s3-awscli]
|
|
paths:
|
|
- 'weed/s3api/**'
|
|
- 'weed/server/**'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- '.github/workflows/test-s3-over-https-using-awscli.yml'
|
|
|
|
env:
|
|
AWS_ACCESS_KEY_ID: some_access_key1
|
|
AWS_SECRET_ACCESS_KEY: some_secret_key1
|
|
AWS_ENDPOINT_URL: https://localhost:8443
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: weed
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}
|
|
|
|
jobs:
|
|
awscli-tests:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: ${{ runner.environment == 'github-hosted' }}
|
|
|
|
- name: Build SeaweedFS
|
|
run: |
|
|
go build
|
|
|
|
- name: Start SeaweedFS
|
|
run: |
|
|
set -e
|
|
mkdir -p /tmp/data
|
|
./weed -v=3 server -s3 -dir=/tmp/data -s3.config=../docker/compose/s3.json -master.peers=none > weed.log 2>&1 &
|
|
until curl -s http://localhost:8333/healthz > /dev/null; do sleep 1; done
|
|
|
|
- name: Setup Caddy
|
|
run: |
|
|
CADDY_VERSION=2.11.9
|
|
base="https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}"
|
|
curl -fsSLO "${base}/caddy_${CADDY_VERSION}_linux_amd64.tar.gz"
|
|
curl -fsSLO "${base}/caddy_${CADDY_VERSION}_checksums.txt"
|
|
grep " caddy_${CADDY_VERSION}_linux_amd64.tar.gz$" "caddy_${CADDY_VERSION}_checksums.txt" | sha512sum -c -
|
|
tar -xzf "caddy_${CADDY_VERSION}_linux_amd64.tar.gz" caddy
|
|
./caddy version
|
|
echo "{
|
|
auto_https disable_redirects
|
|
local_certs
|
|
}
|
|
localhost:8443 {
|
|
tls internal
|
|
reverse_proxy localhost:8333
|
|
}" > Caddyfile
|
|
|
|
- name: Start Caddy
|
|
run: |
|
|
./caddy start
|
|
until curl -fsS --insecure https://localhost:8443/healthz > /dev/null; do sleep 1; done
|
|
|
|
- name: Create Bucket
|
|
run: |
|
|
aws --no-verify-ssl s3api create-bucket --bucket bucket
|
|
|
|
- name: Test PutObject
|
|
run: |
|
|
set -e
|
|
dd if=/dev/urandom of=generated bs=1M count=2
|
|
aws --no-verify-ssl s3api put-object --bucket bucket --key test-putobject --body generated
|
|
aws --no-verify-ssl s3api get-object --bucket bucket --key test-putobject downloaded
|
|
diff -q generated downloaded
|
|
rm -f generated downloaded
|
|
|
|
- name: Test Multi-part Upload
|
|
run: |
|
|
set -e
|
|
dd if=/dev/urandom of=generated bs=1M count=32
|
|
aws --no-verify-ssl s3 cp --no-progress generated s3://bucket/test-multipart
|
|
for i in 1 2 3 4 5; do
|
|
aws --no-verify-ssl s3 cp --no-progress s3://bucket/test-multipart downloaded && break
|
|
if [ "$i" -eq 5 ]; then exit 1; fi
|
|
sleep 2
|
|
done
|
|
diff -q generated downloaded
|
|
rm -f generated downloaded
|
|
|
|
- name: Test GetObject with If-Match
|
|
run: |
|
|
set -e
|
|
dd if=/dev/urandom of=generated bs=1M count=32
|
|
ETAG=$(aws --no-verify-ssl s3api put-object --bucket bucket --key test-get-obj --body generated | jq -r .ETag)
|
|
# jq -r already removes quotes, so use ETAG directly (handles both simple and multipart ETags)
|
|
aws --no-verify-ssl s3api get-object --bucket bucket --key test-get-obj --if-match "$ETAG" downloaded
|
|
diff -q generated downloaded
|
|
rm -f generated downloaded
|
|
|
|
- name: Show server logs on failure
|
|
if: failure()
|
|
run: |
|
|
echo "========================================="
|
|
echo "SeaweedFS Server Logs"
|
|
echo "========================================="
|
|
# Note: weed.log is relative to working-directory (weed/)
|
|
if [ -f weed.log ]; then
|
|
cat weed.log
|
|
else
|
|
echo "No weed.log file found"
|
|
fi
|
|
|
|
- name: Upload server logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: seaweedfs-logs
|
|
# Note: actions don't use defaults.run.working-directory, so path is relative to workspace root
|
|
path: weed/weed.log
|
|
retention-days: 3
|