Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/badges/master-payload-size.json

This file was deleted.

99 changes: 99 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ jobs:
echo "IMAGE=${REGISTRY}/${OWNER}/${IMAGE_NAME}" >> "$GITHUB_ENV"
echo "Image namespace: ${REGISTRY}/${OWNER}/${IMAGE_NAME}"

- name: Compute build info
id: build_info
run: |
{
echo "created=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "source=https://github.com/${GITHUB_REPOSITORY}"
echo "branch=${GITHUB_REF_NAME}"
echo "run_url=https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
echo "author<<EOF"
git log -1 --format='%an <%ae>'
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
Expand All @@ -68,6 +81,17 @@ jobs:
${{ env.IMAGE }}:ci
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=${{ steps.build_info.outputs.created }}
VCS_REF=${{ github.sha }}
VCS_URL=${{ steps.build_info.outputs.source }}
SOURCE_BRANCH=${{ steps.build_info.outputs.branch }}
IMAGE_NAME=${{ env.IMAGE }}
GITHUB_RUN_ID=${{ github.run_id }}
GITHUB_RUN_ATTEMPT=${{ github.run_attempt }}
GITHUB_RUN_URL=${{ steps.build_info.outputs.run_url }}
GITHUB_ACTOR=${{ github.actor }}
COMMIT_AUTHOR=${{ steps.build_info.outputs.author }}
cache-from: type=gha
cache-to: type=gha,mode=max,ignore-error=true

Expand Down Expand Up @@ -124,6 +148,19 @@ jobs:
echo "IMAGE=${REGISTRY}/${OWNER}/${IMAGE_NAME}" >> "$GITHUB_ENV"
echo "Image namespace: ${REGISTRY}/${OWNER}/${IMAGE_NAME}"

- name: Compute build info
id: build_info
run: |
{
echo "created=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "source=https://github.com/${GITHUB_REPOSITORY}"
echo "branch=${GITHUB_REF_NAME}"
echo "run_url=https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
echo "author<<EOF"
git log -1 --format='%an <%ae>'
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
Expand Down Expand Up @@ -165,5 +202,67 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=${{ steps.build_info.outputs.created }}
VCS_REF=${{ github.sha }}
VCS_URL=${{ steps.build_info.outputs.source }}
SOURCE_BRANCH=${{ steps.build_info.outputs.branch }}
IMAGE_NAME=${{ env.IMAGE }}
GITHUB_RUN_ID=${{ github.run_id }}
GITHUB_RUN_ATTEMPT=${{ github.run_attempt }}
GITHUB_RUN_URL=${{ steps.build_info.outputs.run_url }}
GITHUB_ACTOR=${{ github.actor }}
COMMIT_AUTHOR=${{ steps.build_info.outputs.author }}
cache-from: type=gha
cache-to: type=gha,mode=max,ignore-error=true

update-size-badge:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
continue-on-error: true
permissions:
contents: write

steps:
- name: Configure Git default branch
run: git config --global init.defaultBranch master

- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Generate badge data
run: BADGE_PATH=tmp/master-payload-size.json bash scripts/update-size-badge.sh

- name: Publish badge data
run: |
set -euo pipefail
badge_branch="size-badge-data"
badge_file="tmp/master-payload-size.json"
worktree="$(mktemp -d)"

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

if git ls-remote --exit-code --heads origin "$badge_branch" >/dev/null 2>&1; then
git fetch origin "$badge_branch"
git worktree add "$worktree" "origin/$badge_branch"
git -C "$worktree" switch -c "$badge_branch"
else
git worktree add --detach "$worktree"
git -C "$worktree" switch --orphan "$badge_branch"
git -C "$worktree" rm -rf . >/dev/null 2>&1 || true
fi

cp "$badge_file" "$worktree/master-payload-size.json"
git -C "$worktree" add master-payload-size.json

if git -C "$worktree" diff --cached --quiet; then
echo "Badge data unchanged"
exit 0
fi

git -C "$worktree" commit -m "Update master payload badge"
git -C "$worktree" push origin "HEAD:$badge_branch"
1 change: 1 addition & 0 deletions Caddyfile.site
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
root * /srv
encode zstd gzip
respond /healthz 200
header /build-info.json Cache-Control "no-store"
header /_next/static/* Cache-Control "public, max-age=31536000, immutable"
header /optimized/* Cache-Control "public, max-age=604800"
header /partners/* Cache-Control "public, max-age=604800"
Expand Down
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,50 @@ RUN npm run build
FROM caddy:2.9-alpine AS runner
WORKDIR /srv

ARG BUILD_DATE="unknown"
ARG VCS_REF="unknown"
ARG VCS_URL="https://github.com/Devsh-Graphics-Programming/MainWebsite"
ARG SOURCE_BRANCH="unknown"
ARG IMAGE_NAME="www-website"
ARG GITHUB_RUN_ID="unknown"
ARG GITHUB_RUN_ATTEMPT="unknown"
ARG GITHUB_RUN_URL="unknown"
ARG GITHUB_ACTOR="unknown"
ARG COMMIT_AUTHOR="unknown"

LABEL org.opencontainers.image.title="DevSH Graphics Programming Website" \
org.opencontainers.image.description="Static DevSH website served by Caddy" \
org.opencontainers.image.url="https://www.devsh.eu" \
org.opencontainers.image.source="${VCS_URL}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.authors="${COMMIT_AUTHOR}"

RUN addgroup -S caddy && adduser -S caddy -G caddy

COPY --from=build --chown=caddy:caddy /app/out ./
COPY --chown=caddy:caddy Caddyfile.site /etc/caddy/Caddyfile

RUN set -eu; \
json_escape() { printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g'; }; \
{ \
printf '{\n'; \
printf ' "schemaVersion": 1,\n'; \
printf ' "image": "%s",\n' "$(json_escape "$IMAGE_NAME")"; \
printf ' "source": "%s",\n' "$(json_escape "$VCS_URL")"; \
printf ' "revision": "%s",\n' "$(json_escape "$VCS_REF")"; \
printf ' "branch": "%s",\n' "$(json_escape "$SOURCE_BRANCH")"; \
printf ' "created": "%s",\n' "$(json_escape "$BUILD_DATE")"; \
printf ' "commitAuthor": "%s",\n' "$(json_escape "$COMMIT_AUTHOR")"; \
printf ' "builder": {\n'; \
printf ' "actor": "%s",\n' "$(json_escape "$GITHUB_ACTOR")"; \
printf ' "runId": "%s",\n' "$(json_escape "$GITHUB_RUN_ID")"; \
printf ' "runAttempt": "%s",\n' "$(json_escape "$GITHUB_RUN_ATTEMPT")"; \
printf ' "runUrl": "%s"\n' "$(json_escape "$GITHUB_RUN_URL")"; \
printf ' }\n'; \
printf '}\n'; \
} > /srv/build-info.json

EXPOSE 3000
USER caddy
ENTRYPOINT ["caddy", "run", "--config=/etc/caddy/Caddyfile"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img src="https://github.com/Devsh-Graphics-Programming/MainWebsite/actions/workflows/docker-publish.yml/badge.svg?branch=master" alt="Build Status" />
</a>
<a href="https://github.com/Devsh-Graphics-Programming/MainWebsite">
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FDevsh-Graphics-Programming%2FMainWebsite%2Fmaster%2F.github%2Fbadges%2Fmaster-payload-size.json" alt="Master payload size" />
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FDevsh-Graphics-Programming%2FMainWebsite%2Fsize-badge-data%2Fmaster-payload-size.json" alt="Master payload size" />
</a>
<a href="https://discord.gg/krsBcABm7u">
<img src="https://img.shields.io/discord/308323056592486420?label=discord&logo=discord&logoColor=white&color=7289DA" alt="Join our Discord" />
Expand All @@ -24,7 +24,7 @@ This repo is a Next.js app used to generate a static site. The final production

## Repository size budget
- CI fails if the tracked tree exceeds `10 MiB`, `public/` exceeds `8 MiB`, any tracked blob exceeds `1 MiB`, or HEAD Git blob payloads exceed `15 MiB`.
- Run `scripts/check-size-budget.sh` locally before adding new media. If the badge changes, commit the updated `.github/badges/master-payload-size.json`.
- Run `scripts/check-size-budget.sh` locally before adding new media. The README badge is informational and is updated outside the size gate.

## Runtime filesystem layout
- The image is read-only, but Caddy still needs tiny writable slots for TLS cache/autosave/lock files.
Expand Down
8 changes: 7 additions & 1 deletion app/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ export default function footer() {
return (
<div className="flex flex-col items-center justify-center p-1 border-t border-t-[#181818]">
<GP_Links/>
<a
href="/build-info.json"
className="pb-1 text-[10px] leading-none text-neutral-700 transition-colors hover:text-neutral-500"
>
build info
</a>
</div>
)
}
}
4 changes: 2 additions & 2 deletions app/components/Partners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export type Partner = {
const partners: Partner[] = [
{ name: "Applications in CADD", initials: "AC", logo: "/partners/appscadd.png", url: "https://appsincadd.co.uk/" },
{ name: "Synera", initials: "SY", logo: "/partners/synera.png", url: "https://www.synera.io/", logoTone: "invert" },
{ name: "Ditt", initials: "DT", logo: "/partners/ditt.png", url: "https://www.ditt.nl/" },
{ name: "Imverse", initials: "IM", logo: "/partners/imverse.png", url: "https://www.imverse.ch/" },
{ name: "Ditt Officemakers", initials: "DT", logo: "/partners/ditt.png", url: "https://www.ditt.nl/" },
{ name: "Imverse", initials: "IM", logo: "/partners/imverse.png", url: "https://www.imverse.com/" },
{ name: "Wild Software Inc", initials: "WI", logo: "/partners/wild.jpg", url: "https://factionsvr.com/" },
{ name: "RELEX Solutions", initials: "RX", logo: null, url: "https://relexsolutions.com/" },
];
Expand Down
4 changes: 2 additions & 2 deletions app/components/ProjectsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Project = {
const projects: Project[] = [
{
slug: "ditt",
company: "Ditt",
company: "Ditt Officemakers",
url: "https://www.ditt.nl/",
title: "Interactive GPU Path Tracer",
summary: "Real-time and offline rendering work for interior design workflows using OpenCL, OptiX, Mitsuba and Vulkan.",
Expand Down Expand Up @@ -87,7 +87,7 @@ const projects: Project[] = [
{
slug: "imverse",
company: "Imverse",
url: "https://www.imverse.ch/",
url: "https://www.imverse.com/",
title: "GPGPU Computer Vision",
summary: "Computer vision acceleration work for real-time volumetric capture and RGB+D processing.",
bullets: [
Expand Down
2 changes: 1 addition & 1 deletion app/components/TestimonialsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const testimonials: Testimonial[] = [
},
{
name: "Yoran Bosman",
role: "Senior Software Architect",
role: "Partner & Software Architect",
profilePicture: "/testimonials/yoran.jpg",
companyIcon: "/partners/ditt.png",
testimonial:
Expand Down
2 changes: 1 addition & 1 deletion app/services/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default function Page() {
</Paragraph>
<ul className="list-disc pl-5 mt-4 flex flex-col gap-2">
<li><strong>Graphics &amp; Compute APIs:</strong> Vulkan, DirectX 12, DirectX 11, CUDA, OpenCL, WebGPU, OpenGL (including ES &amp; WebGL), NVN, SYCL.</li>
<li><strong>Shading &amp; Architecture:</strong> SPIR-V, HLSL 202x, Slang, GLSL and WHSL.</li>
<li><strong>Shading &amp; Architecture:</strong> SPIR-V, HLSL 202x, Slang, GLSL and WGSL.</li>
<li><strong>Build Systems:</strong> CMake, Conan, Python, SWIG, MCJIT, ORCJIT, Clang Customizations, LLVM Toolchains.</li>
<li><strong>Infrastructure, CI/CD &amp; Tooling:</strong> Docker, Jenkins, Kubernetes, Terraform, AWS, Proxmox, vGPUs, virGL, venus, virtIO, QEMU.</li>
<li><strong>Delivering Web Experiences:</strong> WASM, Emscripten, TypeScript, .NET 7, Venus-Protocol, ChromeOS native APK development.</li>
Expand Down
17 changes: 7 additions & 10 deletions scripts/check-size-budget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ check_limit "Tracked public/ size" "$public_tree_bytes" "$max_public_bytes"
echo "Largest tracked files:"
git ls-tree -r -l HEAD |
sort -k4,4nr |
head -20 |
awk '{ printf " %8.2f MiB %s\n", $4 / 1048576, $5 }'
awk '
NR <= 20 {
path = $5
for (i = 6; i <= NF; i++) path = path " " $i
printf " %8.2f MiB %s\n", $4 / 1048576, path
}
'

if ! git ls-tree -r -l HEAD |
awk -v max="$max_blob_bytes" '
Expand Down Expand Up @@ -90,12 +95,4 @@ fi
history_blob_bytes="$(sum_head_blob_bytes)"
check_limit "HEAD Git blob payload size" "$history_blob_bytes" "$max_history_blob_bytes"

if [ -x scripts/update-size-badge.sh ]; then
scripts/update-size-badge.sh
if ! git diff --exit-code -- .github/badges/master-payload-size.json >/dev/null; then
echo "::error file=.github/badges/master-payload-size.json::Repository size badge is stale. Run scripts/update-size-badge.sh and commit the result."
fail=1
fi
fi

exit "$fail"
2 changes: 1 addition & 1 deletion scripts/update-size-badge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

max_history_blob_bytes="${MAX_HISTORY_BLOB_BYTES:-15728640}"
warning_history_blob_bytes="${WARNING_HISTORY_BLOB_BYTES:-12582912}"
badge_path="${BADGE_PATH:-.github/badges/master-payload-size.json}"
badge_path="${BADGE_PATH:-tmp/master-payload-size.json}"

history_blob_bytes="$(
git rev-list --objects HEAD |
Expand Down