Skip to content
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

Build: simplify how protos are built #4639

Merged
merged 5 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ jobs:
steps:
- checkout
- setup_remote_docker
- run:
name: touch-protos
command: make touch-protos
- run:
name: build
command: make GOOS=windows GOGC=10 promtail
Expand Down
18 changes: 5 additions & 13 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,14 @@ local promtail(arch) = pipeline('promtail-' + arch) + arch_image(arch) {
when: condition('exclude').tagMain,
settings+: {
dry_run: true,
build_args: ['TOUCH_PROTOS=1'],
},
},
] + [
// publish for tag or main
clients_docker(arch, 'promtail') {
depends_on: ['image-tag'],
when: condition('include').tagMain,
settings+: {
build_args: ['TOUCH_PROTOS=1'],
},
settings+: {},
},
],
depends_on: ['check'],
Expand Down Expand Up @@ -249,9 +246,7 @@ local lambda_promtail(tags='') = pipeline('lambda-promtail'){
lambda_promtail_ecr('lambda-promtail') {
depends_on: ['image-tag'],
when: condition('include').tagMain,
settings+: {
build_args: ['TOUCH_PROTOS=1'],
},
settings+: {},
},
],
depends_on: ['check'],
Expand All @@ -265,7 +260,6 @@ local multiarch_image(arch) = pipeline('docker-' + arch) + arch_image(arch) {
when: condition('exclude').tagMain,
settings+: {
dry_run: true,
build_args: ['TOUCH_PROTOS=1'],
},
}
for app in apps
Expand All @@ -274,9 +268,7 @@ local multiarch_image(arch) = pipeline('docker-' + arch) + arch_image(arch) {
docker(arch, app) {
depends_on: ['image-tag'],
when: condition('include').tagMain,
settings+: {
build_args: ['TOUCH_PROTOS=1'],
},
settings+: {},
}
for app in apps
],
Expand Down Expand Up @@ -323,9 +315,9 @@ local manifest(apps) = pipeline('manifest') {
path: 'loki',
},
steps: [
make('test', container=false) { depends_on: ['clone'] },
make('lint', container=false) { depends_on: ['clone'] },
make('check-generated-files', container=false) { depends_on: ['clone'] },
make('test', container=false) { depends_on: ['clone','check-generated-files'] },
make('lint', container=false) { depends_on: ['clone','check-generated-files'] },
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make test and lint depend on check-generated-files so they wait for it to finish as it will rebuild protos

make('check-mod', container=false) { depends_on: ['clone', 'test', 'lint'] },
{
name: 'shellcheck',
Expand Down
66 changes: 9 additions & 57 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@ kind: pipeline
name: check
steps:
- commands:
- make BUILD_IN_CONTAINER=false test
- make BUILD_IN_CONTAINER=false check-generated-files
depends_on:
- clone
image: grafana/loki-build-image:0.18.0
name: test
name: check-generated-files
- commands:
- make BUILD_IN_CONTAINER=false lint
- make BUILD_IN_CONTAINER=false test
depends_on:
- clone
- check-generated-files
image: grafana/loki-build-image:0.18.0
name: lint
name: test
- commands:
- make BUILD_IN_CONTAINER=false check-generated-files
- make BUILD_IN_CONTAINER=false lint
depends_on:
- clone
- check-generated-files
image: grafana/loki-build-image:0.18.0
name: check-generated-files
name: lint
- commands:
- make BUILD_IN_CONTAINER=false check-mod
depends_on:
Expand Down Expand Up @@ -73,8 +75,6 @@ steps:
image: plugins/docker
name: build-loki-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki/Dockerfile
dry_run: true
password:
Expand All @@ -93,8 +93,6 @@ steps:
image: plugins/docker
name: build-loki-canary-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki-canary/Dockerfile
dry_run: true
password:
Expand All @@ -113,8 +111,6 @@ steps:
image: plugins/docker
name: build-logcli-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/logcli/Dockerfile
dry_run: true
password:
Expand All @@ -133,8 +129,6 @@ steps:
image: plugins/docker
name: publish-loki-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki/Dockerfile
dry_run: false
password:
Expand All @@ -153,8 +147,6 @@ steps:
image: plugins/docker
name: publish-loki-canary-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki-canary/Dockerfile
dry_run: false
password:
Expand All @@ -173,8 +165,6 @@ steps:
image: plugins/docker
name: publish-logcli-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/logcli/Dockerfile
dry_run: false
password:
Expand Down Expand Up @@ -208,8 +198,6 @@ steps:
image: plugins/docker
name: build-loki-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki/Dockerfile
dry_run: true
password:
Expand All @@ -228,8 +216,6 @@ steps:
image: plugins/docker
name: build-loki-canary-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki-canary/Dockerfile
dry_run: true
password:
Expand All @@ -248,8 +234,6 @@ steps:
image: plugins/docker
name: build-logcli-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/logcli/Dockerfile
dry_run: true
password:
Expand All @@ -268,8 +252,6 @@ steps:
image: plugins/docker
name: publish-loki-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki/Dockerfile
dry_run: false
password:
Expand All @@ -288,8 +270,6 @@ steps:
image: plugins/docker
name: publish-loki-canary-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki-canary/Dockerfile
dry_run: false
password:
Expand All @@ -308,8 +288,6 @@ steps:
image: plugins/docker
name: publish-logcli-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/logcli/Dockerfile
dry_run: false
password:
Expand Down Expand Up @@ -343,8 +321,6 @@ steps:
image: plugins/docker
name: build-loki-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki/Dockerfile
dry_run: true
password:
Expand All @@ -363,8 +339,6 @@ steps:
image: plugins/docker
name: build-loki-canary-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki-canary/Dockerfile
dry_run: true
password:
Expand All @@ -383,8 +357,6 @@ steps:
image: plugins/docker
name: build-logcli-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/logcli/Dockerfile
dry_run: true
password:
Expand All @@ -403,8 +375,6 @@ steps:
image: plugins/docker
name: publish-loki-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki/Dockerfile
dry_run: false
password:
Expand All @@ -423,8 +393,6 @@ steps:
image: plugins/docker
name: publish-loki-canary-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/loki-canary/Dockerfile
dry_run: false
password:
Expand All @@ -443,8 +411,6 @@ steps:
image: plugins/docker
name: publish-logcli-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: cmd/logcli/Dockerfile
dry_run: false
password:
Expand Down Expand Up @@ -478,8 +444,6 @@ steps:
image: plugins/docker
name: build-promtail-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: clients/cmd/promtail/Dockerfile
dry_run: true
password:
Expand All @@ -498,8 +462,6 @@ steps:
image: plugins/docker
name: publish-promtail-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: clients/cmd/promtail/Dockerfile
dry_run: false
password:
Expand Down Expand Up @@ -533,8 +495,6 @@ steps:
image: plugins/docker
name: build-promtail-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: clients/cmd/promtail/Dockerfile
dry_run: true
password:
Expand All @@ -553,8 +513,6 @@ steps:
image: plugins/docker
name: publish-promtail-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: clients/cmd/promtail/Dockerfile
dry_run: false
password:
Expand Down Expand Up @@ -588,8 +546,6 @@ steps:
image: plugins/docker
name: build-promtail-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: clients/cmd/promtail/Dockerfile.arm32
dry_run: true
password:
Expand All @@ -608,8 +564,6 @@ steps:
image: plugins/docker
name: publish-promtail-image
settings:
build_args:
- TOUCH_PROTOS=1
dockerfile: clients/cmd/promtail/Dockerfile.arm32
dry_run: false
password:
Expand Down Expand Up @@ -925,8 +879,6 @@ steps:
settings:
access_key:
from_secret: ecr_key
build_args:
- TOUCH_PROTOS=1
dockerfile: tools/lambda-promtail/Dockerfile
dry_run: false
region: us-east-1
Expand Down Expand Up @@ -984,6 +936,6 @@ kind: secret
name: deploy_config
---
kind: signature
hmac: 55440faa2728a5b8abbd213c2cf198e01f00201ba7143391924da1b9aa02c350
hmac: b51ec8dfc84d0be83827fc851b21b81e1091886be480d675f51485b647e58001

...
Loading