serialbench 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/benchmark.yml +294 -229
- data/.github/workflows/rake.yml +11 -0
- data/.github/workflows/windows-debug.yml +171 -0
- data/.gitignore +32 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +274 -0
- data/Gemfile +15 -1
- data/README.adoc +41 -0
- data/data/schemas/result.yml +29 -0
- data/docs/PLATFORM_VALIDATION_FIX.md +79 -0
- data/docs/SYCK_YAML_FIX.md +91 -0
- data/docs/WEBSITE_COMPLETION_PLAN.md +440 -0
- data/docs/WINDOWS_LIBXML_FIX.md +136 -0
- data/docs/WINDOWS_SETUP.md +122 -0
- data/lib/serialbench/benchmark_runner.rb +3 -3
- data/lib/serialbench/cli/benchmark_cli.rb +74 -1
- data/lib/serialbench/cli/environment_cli.rb +3 -3
- data/lib/serialbench/cli/resultset_cli.rb +112 -26
- data/lib/serialbench/cli/ruby_build_cli.rb +75 -88
- data/lib/serialbench/cli/validate_cli.rb +88 -0
- data/lib/serialbench/cli.rb +6 -2
- data/lib/serialbench/config_manager.rb +15 -26
- data/lib/serialbench/models/benchmark_config.rb +12 -0
- data/lib/serialbench/models/benchmark_result.rb +39 -3
- data/lib/serialbench/models/environment_config.rb +3 -2
- data/lib/serialbench/models/platform.rb +61 -6
- data/lib/serialbench/models/result.rb +28 -1
- data/lib/serialbench/models/result_set.rb +8 -0
- data/lib/serialbench/ruby_build_manager.rb +19 -23
- data/lib/serialbench/runners/asdf_runner.rb +1 -1
- data/lib/serialbench/runners/docker_runner.rb +2 -4
- data/lib/serialbench/runners/local_runner.rb +71 -0
- data/lib/serialbench/serializers/base_serializer.rb +1 -1
- data/lib/serialbench/serializers/json/rapidjson_serializer.rb +1 -5
- data/lib/serialbench/serializers/toml/base_toml_serializer.rb +0 -2
- data/lib/serialbench/serializers/toml/toml_rb_serializer.rb +1 -1
- data/lib/serialbench/serializers/toml/tomlib_serializer.rb +1 -1
- data/lib/serialbench/serializers/xml/base_xml_serializer.rb +6 -1
- data/lib/serialbench/serializers/xml/leptris_serializer.rb +167 -0
- data/lib/serialbench/serializers/xml/libxml_serializer.rb +13 -8
- data/lib/serialbench/serializers/xml/nokogiri_serializer.rb +11 -2
- data/lib/serialbench/serializers/xml/oga_serializer.rb +8 -8
- data/lib/serialbench/serializers/xml/ox_serializer.rb +2 -2
- data/lib/serialbench/serializers/xml/rexml_serializer.rb +3 -3
- data/lib/serialbench/serializers/yaml/base_yaml_serializer.rb +1 -3
- data/lib/serialbench/serializers/yaml/psych_serializer.rb +1 -5
- data/lib/serialbench/serializers/yaml/syck_serializer.rb +1 -1
- data/lib/serialbench/serializers.rb +5 -3
- data/lib/serialbench/site_generator.rb +234 -2
- data/lib/serialbench/templates/assets/css/format_based.css +1 -53
- data/lib/serialbench/templates/assets/css/themes.css +5 -4
- data/lib/serialbench/templates/assets/js/chart_helpers.js +44 -14
- data/lib/serialbench/templates/assets/js/dashboard.js +14 -15
- data/lib/serialbench/templates/format_based.liquid +480 -252
- data/lib/serialbench/version.rb +1 -1
- data/lib/serialbench/yaml_validator.rb +36 -0
- data/serialbench.gemspec +11 -2
- data/site/.gitignore +5 -0
- data/site/README.md +32 -0
- data/site/astro.config.mjs +12 -0
- data/site/package-lock.json +6160 -0
- data/site/package.json +22 -0
- data/site/public/favicon.svg +4 -0
- data/site/scripts/gen-sample-data.mjs +154 -0
- data/site/src/components/AvailabilityMatrix.astro +61 -0
- data/site/src/components/CalibratedLeaderboard.vue +134 -0
- data/site/src/components/CitationBox.vue +50 -0
- data/site/src/components/DashboardConsole.vue +193 -0
- data/site/src/components/FeaturesTable.astro +97 -0
- data/site/src/components/MemoryPanel.vue +44 -0
- data/site/src/components/OpsChart.vue +135 -0
- data/site/src/config.ts +18 -0
- data/site/src/layouts/Layout.astro +85 -0
- data/site/src/lib/channels.ts +24 -0
- data/site/src/lib/dashboard.ts +269 -0
- data/site/src/pages/index.astro +44 -0
- data/site/src/pages/library/[slug].astro +128 -0
- data/site/src/pages/methodology.astro +55 -0
- data/site/src/styles/global.css +103 -0
- data/site/tsconfig.json +5 -0
- metadata +58 -23
- data/.github/workflows/ci.yml +0 -74
- data/.github/workflows/docker.yml +0 -272
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
name: docker
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ main, master ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ main, master ]
|
|
8
|
-
schedule:
|
|
9
|
-
# Build Docker images weekly on Saturdays at 1 AM UTC
|
|
10
|
-
- cron: '0 1 * * 6'
|
|
11
|
-
workflow_dispatch:
|
|
12
|
-
# Allow manual triggering
|
|
13
|
-
|
|
14
|
-
permissions:
|
|
15
|
-
contents: read
|
|
16
|
-
packages: write
|
|
17
|
-
|
|
18
|
-
env:
|
|
19
|
-
REGISTRY: ghcr.io
|
|
20
|
-
IMAGE_NAME: ${{ github.repository }}/serialbench
|
|
21
|
-
|
|
22
|
-
jobs:
|
|
23
|
-
setup:
|
|
24
|
-
runs-on: ubuntu-latest
|
|
25
|
-
outputs:
|
|
26
|
-
ruby-versions: ${{ steps.set-matrix.outputs.ruby-versions }}
|
|
27
|
-
should-build: ${{ steps.check-changes.outputs.should-build }}
|
|
28
|
-
steps:
|
|
29
|
-
- name: Checkout repository
|
|
30
|
-
uses: actions/checkout@v4
|
|
31
|
-
with:
|
|
32
|
-
fetch-depth: 2
|
|
33
|
-
|
|
34
|
-
- name: Set Ruby version matrix
|
|
35
|
-
id: set-matrix
|
|
36
|
-
run: |
|
|
37
|
-
echo 'ruby-versions=["3.1", "3.2", "3.3", "3.4"]' >> $GITHUB_OUTPUT
|
|
38
|
-
|
|
39
|
-
- name: Check if Docker build is needed
|
|
40
|
-
id: check-changes
|
|
41
|
-
run: |
|
|
42
|
-
# Always build on workflow_dispatch or schedule
|
|
43
|
-
if [ "${{ github.event_name }}" == "workflow_dispatch" ] || [ "${{ github.event_name }}" == "schedule" ]; then
|
|
44
|
-
echo "should-build=true" >> $GITHUB_OUTPUT
|
|
45
|
-
echo "Manual or scheduled build triggered"
|
|
46
|
-
exit 0
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
# Check if code has changed since last commit
|
|
50
|
-
if git diff --name-only HEAD~1 | grep -E '\.(rb|gemspec|yml|yaml)$|Gemfile|Dockerfile' > /dev/null; then
|
|
51
|
-
echo "should-build=true" >> $GITHUB_OUTPUT
|
|
52
|
-
echo "Code changes detected, will build new Docker images"
|
|
53
|
-
else
|
|
54
|
-
echo "should-build=false" >> $GITHUB_OUTPUT
|
|
55
|
-
echo "No relevant code changes, skipping Docker build"
|
|
56
|
-
fi
|
|
57
|
-
|
|
58
|
-
build-docker-images:
|
|
59
|
-
runs-on: ubuntu-latest
|
|
60
|
-
needs: setup
|
|
61
|
-
if: needs.setup.outputs.should-build == 'true'
|
|
62
|
-
strategy:
|
|
63
|
-
matrix:
|
|
64
|
-
ruby-version: ${{ fromJson(needs.setup.outputs.ruby-versions) }}
|
|
65
|
-
fail-fast: false
|
|
66
|
-
|
|
67
|
-
steps:
|
|
68
|
-
- name: Checkout repository
|
|
69
|
-
uses: actions/checkout@v4
|
|
70
|
-
|
|
71
|
-
- name: Set up Docker Buildx
|
|
72
|
-
uses: docker/setup-buildx-action@v3
|
|
73
|
-
|
|
74
|
-
- name: Log in to Container Registry
|
|
75
|
-
uses: docker/login-action@v3
|
|
76
|
-
with:
|
|
77
|
-
registry: ${{ env.REGISTRY }}
|
|
78
|
-
username: ${{ github.actor }}
|
|
79
|
-
password: ${{ secrets.GITHUB_TOKEN }}
|
|
80
|
-
|
|
81
|
-
- name: Extract metadata
|
|
82
|
-
id: meta
|
|
83
|
-
uses: docker/metadata-action@v5
|
|
84
|
-
with:
|
|
85
|
-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
86
|
-
tags: |
|
|
87
|
-
type=ref,event=branch,suffix=-ruby-${{ matrix.ruby-version }}
|
|
88
|
-
type=ref,event=pr,prefix=pr-,suffix=-ruby-${{ matrix.ruby-version }}
|
|
89
|
-
type=sha,suffix=-ruby-${{ matrix.ruby-version }}
|
|
90
|
-
type=raw,value=latest,suffix=-ruby-${{ matrix.ruby-version }},enable={{is_default_branch}}
|
|
91
|
-
|
|
92
|
-
- name: Build and push Docker image
|
|
93
|
-
uses: docker/build-push-action@v5
|
|
94
|
-
with:
|
|
95
|
-
context: .
|
|
96
|
-
file: docker/Dockerfile.ubuntu
|
|
97
|
-
build-args: |
|
|
98
|
-
RUBY_VERSION=${{ matrix.ruby-version }}
|
|
99
|
-
push: true
|
|
100
|
-
tags: ${{ steps.meta.outputs.tags }}
|
|
101
|
-
labels: ${{ steps.meta.outputs.labels }}
|
|
102
|
-
cache-from: type=gha
|
|
103
|
-
cache-to: type=gha,mode=max
|
|
104
|
-
platforms: linux/amd64,linux/arm64
|
|
105
|
-
|
|
106
|
-
- name: Test Docker image
|
|
107
|
-
run: |
|
|
108
|
-
# Get the first tag from the metadata output
|
|
109
|
-
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
|
110
|
-
echo "Testing image: $IMAGE_TAG"
|
|
111
|
-
|
|
112
|
-
# Test that the image works correctly
|
|
113
|
-
docker run --rm "$IMAGE_TAG" \
|
|
114
|
-
bundle exec serialbench list
|
|
115
|
-
|
|
116
|
-
- name: Run basic functionality test
|
|
117
|
-
run: |
|
|
118
|
-
# Get the first tag from the metadata output
|
|
119
|
-
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
|
120
|
-
echo "Testing functionality with image: $IMAGE_TAG"
|
|
121
|
-
|
|
122
|
-
# Create a temporary results directory
|
|
123
|
-
mkdir -p test-results
|
|
124
|
-
|
|
125
|
-
# Run a quick benchmark test
|
|
126
|
-
docker run --rm \
|
|
127
|
-
-v $(pwd)/test-results:/app/results \
|
|
128
|
-
"$IMAGE_TAG" \
|
|
129
|
-
bundle exec serialbench benchmark \
|
|
130
|
-
--formats json \
|
|
131
|
-
--iterations 1 \
|
|
132
|
-
--warmup 0 \
|
|
133
|
-
--output-dir /app/results
|
|
134
|
-
|
|
135
|
-
# Verify results were generated
|
|
136
|
-
ls -la test-results/
|
|
137
|
-
|
|
138
|
-
# Clean up
|
|
139
|
-
rm -rf test-results
|
|
140
|
-
|
|
141
|
-
test-docker-images:
|
|
142
|
-
runs-on: ubuntu-latest
|
|
143
|
-
needs: [setup, build-docker-images]
|
|
144
|
-
if: needs.setup.outputs.should-build == 'true'
|
|
145
|
-
strategy:
|
|
146
|
-
matrix:
|
|
147
|
-
ruby-version: ${{ fromJson(needs.setup.outputs.ruby-versions) }}
|
|
148
|
-
fail-fast: false
|
|
149
|
-
|
|
150
|
-
steps:
|
|
151
|
-
- name: Checkout repository
|
|
152
|
-
uses: actions/checkout@v4
|
|
153
|
-
|
|
154
|
-
- name: Set up Docker Buildx
|
|
155
|
-
uses: docker/setup-buildx-action@v3
|
|
156
|
-
|
|
157
|
-
- name: Log in to Container Registry
|
|
158
|
-
uses: docker/login-action@v3
|
|
159
|
-
with:
|
|
160
|
-
registry: ${{ env.REGISTRY }}
|
|
161
|
-
username: ${{ github.actor }}
|
|
162
|
-
password: ${{ secrets.GITHUB_TOKEN }}
|
|
163
|
-
|
|
164
|
-
- name: Extract metadata for testing
|
|
165
|
-
id: meta
|
|
166
|
-
uses: docker/metadata-action@v5
|
|
167
|
-
with:
|
|
168
|
-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
169
|
-
tags: |
|
|
170
|
-
type=ref,event=branch,suffix=-ruby-${{ matrix.ruby-version }}
|
|
171
|
-
type=ref,event=pr,prefix=pr-,suffix=-ruby-${{ matrix.ruby-version }}
|
|
172
|
-
type=sha,suffix=-ruby-${{ matrix.ruby-version }}
|
|
173
|
-
type=raw,value=latest,suffix=-ruby-${{ matrix.ruby-version }},enable={{is_default_branch}}
|
|
174
|
-
|
|
175
|
-
- name: Pull Docker image
|
|
176
|
-
run: |
|
|
177
|
-
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
|
178
|
-
echo "Pulling image: $IMAGE_TAG"
|
|
179
|
-
docker pull "$IMAGE_TAG"
|
|
180
|
-
|
|
181
|
-
- name: Test serializer availability
|
|
182
|
-
run: |
|
|
183
|
-
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
|
184
|
-
echo "Testing Ruby ${{ matrix.ruby-version }} container: $IMAGE_TAG"
|
|
185
|
-
docker run --rm "$IMAGE_TAG" \
|
|
186
|
-
bundle exec ruby -e "
|
|
187
|
-
require 'serialbench'
|
|
188
|
-
puts 'Available serializers:'
|
|
189
|
-
Serialbench::Serializers.available.each do |s|
|
|
190
|
-
serializer = s.new
|
|
191
|
-
puts \" #{serializer.format}: #{serializer.name} v#{serializer.version}\"
|
|
192
|
-
end
|
|
193
|
-
"
|
|
194
|
-
|
|
195
|
-
- name: Run comprehensive tests
|
|
196
|
-
run: |
|
|
197
|
-
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
|
198
|
-
echo "Running tests with image: $IMAGE_TAG"
|
|
199
|
-
docker run --rm "$IMAGE_TAG" \
|
|
200
|
-
bundle exec rspec --format progress
|
|
201
|
-
|
|
202
|
-
- name: Test benchmark execution
|
|
203
|
-
run: |
|
|
204
|
-
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
|
|
205
|
-
echo "Testing benchmark execution with image: $IMAGE_TAG"
|
|
206
|
-
mkdir -p docker-test-results
|
|
207
|
-
|
|
208
|
-
# Run a comprehensive but quick benchmark
|
|
209
|
-
docker run --rm \
|
|
210
|
-
-v $(pwd)/docker-test-results:/app/results \
|
|
211
|
-
"$IMAGE_TAG" \
|
|
212
|
-
bundle exec serialbench benchmark \
|
|
213
|
-
--formats xml json yaml toml \
|
|
214
|
-
--iterations 2 \
|
|
215
|
-
--warmup 1 \
|
|
216
|
-
--output-dir /app/results
|
|
217
|
-
|
|
218
|
-
# Verify all expected files were created
|
|
219
|
-
echo "Generated files:"
|
|
220
|
-
find docker-test-results -type f -name "*.json" -o -name "*.html" -o -name "*.csv"
|
|
221
|
-
|
|
222
|
-
# Clean up
|
|
223
|
-
rm -rf docker-test-results
|
|
224
|
-
|
|
225
|
-
cleanup:
|
|
226
|
-
runs-on: ubuntu-latest
|
|
227
|
-
needs: [setup, build-docker-images, test-docker-images]
|
|
228
|
-
if: always() && github.event_name != 'pull_request'
|
|
229
|
-
steps:
|
|
230
|
-
- name: Log in to Container Registry
|
|
231
|
-
uses: docker/login-action@v3
|
|
232
|
-
with:
|
|
233
|
-
registry: ${{ env.REGISTRY }}
|
|
234
|
-
username: ${{ github.actor }}
|
|
235
|
-
password: ${{ secrets.GITHUB_TOKEN }}
|
|
236
|
-
|
|
237
|
-
- name: Clean up old Docker images
|
|
238
|
-
run: |
|
|
239
|
-
echo "Docker image cleanup would be implemented here"
|
|
240
|
-
# Note: Actual cleanup requires additional GitHub API calls
|
|
241
|
-
# For now, we rely on GitHub's automatic cleanup policies
|
|
242
|
-
echo "Current images are tagged and will be managed by GitHub's retention policies"
|
|
243
|
-
|
|
244
|
-
summary:
|
|
245
|
-
runs-on: ubuntu-latest
|
|
246
|
-
needs: [setup, build-docker-images, test-docker-images]
|
|
247
|
-
if: always()
|
|
248
|
-
steps:
|
|
249
|
-
- name: Build Summary
|
|
250
|
-
run: |
|
|
251
|
-
echo "## Docker Build Summary" >> $GITHUB_STEP_SUMMARY
|
|
252
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
253
|
-
echo "**Build Status**: ${{ needs.build-docker-images.result }}" >> $GITHUB_STEP_SUMMARY
|
|
254
|
-
echo "**Test Status**: ${{ needs.test-docker-images.result }}" >> $GITHUB_STEP_SUMMARY
|
|
255
|
-
echo "**Should Build**: ${{ needs.setup.outputs.should-build }}" >> $GITHUB_STEP_SUMMARY
|
|
256
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
257
|
-
echo "### Available Images" >> $GITHUB_STEP_SUMMARY
|
|
258
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
259
|
-
echo "| Ruby Version | Image Tag |" >> $GITHUB_STEP_SUMMARY
|
|
260
|
-
echo "|--------------|-----------|" >> $GITHUB_STEP_SUMMARY
|
|
261
|
-
echo "| 3.1 | \`ghcr.io/metanorma/serialbench:main-ruby-3.1\` |" >> $GITHUB_STEP_SUMMARY
|
|
262
|
-
echo "| 3.2 | \`ghcr.io/metanorma/serialbench:main-ruby-3.2\` |" >> $GITHUB_STEP_SUMMARY
|
|
263
|
-
echo "| 3.3 | \`ghcr.io/metanorma/serialbench:main-ruby-3.3\` |" >> $GITHUB_STEP_SUMMARY
|
|
264
|
-
echo "| 3.4 | \`ghcr.io/metanorma/serialbench:main-ruby-3.4\` |" >> $GITHUB_STEP_SUMMARY
|
|
265
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
266
|
-
echo "### Usage" >> $GITHUB_STEP_SUMMARY
|
|
267
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
268
|
-
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
|
|
269
|
-
echo "# Pull and run latest Ruby 3.3 container" >> $GITHUB_STEP_SUMMARY
|
|
270
|
-
echo "docker pull ghcr.io/metanorma/serialbench:main-ruby-3.3" >> $GITHUB_STEP_SUMMARY
|
|
271
|
-
echo "docker run --rm -v \$(pwd)/results:/app/results ghcr.io/metanorma/serialbench:main-ruby-3.3" >> $GITHUB_STEP_SUMMARY
|
|
272
|
-
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|