Skip to content

Commit

Permalink
Merge branch 'main' into otlp_json_check
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyyy09 committed Sep 9, 2024
2 parents 9afabaa + d2134e4 commit 19d6a06
Show file tree
Hide file tree
Showing 42 changed files with 679 additions and 575 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci-crossdock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -37,11 +36,9 @@ jobs:
with:
go-version: 1.23.x

- name: Export BRANCH variable
uses: ./.github/actions/setup-branch
- uses: ./.github/actions/setup-branch

- name: Install tools
run: make install-ci
- run: make install-ci

- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/ci-docker-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
binary: jaeger

steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -37,21 +36,17 @@ jobs:
submodules: true

- name: Fetch git tags
run: |
git fetch --prune --unshallow --tags
run: git fetch --prune --unshallow --tags

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.23.x

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

- name: Export BRANCH variable
uses: ./.github/actions/setup-branch
- uses: ./.github/actions/setup-branch

- name: Install tools
run: make install-ci
- run: make install-ci

- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -30,21 +29,17 @@ jobs:
submodules: true

- name: Fetch git tags
run: |
git fetch --prune --unshallow --tags
run: git fetch --prune --unshallow --tags

- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 1.23.x

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

- name: Export BRANCH variable
uses: ./.github/actions/setup-branch
- uses: ./.github/actions/setup-branch

- name: Install tools
run: make install-ci
- run: make install-ci

- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci-docker-hotrod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
hotrod:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -36,8 +35,7 @@ jobs:
with:
go-version: 1.23.x

- name: Export BRANCH variable
uses: ./.github/actions/setup-branch
- uses: ./.github/actions/setup-branch

- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

Expand Down
38 changes: 13 additions & 25 deletions .github/workflows/ci-lint-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs

Expand All @@ -33,33 +32,27 @@ jobs:
- name: Print Jaeger version for no reason
run: make echo-v1 echo-v2

- name: Install tools
run: make install-test-tools
- run: make install-test-tools

- name: Lint
run: make lint
- run: make lint

pull-request-preconditions:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs

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

- name: Ensure PR is not on main branch
uses: ./.github/actions/block-pr-not-on-main
- uses: ./.github/actions/block-pr-from-main-branch

- name: lint-nocommit
run: make lint-nocommit
- run: make lint-nocommit

dco-check:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs

Expand All @@ -78,8 +71,7 @@ jobs:
generated-files-check:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -104,21 +96,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit

- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install shellcheck
run: sudo apt-get install shellcheck
- run: sudo apt-get install shellcheck

- name: Run shellcheck
run: shellcheck scripts/*.sh
- run: shellcheck scripts/*.sh

- name: Install shunit2
- name: Install shunit2 for shell unit tests
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: kward/shunit2
Expand Down
37 changes: 25 additions & 12 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ on:
dry_run:
required: true
type: boolean
description: Pass `true` for a test run. It will only build one platform (for speed) and will not push artifacts.
description: Do a test run. It will only build one platform (for speed) and will not push artifacts.

overwrite:
required: true
type: boolean
description: Allow overwriting artifacts.

# See https://github.com/jaegertracing/jaeger/issues/4017
permissions:
Expand All @@ -45,8 +50,7 @@ jobs:
sudo rm -rf /usr/local/lib/android || true
df -h /
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
- uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -62,17 +66,18 @@ jobs:
with:
go-version: 1.23.x

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

- name: Determine parameters
id: params
run: |
if [[ "${{ inputs.dry_run }}" == "true" ]]; then
echo "local_build=-l" >> $GITHUB_OUTPUT
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
echo "linux_platforms=linux/amd64" >> $GITHUB_OUTPUT
echo "gpg_key_override=-k skip" >> $GITHUB_OUTPUT
else
echo "local_build=" >> $GITHUB_OUTPUT
echo "platforms=$(make echo-platforms)" >> $GITHUB_OUTPUT
echo "linux_platforms=$(make echo-linux-platforms)" >> $GITHUB_OUTPUT
fi
Expand All @@ -89,8 +94,7 @@ jobs:
echo Validate that the latest tag ${BRANCH} is in semver format
echo ${BRANCH} | grep -E '^v[0-9]+.[0-9]+.[0-9]+$'
- name: Install tools
run: make install-ci
- run: make install-ci

- name: Configure GPG Key
if: ${{ inputs.dry_run != true }}
Expand All @@ -112,7 +116,7 @@ jobs:
with:
file: '{deploy/*.tar.gz,deploy/*.zip,deploy/*.sha256sum.txt,deploy/*.asc}'
file_glob: true
overwrite: true
overwrite: ${{ inputs.overwrite }}
tag: ${{ env.BRANCH }}
repo_token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -125,19 +129,28 @@ jobs:

- name: Build and upload all container images
# -B skips building the binaries since we already did that above
run: bash scripts/build-upload-docker-images.sh -B -p ${{ steps.params.outputs.linux_platforms }}
run: |
bash scripts/build-upload-docker-images.sh -B \
-p ${{ steps.params.outputs.linux_platforms }} \
${{ steps.params.outputs.local_build }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Build, test, and publish all-in-one image
run: bash scripts/build-all-in-one-image.sh -p ${{ steps.params.outputs.linux_platforms }}
run: |
bash scripts/build-all-in-one-image.sh \
-p ${{ steps.params.outputs.linux_platforms }} \
${{ steps.params.outputs.local_build }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Build, test, and publish hotrod image
run: bash scripts/build-hotrod-image.sh -p ${{ steps.params.outputs.linux_platforms }}
run: |
bash scripts/build-hotrod-image.sh \
-p ${{ steps.params.outputs.linux_platforms }} \
${{ steps.params.outputs.local_build }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
Expand All @@ -157,6 +170,6 @@ jobs:
if: ${{ inputs.dry_run != true }}
with:
file: jaeger-SBOM.spdx.json
overwrite: true
overwrite: ${{ inputs.overwrite }}
tag: ${{ env.BRANCH }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions Makefile.Docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,32 @@ DEBUG_IMAGE ?= $(DOCKER_REGISTRY)/debugimg_alpine:latest
create-baseimg-debugimg: create-baseimg create-debugimg

create-baseimg: prepare-docker-buildx
@echo "::group:: create-baseimg"
docker buildx build -t $(BASE_IMAGE) --push \
--platform=$(LINUX_PLATFORMS) \
docker/base
@echo "::endgroup::"

create-debugimg: prepare-docker-buildx
@echo "::group:: create-debugimg"
docker buildx build -t $(DEBUG_IMAGE) --push \
--platform=$(LINUX_PLATFORMS) \
docker/debug
@echo "::endgroup::"

create-fake-debugimg: prepare-docker-buildx
@echo "::group:: create-fake-debugimg"
docker buildx build -t $(DEBUG_IMAGE) --push \
--platform=$(LINUX_PLATFORMS) \
docker/base
@echo "::endgroup::"

.PHONY: prepare-docker-buildx
prepare-docker-buildx:
@echo "::group:: 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"
docker inspect registry > /dev/null || docker run --rm -d -p 5000:5000 --name registry registry:2
@echo "::endgroup::"

.PHONY: clean-docker-buildx
clean-docker-buildx:
Expand Down
10 changes: 6 additions & 4 deletions cmd/jaeger/config-badger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ extensions:
backends:
some_store:
badger:
directory_key: "/tmp/jaeger/"
directory_value: "/tmp/jaeger/"
directories:
keys: "/tmp/jaeger/"
values: "/tmp/jaeger/"
ephemeral: false
another_store:
badger:
directory_key: "/tmp/jaeger_archive/"
directory_value: "/tmp/jaeger_archive/"
directories:
keys: "/tmp/jaeger_archive/"
values: "/tmp/jaeger_archive/"
ephemeral: false

receivers:
Expand Down
16 changes: 8 additions & 8 deletions cmd/jaeger/internal/extension/jaegerstorage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ type Config struct {
}

type Backend struct {
Memory *memory.Configuration `mapstructure:"memory"`
Badger *badger.NamespaceConfig `mapstructure:"badger"`
GRPC *grpc.ConfigV2 `mapstructure:"grpc"`
Cassandra *cassandra.Options `mapstructure:"cassandra"`
Elasticsearch *esCfg.Configuration `mapstructure:"elasticsearch"`
Opensearch *esCfg.Configuration `mapstructure:"opensearch"`
Memory *memory.Configuration `mapstructure:"memory"`
Badger *badger.Config `mapstructure:"badger"`
GRPC *grpc.ConfigV2 `mapstructure:"grpc"`
Cassandra *cassandra.Options `mapstructure:"cassandra"`
Elasticsearch *esCfg.Configuration `mapstructure:"elasticsearch"`
Opensearch *esCfg.Configuration `mapstructure:"opensearch"`
}

type MetricBackends struct {
Expand All @@ -62,8 +62,8 @@ func (cfg *Backend) Unmarshal(conf *confmap.Conf) error {
}
}
if conf.IsSet("badger") {
v := badger.DefaultNamespaceConfig()
cfg.Badger = &v
v := badger.DefaultConfig()
cfg.Badger = v
}
if conf.IsSet("grpc") {
v := grpc.DefaultConfigV2()
Expand Down
2 changes: 1 addition & 1 deletion cmd/jaeger/internal/extension/jaegerstorage/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ backends:
`)
cfg := createDefaultConfig().(*Config)
require.NoError(t, conf.Unmarshal(cfg))
assert.NotEmpty(t, cfg.Backends["some_storage"].Badger.SpanStoreTTL)
assert.NotEmpty(t, cfg.Backends["some_storage"].Badger.TTL.Spans)
}

func TestConfigDefaultGRPC(t *testing.T) {
Expand Down
Loading

0 comments on commit 19d6a06

Please sign in to comment.