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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @generated
# Input hashes for repository rule npm_translate_lock(name = "npm", pnpm_lock = "@@//frontend:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
frontend/package-lock.json=1050907894
frontend/package.json=-1287539742
frontend/patches/vite.patch=-1261363333
frontend/pnpm-lock.yaml=1245402688
33 changes: 27 additions & 6 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,35 @@
"uses": "actions/checkout@v4"
},
{
"name": "Build docker image",
"uses": "docker/build-push-action@v4",
"name": "Setup Node.js",
"uses": "actions/setup-node@v4",
"with": {
"context": "frontend/",
"file": "./frontend/Dockerfile",
"push": false,
"tags": "ghcr.io/buildbarn/bb-portal-frontend"
"node-version-file": "frontend/.nvmrc"
}
},
{
"name": "Install dependencies",
"run": "npm ci",
"working-directory": "frontend"
},
{
"name": "Generate frontend files",
"run": "npm run generate",
"working-directory": "frontend"
},
{
"name": "Check if any generated files changed",
"run": "git add . && git diff --exit-code HEAD --"
},
{
"name": "Test",
"run": "npm run test",
"working-directory": "frontend"
},
{
"name": "Build",
"run": "npm run build",
"working-directory": "frontend"
}
]
}
Expand Down
77 changes: 2 additions & 75 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"jobs": {
"publish_backend": {
"name": "Publish Backend (Bazel)",
"name": "Build and publish docker image",
"runs-on": "ubuntu-24.04-arm",
"steps": [
{
Expand All @@ -25,82 +25,9 @@
"run": "bazel run --stamp //cmd/bb_portal:bb_portal_container_push"
}
]
},
"publish_frontend_images": {
"name": "Build Frontend (${{ matrix.arch }})",
"runs-on": "${{ matrix.runner }}",
"steps": [
{
"name": "Check out source code",
"uses": "actions/checkout@v4"
},
{
"env": {
"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
},
"name": "Install Docker credentials",
"run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin"
},
{
"name": "Set tag variables",
"run": "echo \"TIMESTAMP=$(TZ=UTC date --date \"@$(git show -s --format=%ct HEAD)\" +%Y%m%dT%H%M%SZ)\" >> $GITHUB_ENV\necho \"SHA_SHORT=$(git rev-parse --short HEAD)\" >> $GITHUB_ENV\n"
},
{
"name": "Build and push variant",
"uses": "docker/build-push-action@v4",
"with": {
"context": "frontend",
"file": "./frontend/Dockerfile",
"push": true,
"tags": "ghcr.io/buildbarn/bb-portal-frontend:${{ env.TIMESTAMP }}-${{ env.SHA_SHORT }}-${{ matrix.arch }}"
}
}
],
"strategy": {
"matrix": {
"include": [
{
"arch": "arm64",
"runner": "ubuntu-24.04-arm"
},
{
"arch": "amd64",
"runner": "ubuntu-24.04"
}
]
}
}
},
"publish_frontend_manifest": {
"name": "Merge Frontend Manifest",
"needs": [
"publish_frontend_images"
],
"runs-on": "ubuntu-24.04-arm",
"steps": [
{
"name": "Check out source code",
"uses": "actions/checkout@v4"
},
{
"env": {
"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
},
"name": "Install Docker credentials",
"run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin"
},
{
"name": "Set tag variables",
"run": "echo \"TIMESTAMP=$(TZ=UTC date --date \"@$(git show -s --format=%ct HEAD)\" +%Y%m%dT%H%M%SZ)\" >> $GITHUB_ENV\necho \"SHA_SHORT=$(git rev-parse --short HEAD)\" >> $GITHUB_ENV\n"
},
{
"name": "Create and Push Manifest",
"run": "# Base image name\nIMAGE=\"ghcr.io/buildbarn/bb-portal-frontend\"\nTAG=\"${{ env.TIMESTAMP }}-${{ env.SHA_SHORT }}\"\n\n# Create a manifest list (a \"virtual\" image) that points to both arch-specific images\ndocker buildx imagetools create -t ${IMAGE}:${TAG} \\\n ${IMAGE}:${TAG}-amd64 \\\n ${IMAGE}:${TAG}-arm64\n"
}
]
}
},
"name": "Build and publish docker images",
"name": "Build and publish docker image",
"on": {
"push": {
"branches": [
Expand Down
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ load("@gazelle//:def.bzl", "gazelle")
# gazelle:resolve proto go google/rpc/status.proto @org_golang_google_genproto_googleapis_rpc//status
# gazelle:resolve proto build/bazel/remote/execution/v2/remote_execution.proto @bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_proto
# gazelle:resolve go github.com/buildbarn/bb-portal/pkg/proto/configuration/bb_portal //pkg/proto/configuration/bb_portal
# gazelle:resolve go github.com/buildbarn/bb-portal/pkg/proto/configuration/frontend //pkg/proto/configuration/frontend
# gazelle:resolve go github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2 @bazel_remote_apis//build/bazel/remote/execution/v2:remote_execution_go_proto

# gazelle:resolve_regexp proto github.com/buildbarn/bb-storage/(.*)/(.*)\.proto @com_github_buildbarn_bb_storage//$1:${2}_proto
Expand Down
30 changes: 26 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,28 @@ local_path_override(
path = "third_party/bazel",
)

bazel_dep(name = "aspect_bazel_lib", version = "2.22.5")
bazel_dep(name = "ape", version = "1.1.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.22.5")
bazel_dep(name = "aspect_rules_js", version = "3.0.3")
bazel_dep(name = "bazel_lib", version = "3.0.0")
bazel_dep(name = "bazel_remote_apis", version = "0.0.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "com_github_buildbarn_bb_browser")
bazel_dep(name = "com_github_buildbarn_bb_remote_execution")
bazel_dep(name = "com_github_buildbarn_bb_storage")
bazel_dep(name = "com_github_buildbarn_go_xdr")
bazel_dep(name = "gazelle", version = "0.47.0")
bazel_dep(name = "googleapis", version = "0.0.0-20260130-c0fcb356")
bazel_dep(name = "googletest", version = "1.17.0")
bazel_dep(name = "protobuf", version = "33.5")
bazel_dep(name = "opentelemetry-proto", version = "1.8.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "protobuf", version = "33.5")
bazel_dep(name = "rules_go", version = "0.59.0")
bazel_dep(name = "rules_img", version = "0.3.4")
bazel_dep(name = "rules_jsonnet", version = "0.7.2")
bazel_dep(name = "rules_nodejs", version = "6.7.3")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "opentelemetry-proto", version = "1.8.0")
bazel_dep(name = "toolchains_llvm_bootstrapped", version = "0.5.9")

git_override(
Expand Down Expand Up @@ -134,7 +138,6 @@ use_repo(
"com_github_pkg_errors",
"com_github_prometheus_client_golang",
"com_github_roaringbitmap_roaring",
"com_github_rs_cors",
"com_github_sqlc_dev_pqtype",
"com_github_stretchr_testify",
"com_github_uptrace_opentelemetry_go_extra_otelsql",
Expand All @@ -153,6 +156,25 @@ use_repo(
"org_uber_go_mock",
)

# Setup nodejs
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version_from_nvmrc = "//frontend:.nvmrc")
use_repo(node, "nodejs_toolchains")

# Translate the pnpm-lock.yaml file to bazel targets
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
data = [
"//frontend:package.json",
"//frontend:patches/vite.patch",
],
npm_package_lock = "//frontend:package-lock.json",
pnpm_lock = "//frontend:pnpm-lock.yaml",
update_pnpm_lock = True,
)
use_repo(npm, "npm")

# SQLC tooling
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

Expand Down
22 changes: 16 additions & 6 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading