-
Notifications
You must be signed in to change notification settings - Fork 469
fix(docker): copy css.d.ts into app build stage to fix nightly build #2632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
766a8ff
fix(docker): copy css.d.ts into app build stage to fix nightly build
jordan-simonovski 223d23b
ci: build release Docker images on PRs (conditional, no push)
jordan-simonovski 4463181
ci: stop rebuilding the app inside the all-in-one docker check
jordan-simonovski e428cf1
ci: cover missing build inputs and fix workflow_dispatch in docker-build
jordan-simonovski 5e069cb
ci: build all-in-one-noauth (Local) image in docker-build
jordan-simonovski 4c5f10b
Merge branch 'main' into jordansimonovski/fix-nightly-css-dts-docker
kodiakhq[bot] e0c5eed
Merge branch 'main' into jordansimonovski/fix-nightly-css-dts-docker
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| Copy `css.d.ts` into the Docker build stage so the app image compiles. The | ||
| TypeScript 6 upgrade added ambient `declare module '*.css'` declarations in | ||
| `css.d.ts` to satisfy TS2882 for side-effect stylesheet imports, but the | ||
| Dockerfiles only copied `mdx.d.ts`, so `next build` failed inside the | ||
| container. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| name: Docker Build | ||
| # Verifies the release Docker images actually build on PRs, without pushing. | ||
| # A source-level type check (`make ci-lint`) cannot catch build failures that | ||
| # only surface inside the image — e.g. a declaration file that exists in the | ||
| # repo but was never COPYed into the Docker build stage. Each image is built | ||
| # only when files that affect it change, so unrelated PRs stay fast. | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| # OTel Collector image (Go build via OCB) — docker/otel-collector/Dockerfile. | ||
| otel-collector-image: | ||
| name: Build OTel Collector Image | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 25 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Get changed files | ||
| id: changed-files | ||
| uses: tj-actions/changed-files@v47.0.6 | ||
| with: | ||
| files: | | ||
| docker/otel-collector/** | ||
| packages/otel-collector/** | ||
| - name: Setup Docker Buildx | ||
| if: | ||
| steps.changed-files.outputs.any_changed == 'true' || github.event_name | ||
| == 'workflow_dispatch' | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Build (no push) | ||
| if: | ||
| steps.changed-files.outputs.any_changed == 'true' || github.event_name | ||
| == 'workflow_dispatch' | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./docker/otel-collector/Dockerfile | ||
| target: prod | ||
| platforms: linux/amd64 | ||
| push: false | ||
| cache-from: | | ||
| type=gha,scope=otel-collector-nightly-amd64 | ||
| type=gha,scope=docker-build-pr-otel-collector | ||
| cache-to: type=gha,mode=max,scope=docker-build-pr-otel-collector | ||
|
|
||
| # App/prod image (API + App + common-utils Node build) — docker/hyperdx target prod. | ||
| # This is the image the nightly css.d.ts failure surfaced in; the same builder | ||
| # stage backs the all-in-one targets below. | ||
| app-image: | ||
| name: Build App Image | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 25 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Get changed files | ||
| id: changed-files | ||
| uses: tj-actions/changed-files@v47.0.6 | ||
| with: | ||
| files: | | ||
| packages/api/** | ||
| packages/app/** | ||
| packages/common-utils/** | ||
| docker/hyperdx/** | ||
| package.json | ||
| yarn.lock | ||
| .yarn/** | ||
| .yarnrc.yml | ||
| .prettierrc | ||
| .prettierignore | ||
| tsconfig.base.json | ||
| nx.json | ||
| - name: Setup Docker Buildx | ||
| if: | ||
| steps.changed-files.outputs.any_changed == 'true' || github.event_name | ||
| == 'workflow_dispatch' | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Build (no push) | ||
| if: | ||
| steps.changed-files.outputs.any_changed == 'true' || github.event_name | ||
| == 'workflow_dispatch' | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./docker/hyperdx/Dockerfile | ||
| target: prod | ||
| platforms: linux/amd64 | ||
| push: false | ||
| build-contexts: | | ||
| hyperdx=./docker/hyperdx | ||
| api=./packages/api | ||
| app=./packages/app | ||
| build-args: | | ||
| CODE_VERSION=pr-${{ github.event.pull_request.number || github.run_id }} | ||
| cache-from: | | ||
| type=gha,scope=app-nightly-amd64 | ||
| type=gha,scope=docker-build-pr-app | ||
| cache-to: type=gha,mode=max,scope=docker-build-pr-app | ||
|
|
||
| # All-in-one image (adds ClickHouse, MongoDB, OTel Collector to the app build) | ||
| # — docker/hyperdx targets all-in-one-auth AND all-in-one-noauth (the Local | ||
| # image). The two are siblings off the shared all-in-one-base, each with its | ||
| # own final COPY of an entry script (entry.local.auth.sh / .noauth.sh), so | ||
| # building auth alone would NOT catch a break in the noauth-specific layer — | ||
| # which is what surfaced in the nightly. Both are built here; the base is | ||
| # built once and reused from buildx's local cache for the second target, so | ||
| # the noauth build only adds its one tiny COPY layer. | ||
| # | ||
| # This target's base does `COPY --from=prod /app /app`, so it already | ||
| # rebuilds the entire App/prod image. To avoid duplicating that ~8-minute | ||
| # Node build on every app change, this job is gated ONLY on the incremental | ||
| # bundling inputs (ClickHouse / OTel / the shared Dockerfile) — NOT on | ||
| # api/app/common-utils/deps. Those are covered by the App Image job above, | ||
| # and they can't break the bundling layers, which only COPY the prod output. | ||
| all-in-one-image: | ||
| name: Build All-in-One Image | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 40 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| - name: Get changed files | ||
| id: changed-files | ||
| uses: tj-actions/changed-files@v47.0.6 | ||
| with: | ||
| files: | | ||
| packages/otel-collector/** | ||
| docker/hyperdx/** | ||
| docker/clickhouse/** | ||
| docker/otel-collector/** | ||
| .vex/** | ||
| - name: Setup Docker Buildx | ||
| if: | ||
| steps.changed-files.outputs.any_changed == 'true' || github.event_name | ||
| == 'workflow_dispatch' | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Build all-in-one-auth (no push) | ||
| if: | ||
| steps.changed-files.outputs.any_changed == 'true' || github.event_name | ||
| == 'workflow_dispatch' | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./docker/hyperdx/Dockerfile | ||
| target: all-in-one-auth | ||
| platforms: linux/amd64 | ||
| push: false | ||
| build-contexts: | | ||
| clickhouse=./docker/clickhouse | ||
| otel-collector=./docker/otel-collector | ||
| hyperdx=./docker/hyperdx | ||
| api=./packages/api | ||
| app=./packages/app | ||
| build-args: | | ||
| CODE_VERSION=pr-${{ github.event.pull_request.number || github.run_id }} | ||
| cache-from: | | ||
| type=gha,scope=all-in-one-nightly-amd64 | ||
| type=gha,scope=docker-build-pr-all-in-one | ||
| cache-to: type=gha,mode=max,scope=docker-build-pr-all-in-one | ||
| # noauth is a sibling of auth off the shared all-in-one-base; the base is | ||
| # already in buildx's local cache from the step above, so this only builds | ||
| # the final noauth COPY layer. | ||
| - name: Build all-in-one-noauth / Local (no push) | ||
| if: | ||
| steps.changed-files.outputs.any_changed == 'true' || github.event_name | ||
| == 'workflow_dispatch' | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./docker/hyperdx/Dockerfile | ||
| target: all-in-one-noauth | ||
| platforms: linux/amd64 | ||
| push: false | ||
| build-contexts: | | ||
| clickhouse=./docker/clickhouse | ||
| otel-collector=./docker/otel-collector | ||
| hyperdx=./docker/hyperdx | ||
| api=./packages/api | ||
| app=./packages/app | ||
| build-args: | | ||
| CODE_VERSION=pr-${{ github.event.pull_request.number || github.run_id }} | ||
| cache-from: | | ||
| type=gha,scope=all-in-one-nightly-amd64 | ||
| type=gha,scope=docker-build-pr-all-in-one | ||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.