feat(job-service): publish dedicated knative-job-service image#46
Open
Anmol1696 wants to merge 3 commits into
Open
feat(job-service): publish dedicated knative-job-service image#46Anmol1696 wants to merge 3 commits into
Anmol1696 wants to merge 3 commits into
Conversation
Multi-stage build for @constructive-io/knative-job-service, mirroring templates/node-graphql/Dockerfile but targeted at the job-service package so it no longer ships from the monolithic constructive image.
Adds a build-job-service job alongside the function matrix that builds job/service/Dockerfile and pushes ghcr.io/constructive-io/knative-job-service with the same tag strategy as the function images (latest on main, short SHA, semver/tag refs).
Switches the deployment from the monolithic ghcr.io/constructive-io/constructive image to the new ghcr.io/constructive-io/knative-job-service image. Adjusts args from jobs/knative-job-service/dist/run.js to dist/run.js — the deployed package roots dist/ at /app inside the new image. Tag left at :latest as a starting point; deployers should pin to a short SHA once CI publishes the first build.
There was a problem hiding this comment.
Pull request overview
This PR decouples the Knative job-service deployment from the monolithic ghcr.io/constructive-io/constructive image by introducing a dedicated Docker image build and updating the Kubernetes manifest to run the job-service entrypoint from that new image.
Changes:
- Added a multi-stage Dockerfile to build and package
@constructive-io/knative-job-serviceas its own image. - Added a new
build-job-servicejob to the existing Docker publishing workflow to build/pushghcr.io/<owner>/knative-job-servicewith the same tag strategy as function images. - Updated the base k8s deployment to reference the new image and updated the Node entrypoint args.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
k8s/base/constructive/knative-job-service.yaml |
Switches the deployment to the new knative-job-service image and updates the entrypoint args. |
job/service/Dockerfile |
Introduces a dedicated multi-stage build for the job-service package, producing dist/run.js as the runtime entrypoint. |
.github/workflows/docker.yaml |
Adds a CI job to build and publish the new job-service image to GHCR with consistent tagging/caching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+25
to
+31
| # Pin to a short SHA at deploy time (e.g. ghcr.io/constructive-io/knative-job-service:abc1234). | ||
| # Built by .github/workflows/docker.yaml from job/service/Dockerfile. | ||
| image: ghcr.io/constructive-io/knative-job-service:latest | ||
| imagePullPolicy: Always | ||
|
|
||
| # Run the knative job service entrypoint from the root image | ||
| command: ["node"] | ||
| args: ["jobs/knative-job-service/dist/run.js"] | ||
| args: ["dist/run.js"] |
Comment on lines
+120
to
+131
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v6 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Generate workspace packages | ||
| run: | | ||
| node --experimental-strip-types scripts/generate.ts | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
job/service/Dockerfile— a multi-stage build for@constructive-io/knative-job-serviceso the deployment no longer depends on the monolithicghcr.io/constructive-io/constructiveimage. Mirrors the shape oftemplates/node-graphql/Dockerfileand entrypoints atdist/run.js.build-job-servicejob to.github/workflows/docker.yamlthat publishesghcr.io/constructive-io/knative-job-serviceto GHCR using the same tag strategy as the function images (latestonmain, short SHA, semver/tag refs).k8s/base/constructive/knative-job-service.yamlto point at the new image and adjustsargsfromjobs/knative-job-service/dist/run.js→dist/run.js.The job-service code lived in the
constructivemonorepo atjobs/knative-job-service/until it moved to this repo (job/service/). The k8s manifest still pointed at the old monolithic image at a pinned SHA — this PR cuts that dependency.The local-simple overlay (
k8s/overlays/local-simple/job-service.yaml) is intentionally left alone — it builds from the dev image with Skaffold hot reload and works as-is for local development.Test plan
docker build -f job/service/Dockerfile .builds successfully locallywaitForJobsPrereqsruns and retries on DB connect failure as expectedbuild-job-servicejob runs green on this PR (build only, no push on PR)main, confirm GHCR publishesghcr.io/constructive-io/knative-job-service:latestand the short-SHA tag:latestto a pinned short SHA (matching the previous:e0b55ccstyle) before applying to a real clusterpnpm test:e2e) with the new image deployed — jobs inserted intoapp_jobs.jobsstill get picked up and dispatched