Skip to content

Commit

Permalink
Add SPM build to CI (jaegertracing#5663)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Part of jaegertracing#5608
- SPM Makefile was calling a target that was removed in previous
refactoring

## Description of the changes
- Build the image directly instead of calling much more expensive target
- Use workflow added in jaegertracing#5640 to run the build
- Change crossdock target to not build debug image with devle, which is
expensive

## How was this change tested?
- `make build && make dev`

---------

Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Co-authored-by: mehul gautam <[email protected]>
  • Loading branch information
yurishkuro and hellspawn679 authored Jun 19, 2024
1 parent 3f6f5fe commit f5d175b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 6 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci-build-spm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test SPM

on:
push:
branches: [main]

pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
cancel-in-progress: true

# See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
permissions:
contents: read

jobs:
spm:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: true

- name: Fetch git tags
run: |
git fetch --prune --unshallow --tags
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: 1.22.x

- name: Setup Node.js version
uses: ./.github/actions/setup-node.js

- name: Temporary - only run the build
run:
cd docker-compose/monitor && make build
4 changes: 2 additions & 2 deletions Makefile.Crossdock.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ build-crossdock-fresh: build-crossdock-linux
make crossdock-fresh

.PHONY: crossdock-docker-images-jaeger-backend
crossdock-docker-images-jaeger-backend: PLATFORMS=linux/amd64
crossdock-docker-images-jaeger-backend: create-baseimg create-debugimg
crossdock-docker-images-jaeger-backend: PLATFORMS=linux/$(shell go env GOARCH)
crossdock-docker-images-jaeger-backend: create-baseimg create-fake-debugimg
for component in "jaeger-agent" "jaeger-collector" "jaeger-query" "jaeger-ingester" "all-in-one" ; do \
regex="jaeger-(.*)"; \
component_suffix=$$component; \
Expand Down
13 changes: 9 additions & 4 deletions docker-compose/monitor/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
.PHONY: build
build: export DOCKER_TAG = dev
build: clean-jaeger
cd ../../ && \
make build-all-in-one-linux && \
make docker-images-jaeger-backend
cd ../../ && make build-all-in-one-linux
cd ../../ && make create-baseimg PLATFORMS=linux/$(shell go env GOARCH)
cd ../../ && docker buildx build --target release \
--tag jaegertracing/all-in-one:dev \
--build-arg base_image=localhost:5000/baseimg_alpine:latest \
--build-arg debug_image=not-used \
--build-arg TARGETARCH=$(shell go env GOARCH) \
--load \
cmd/all-in-one

# starts up the system required for SPM using the latest otel image and a development jaeger image.
# Note: the jaeger "dev" image can be built with "make build".
Expand Down
5 changes: 5 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ create-debugimg: prepare-docker-buildx
--platform=$(PLATFORMS) \
docker/debug

create-fake-debugimg: prepare-docker-buildx
docker buildx build -t $(DEBUG_IMAGE) --push \
--platform=$(PLATFORMS) \
docker/base

.PHONY: prepare-docker-buildx
prepare-docker-buildx:
docker buildx inspect jaeger-build > /dev/null || docker buildx create --use --name=jaeger-build --buildkitd-flags="--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host" --driver-opt="network=host"
Expand Down

0 comments on commit f5d175b

Please sign in to comment.