diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet deleted file mode 100644 index b5d367931..000000000 --- a/.drone/drone.jsonnet +++ /dev/null @@ -1,85 +0,0 @@ -// Run "make drone" to regenerate drone.yml from this file -local archs = ['arm64', 'amd64']; - -local onPRs = { - event: ['pull_request'], -}; - -local onTag = { - event: ['tag'], -}; - -local onMain = { - event: ['push'], -}; - -local pipeline(name) = { - kind: 'pipeline', - name: name, - steps: [], - trigger: { - // Only trigger pipelines for PRs, tags (v*), or pushes to "main". - ref: ['refs/heads/main', 'refs/tags/v*'], - }, -}; - -local secret(name, vault_path, vault_key) = { - kind: 'secret', - name: name, - get: { - path: vault_path, - name: vault_key, - }, -}; -local docker_username_secret = secret('docker_username', 'infra/data/ci/docker_hub', 'username'); -local docker_password_secret = secret('docker_password', 'infra/data/ci/docker_hub', 'password'); - -local buildx(stepName, app, auto_tag, tags) = { - name: 'beyla-%s-docker-buildx' % stepName, - image: 'thegeeklab/drone-docker-buildx:24', - privileged: true, - settings: { - auto_tag: auto_tag, - build_args_from_env: ['DRONE_TAG'], - tags: tags, - repo: 'grafana/%s' % app, - dockerfile: 'Dockerfile', - platforms: ['linux/%s' % arch for arch in archs], - username: { from_secret: docker_username_secret.name }, - password: { from_secret: docker_password_secret.name }, - dry_run: false, - }, -}; - -local beyla() = pipeline('beyla') { - steps+: [ - buildx('dryrun', 'beyla-dryrun', false, 'test') { - when: onPRs, // TODO: if container creation fails, make the PR fail - settings+: { - dry_run: true, - }, - }, - ] + [ - // on each new version, it tags version `a.b.c` and `a.b` - buildx('tagged', 'beyla', true, '') { - when: onTag, - }, - ] + [ - // on each new version, it tags version `latest`, - // equivalent to the versions from the previous section - buildx('latest', 'beyla', false, 'latest') { - when: onTag, - }, - ] + [ - buildx('main', 'beyla', false, 'main') { - when: onMain, - }, - ], -}; - -[ - beyla(), -] + [ - docker_username_secret, - docker_password_secret, -] diff --git a/.drone/drone.yml b/.drone/drone.yml deleted file mode 100644 index bd5939910..000000000 --- a/.drone/drone.yml +++ /dev/null @@ -1,109 +0,0 @@ ---- -kind: pipeline -name: beyla -steps: -- image: thegeeklab/drone-docker-buildx:24 - name: beyla-dryrun-docker-buildx - privileged: true - settings: - auto_tag: false - build_args_from_env: - - DRONE_TAG - dockerfile: Dockerfile - dry_run: true - password: - from_secret: docker_password - platforms: - - linux/arm64 - - linux/amd64 - repo: grafana/beyla-dryrun - tags: test - username: - from_secret: docker_username - when: - event: - - pull_request -- image: thegeeklab/drone-docker-buildx:24 - name: beyla-tagged-docker-buildx - privileged: true - settings: - auto_tag: true - build_args_from_env: - - DRONE_TAG - dockerfile: Dockerfile - dry_run: false - password: - from_secret: docker_password - platforms: - - linux/arm64 - - linux/amd64 - repo: grafana/beyla - tags: "" - username: - from_secret: docker_username - when: - event: - - tag -- image: thegeeklab/drone-docker-buildx:24 - name: beyla-latest-docker-buildx - privileged: true - settings: - auto_tag: false - build_args_from_env: - - DRONE_TAG - dockerfile: Dockerfile - dry_run: false - password: - from_secret: docker_password - platforms: - - linux/arm64 - - linux/amd64 - repo: grafana/beyla - tags: latest - username: - from_secret: docker_username - when: - event: - - tag -- image: thegeeklab/drone-docker-buildx:24 - name: beyla-main-docker-buildx - privileged: true - settings: - auto_tag: false - build_args_from_env: - - DRONE_TAG - dockerfile: Dockerfile - dry_run: false - password: - from_secret: docker_password - platforms: - - linux/arm64 - - linux/amd64 - repo: grafana/beyla - tags: main - username: - from_secret: docker_username - when: - event: - - push -trigger: - ref: - - refs/heads/main - - refs/tags/v* ---- -get: - name: username - path: infra/data/ci/docker_hub -kind: secret -name: docker_username ---- -get: - name: password - path: infra/data/ci/docker_hub -kind: secret -name: docker_password ---- -kind: signature -hmac: 80d28c3b23c53bdd6b5c90e2881d39901c0b01d4cdcc435de61d34112a267965 - -... diff --git a/.github/codecov.yml b/.github/codecov.yml index 025c36596..f7a2a8242 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -2,3 +2,13 @@ codecov: require_ci_to_pass: yes notify: wait_for_ci: yes +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true +github_checks: + annotations: false \ No newline at end of file diff --git a/.github/workflows/publish_dockerhub_main.yml b/.github/workflows/publish_dockerhub_main.yml new file mode 100644 index 000000000..2919723d0 --- /dev/null +++ b/.github/workflows/publish_dockerhub_main.yml @@ -0,0 +1,45 @@ +# TODO: trigger only if testing or any other checks previously succeeded +name: Push to DockerHub (main) +on: + push: + branches: + - main + +permissions: + contents: read + id-token: write + +jobs: + build-multiarch: + runs-on: ubuntu-latest-8-cores + + steps: + - id: checkout + uses: actions/checkout@v4 + with: + lfs: true + + - id: push-beyla-to-dockerhub + uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main + with: + repository: grafana/beyla + context: . + platforms: |- + "linux/amd64" + "linux/arm64" + tags: |- + "main" + push: true + + - id: push-beyla-k8s-cache-to-dockerhub + uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main + with: + repository: grafana/beyla-k8s-cache + file: k8scache.Dockerfile + context: . + platforms: |- + "linux/amd64" + "linux/arm64" + tags: |- + "main" + push: true diff --git a/.github/workflows/publish_dockerhub_release.yml b/.github/workflows/publish_dockerhub_release.yml new file mode 100644 index 000000000..05273090d --- /dev/null +++ b/.github/workflows/publish_dockerhub_release.yml @@ -0,0 +1,49 @@ +# TODO: trigger only if testing or any other checks previously succeeded +name: Push to DockerHub (release) +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +permissions: + contents: read + id-token: write + +jobs: + build-multiarch: + runs-on: ubuntu-latest-8-cores + + steps: + - id: checkout + uses: actions/checkout@v4 + with: + lfs: true + + - id: push-beyla-to-dockerhub + uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main + with: + repository: grafana/beyla + context: . + platforms: |- + "linux/amd64" + "linux/arm64" + tags: |- + "type=semver,pattern={{major}}" + "type=semver,pattern={{major}}.{{minor}}" + "type=semver,pattern={{major}}.{{minor}}.{{patch}}" + push: true + + - id: push-beyla-k8s-cache-to-dockerhub + uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main + with: + repository: grafana/beyla-k8s-cache + file: k8scache.Dockerfile + context: . + platforms: |- + "linux/amd64" + "linux/arm64" + tags: |- + "type=semver,pattern={{major}}" + "type=semver,pattern={{major}}.{{minor}}" + "type=semver,pattern={{major}}.{{minor}}.{{patch}}" + push: true