Skip to content

Commit

Permalink
Merge branch 'main' into adaptive-sampling-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
mahadzaryab1 authored Sep 13, 2024
2 parents 3018caf + 7d6ebaa commit d7ba2ce
Show file tree
Hide file tree
Showing 60 changed files with 591 additions and 451 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ updates:
update-types: [ "version-update:semver-major" ]
- package-ecosystem: docker
directories:
- /docker-compose/cassandra/v3
- /docker-compose/cassandra/v4
- /docker-compose/cassandra/v5
schedule:
interval: daily
ignore:
Expand Down
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
6 changes: 3 additions & 3 deletions .github/workflows/ci-e2e-cassandra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
matrix:
jaeger-version: [v1, v2]
version:
- distribution: cassandra
major: 3.x
schema: v003
- distribution: cassandra
major: 4.x
schema: v004
- distribution: cassandra
major: 5.x
schema: v004
name: ${{ matrix.version.distribution }} ${{ matrix.version.major }} ${{ matrix.jaeger-version }}
steps:
- name: Harden Runner
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 }}
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ linters:
- errorlint

# Checks for pointers to enclosing loop variables.
- exportloopref
- copyloopvar

- gocritic
- gofmt
Expand Down
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
1 change: 1 addition & 0 deletions cmd/agent/app/customtransport/buffered_read_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (p *TBufferedReadTransport) Read(buf []byte) (int, error) {

// RemainingBytes returns the number of bytes left to be read from the readBuf
func (p *TBufferedReadTransport) RemainingBytes() uint64 {
//nolint: gosec // G115
return uint64(p.readBuf.Len())
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/agent/app/reporter/grpc/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (b *ConnBuilder) InitFromViper(v *viper.Viper) (*ConnBuilder, error) {
if hostPorts != "" {
b.CollectorHostPorts = strings.Split(hostPorts, ",")
}
b.MaxRetry = uint(v.GetInt(retryFlag))
b.MaxRetry = v.GetUint(retryFlag)
tls, err := tlsFlagsConfig.InitFromViper(v)
if err != nil {
return b, fmt.Errorf("failed to process TLS options: %w", err)
Expand Down
1 change: 0 additions & 1 deletion cmd/agent/app/servers/thriftudp/socket_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func setSocketBuffer(conn *net.UDPConn, bufferSize int) error {

var syscallErr error
controlErr := rawConn.Control(func(fd uintptr) {
//nolint: gosec // G115
syscallErr = syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_RCVBUF, bufferSize)
})
if controlErr != nil {
Expand Down
Loading

0 comments on commit d7ba2ce

Please sign in to comment.