Skip to content

Commit e2b6f5f

Browse files
V48 (impl-only): Build and document Pipeliner VCR image
Name the pipeline appliance pipeliner at vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner. Fix Dockerfile install and materialize-for-COPY flow, update host constants/docs/CI, and lockfile for @bitcode/pipeline-image. Image built for linux/amd64 and pushed as :latest and :v48-34d06682.
1 parent 34d0668 commit e2b6f5f

12 files changed

Lines changed: 308 additions & 164 deletions

File tree

.dockerignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Used by Pipeliner docker build (context = monorepo root).
2+
# Source: packages/pipeline-image/.dockerignore
3+
4+
# Context is monorepo root when building with -f packages/pipeline-image/Dockerfile
5+
.git
6+
.github
7+
**/.next
8+
**/coverage
9+
**/node_modules
10+
**/dist
11+
!packages/pipeline-image/dist
12+
!packages/pipeline-image/dist/**
13+
uapi/.next
14+
uapi/node_modules
15+
uapi/storybook-static
16+
uapi/tmp
17+
protocol-demonstration
18+
_legacy
19+
**/*.md
20+
!packages/pipeline-image/README.md
21+
**/*.test.ts
22+
**/*.test.tsx
23+
**/__tests__
24+
**/.turbo
25+
**/*.log
26+
.env
27+
.env.*
28+
**/.env.local

.github/workflows/pipeline-image.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: Pipeline Image
1+
name: Pipeliner Image
22

3-
# Build (and optionally push) the VCR pipeline appliance used by sandbox deposit/read.
3+
# Build (and optionally push) Pipeliner — VCR appliance for sandbox deposit/read.
4+
# VCR: vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner
45
on:
56
push:
67
branches:
@@ -18,7 +19,7 @@ on:
1819
workflow_dispatch:
1920
inputs:
2021
push_to_vcr:
21-
description: 'Push image to VCR (requires secrets)'
22+
description: 'Push Pipeliner image to VCR (requires secrets)'
2223
required: false
2324
default: 'false'
2425

@@ -50,39 +51,42 @@ jobs:
5051
- name: Install dependencies
5152
run: pnpm install --frozen-lockfile
5253

53-
- name: Materialize pipeline-image runners
54+
- name: Materialize Pipeliner runners
5455
run: pnpm --filter @bitcode/pipeline-image run materialize
5556

56-
- name: Pipeline-image unit test
57+
- name: Pipeliner unit test
5758
run: pnpm --filter @bitcode/pipeline-image test
5859

5960
- name: Set up Docker Buildx
6061
uses: docker/setup-buildx-action@v3
6162

62-
- name: Build pipeline image (local tag)
63+
- name: Build Pipeliner image (local tag)
64+
env:
65+
PIPELINER: vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner
6366
run: |
67+
SHORT_SHA="$(echo "$GITHUB_SHA" | cut -c1-7)"
6468
docker build \
6569
-f packages/pipeline-image/Dockerfile \
66-
-t "bitcode-pipeline:ci-${GITHUB_SHA}" \
70+
-t "${PIPELINER}:ci-${SHORT_SHA}" \
71+
-t "${PIPELINER}:latest" \
6772
.
6873
69-
- name: Log in to VCR and push
74+
- name: Log in to VCR and push Pipeliner
7075
if: ${{ github.event_name == 'workflow_dispatch' && inputs.push_to_vcr == 'true' }}
7176
env:
7277
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
7378
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
74-
VCR_IMAGE: ${{ vars.BITCODE_PIPELINE_VCR_IMAGE }}
79+
PIPELINER: vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner
7580
run: |
76-
if [ -z "$VERCEL_TOKEN" ] || [ -z "$VERCEL_TEAM_ID" ] || [ -z "$VCR_IMAGE" ]; then
77-
echo "Missing VERCEL_TOKEN, VERCEL_TEAM_ID, or BITCODE_PIPELINE_VCR_IMAGE" >&2
81+
if [ -z "$VERCEL_TOKEN" ] || [ -z "$VERCEL_TEAM_ID" ]; then
82+
echo "Missing VERCEL_TOKEN or VERCEL_TEAM_ID" >&2
7883
exit 1
7984
fi
8085
printf '%s' "$VERCEL_TOKEN" | docker login vcr.vercel.com \
8186
--username "$VERCEL_TEAM_ID" \
8287
--password-stdin
8388
SHORT_SHA="$(echo "$GITHUB_SHA" | cut -c1-7)"
84-
TAG="${VCR_IMAGE}:v48-${SHORT_SHA}"
85-
docker tag "bitcode-pipeline:ci-${GITHUB_SHA}" "$TAG"
86-
docker push "$TAG"
87-
echo "Pushed $TAG"
88-
echo "Set Production BITCODE_PIPELINE_SANDBOX_IMAGE=$TAG"
89+
docker tag "${PIPELINER}:ci-${SHORT_SHA}" "${PIPELINER}:v48-${SHORT_SHA}"
90+
docker push --all-tags "${PIPELINER}"
91+
echo "Pushed ${PIPELINER}:latest and ${PIPELINER}:v48-${SHORT_SHA}"
92+
echo "Set Production BITCODE_PIPELINE_SANDBOX_IMAGE=${PIPELINER}:v48-${SHORT_SHA}"

packages/host-generics/src/types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,11 @@ export interface SandboxCreateOptions {
163163
*/
164164
runtime?: VercelSandboxRuntime;
165165
/**
166-
* VCR custom image reference (e.g. `bitcode-pipeline:v48-abc` or full
167-
* `vcr.vercel.com/<team>/<project>/bitcode-pipeline:<tag>`). When set, the
168-
* host plan uses the pipeline appliance image instead of a stock runtime.
166+
* VCR custom image reference for Pipeliner, e.g.
167+
* `vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner:latest` or
168+
* `…/pipeliner:v48-<sha>`. When set, the host plan uses the pipeline
169+
* appliance image instead of a stock runtime (mutually exclusive with
170+
* `runtime`).
169171
*/
170172
image?: string;
171173
timeout?: number;

packages/pipeline-hosts/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ This package keeps AssetPack-specific host plan/runners (`asset-pack-host-*`)
1111
and thin re-exports of local/vercel sandbox hosts for pipeline callers.
1212
New host implementations belong under `generic-hosts/*`, not here.
1313

14-
## Pipeline appliance image (Production)
14+
## Pipeliner image (Production)
1515

16-
Set `BITCODE_PIPELINE_SANDBOX_IMAGE` (and `BITCODE_PIPELINE_HOST=sandbox`) so
17-
`buildAssetPackSandboxHostPlan` uses `Sandbox.create({ image })` with the VCR
18-
pipeline appliance from `@bitcode/pipeline-image` instead of stock `node24` +
19-
in-box monorepo install. See `packages/pipeline-image/README.md`.
16+
**Pipeliner** VCR repo: `vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner`
17+
18+
Set `BITCODE_PIPELINE_SANDBOX_IMAGE` to that image (sha tag preferred) so
19+
`buildAssetPackSandboxHostPlan` uses `Sandbox.create({ image })` instead of
20+
stock `node24` + in-box monorepo install. Serverless always selects sandbox
21+
host; LocalHost is local-machine only. See `packages/pipeline-image/README.md`.

packages/pipeline-hosts/src/__tests__/asset-pack-host-plan.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('asset-pack sandbox host plan', () => {
8282
...baseOptions,
8383
mode: 'asset_pack_pipeline',
8484
synthesizeMode: 'deposit',
85-
sandboxImage: 'bitcode-pipeline:v48-test',
85+
sandboxImage: 'vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner:v48-test',
8686
source: {
8787
type: 'git',
8888
url: 'https://github.com/engineeredsoftware/ENGI.git',
@@ -91,7 +91,9 @@ describe('asset-pack sandbox host plan', () => {
9191
},
9292
});
9393

94-
expect(plan.createOptions.image).toBe('bitcode-pipeline:v48-test');
94+
expect(plan.createOptions.image).toBe(
95+
'vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner:v48-test',
96+
);
9597
expect(plan.createOptions.runtime).toBeUndefined();
9698
expect(plan.createOptions.persistent).toBe(false);
9799
expect(plan.files.map((file) => file.path)).toEqual([

packages/pipeline-hosts/src/asset-pack-host-constants.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@ export const SANDBOX_WORKING_DIRECTORY = '/vercel/sandbox' as const;
1818
export const DEFAULT_LONG_TIMEOUT_MS = 45 * 60 * 1000;
1919
export const SANDBOX_PNPM_VERSION = '10.33.0';
2020

21-
/** In-image dispatcher (VCR pipeline appliance). */
21+
/**
22+
* Pipeliner — VCR pipeline appliance image.
23+
* Purpose: run deposit/read AssetPack synthesis inside Vercel Sandbox microVMs
24+
* (and local Docker) with Bitcode packages preinstalled — never LocalHost on
25+
* serverless.
26+
*/
27+
export const PIPELINER_VCR_REPOSITORY =
28+
'vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner';
29+
/** Prefer a git-sha tag in Production; :latest is convenience for push/dev. */
30+
export const PIPELINER_IMAGE_DEFAULT = `${PIPELINER_VCR_REPOSITORY}:latest`;
31+
32+
/** In-image dispatcher entry (Pipeliner image layout). */
2233
export const PIPELINE_IMAGE_ENTRY_DEFAULT = '/opt/bitcode/pipeline/run-pipeline.mjs';
2334
export const PIPELINE_IMAGE_MONOREPO_ROOT_DEFAULT = '/opt/bitcode';
2435

packages/pipeline-image/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
**/node_modules
77
**/dist
88
!packages/pipeline-image/dist
9+
!packages/pipeline-image/dist/**
910
uapi/.next
1011
uapi/node_modules
1112
uapi/storybook-static

packages/pipeline-image/Dockerfile

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
1-
# Bitcode pipeline appliance image for Vercel Sandbox (VCR).
2-
# Create sandboxes with: Sandbox.create({ image: 'bitcode-pipeline:<tag>', … })
3-
# not stock runtime + monorepo install.
1+
# Pipeliner — Bitcode pipeline appliance for Vercel Sandbox (VCR).
2+
# Repository: vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner
43
#
5-
# Build from monorepo root:
6-
# docker build -f packages/pipeline-image/Dockerfile -t bitcode-pipeline:local .
4+
# Purpose: deposit/read AssetPack synthesis inside Sandbox microVMs with
5+
# Bitcode packages + runners preinstalled (not stock node24 + monorepo install).
6+
#
7+
# Build from monorepo root (materialize first):
8+
# pnpm --filter @bitcode/pipeline-image run materialize
9+
# docker build -f packages/pipeline-image/Dockerfile \
10+
# -t vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner:latest .
711

812
FROM node:24-bookworm-slim AS base
913
RUN corepack enable && corepack prepare pnpm@10.33.0 --activate
1014
WORKDIR /opt/bitcode
1115

1216
# Minimal system deps for git clone of customer sources inside the sandbox.
13-
RUN apt-get update \\
14-
&& apt-get install -y --no-install-recommends git ca-certificates \\
17+
RUN apt-get update \
18+
&& apt-get install -y --no-install-recommends git ca-certificates \
1519
&& rm -rf /var/lib/apt/lists/*
1620

17-
# Copy workspace manifests first for better layer caching.
21+
# Workspace manifests + packages
1822
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml .npmrc* ./
19-
COPY packages/pipeline-hosts/package.json packages/pipeline-hosts/
20-
COPY packages/pipeline-image/package.json packages/pipeline-image/
21-
COPY packages/host-generics/package.json packages/host-generics/
22-
COPY packages/generic-hosts/Local/package.json packages/generic-hosts/Local/
23-
COPY packages/generic-hosts/VercelSandbox/package.json packages/generic-hosts/VercelSandbox/
24-
25-
# Remaining packages (filter install still needs workspace graph).
2623
COPY packages ./packages
2724

28-
# Install workspace deps used by host + pipeline runners.
29-
RUN pnpm install --frozen-lockfile \\
30-
--filter @bitcode/pipeline-hosts... \\
31-
--filter @bitcode/pipeline-image... \\
32-
--filter @bitcode/asset-packs-pipelines-domain... \\
33-
--filter @bitcode/pipelines-generics... \\
34-
--filter @bitcode/btd... \\
35-
--filter @bitcode/supabase... \\
25+
# Install workspace (filter when possible; full install fallback).
26+
RUN pnpm install --frozen-lockfile \
27+
--filter @bitcode/pipeline-hosts... \
28+
--filter @bitcode/pipeline-image... \
29+
--filter @bitcode/asset-packs-pipelines-domain... \
30+
--filter @bitcode/pipelines-generics... \
31+
--filter @bitcode/btd... \
32+
--filter @bitcode/supabase... \
3633
|| pnpm install --frozen-lockfile
3734

38-
# Materialize runners + dispatcher into dist, then install image layout paths.
39-
RUN pnpm --filter @bitcode/pipeline-image run materialize \\
40-
&& mkdir -p /opt/bitcode/.bitcode/pipeline-host /opt/bitcode/pipeline \\
41-
&& cp packages/pipeline-image/dist/run-host-smoke.mjs /opt/bitcode/.bitcode/pipeline-host/ \\
42-
&& cp packages/pipeline-image/dist/run-live-asset-pack-pipeline.mjs /opt/bitcode/.bitcode/pipeline-host/ \\
35+
# Pre-materialized runners (built on host/CI before docker build).
36+
# Layout preserves live-runner relative imports: ../../packages → monorepo packages.
37+
RUN mkdir -p /opt/bitcode/.bitcode/pipeline-host /opt/bitcode/pipeline \
38+
&& cp packages/pipeline-image/dist/run-host-smoke.mjs /opt/bitcode/.bitcode/pipeline-host/ \
39+
&& cp packages/pipeline-image/dist/run-live-asset-pack-pipeline.mjs /opt/bitcode/.bitcode/pipeline-host/ \
4340
&& cp packages/pipeline-image/dist/run-pipeline.mjs /opt/bitcode/pipeline/run-pipeline.mjs
4441

4542
ENV BITCODE_MONOREPO_ROOT=/opt/bitcode
4643
ENV BITCODE_PIPELINE_IMAGE_ENTRY=/opt/bitcode/pipeline/run-pipeline.mjs
4744
WORKDIR /vercel/sandbox
4845

49-
# Default command documents the entry; host plans pass runCommand explicitly.
5046
CMD ["node", "/opt/bitcode/pipeline/run-pipeline.mjs"]

0 commit comments

Comments
 (0)