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

Enable linux boringcrypto builds #796

Merged
merged 15 commits into from
May 9, 2024
105 changes: 35 additions & 70 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,40 @@ trigger:
type: docker
---
kind: pipeline
name: Build alloy (Linux amd64 boringcrypto)
platform:
arch: amd64
os: linux
steps:
- commands:
- make generate-ui
- GO_TAGS="builtinassets promtail_journal_enabled" GOOS=linux GOARCH=amd64 GOARM=
GOEXPERIMENT=boringcrypto make alloy
image: grafana/alloy-build-image:v0.1.0-boringcrypto
name: Build
trigger:
event:
- pull_request
type: docker
---
kind: pipeline
name: Build alloy (Linux arm64 boringcrypto)
platform:
arch: amd64
os: linux
steps:
- commands:
- make generate-ui
- GO_TAGS="builtinassets promtail_journal_enabled" GOOS=linux GOARCH=arm64 GOARM=
GOEXPERIMENT=boringcrypto make alloy
image: grafana/alloy-build-image:v0.1.0-boringcrypto
name: Build
trigger:
event:
- pull_request
type: docker
---
kind: pipeline
name: Publish Linux alloy-devel container
platform:
arch: amd64
Expand Down Expand Up @@ -474,40 +508,6 @@ volumes:
name: docker
---
kind: pipeline
name: Publish Windows alloy-devel-cngcrypto container
platform:
arch: amd64
os: windows
version: "1809"
steps:
- commands:
- '& "C:/Program Files/git/bin/bash.exe" -c ''mkdir -p $HOME/.docker'''
- '& "C:/Program Files/git/bin/bash.exe" -c ''printenv GCR_CREDS > $HOME/.docker/config.json'''
- '& "C:/Program Files/git/bin/bash.exe" -c ''docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD'''
- '& "C:/Program Files/git/bin/bash.exe" -c ''./tools/ci/docker-containers-windows
alloy-devel-cngcrypto'''
environment:
DOCKER_LOGIN:
from_secret: docker_login
DOCKER_PASSWORD:
from_secret: docker_password
GCR_CREDS:
from_secret: gcr_admin
image: grafana/alloy-build-image:v0.1.0-windows
name: Build containers
volumes:
- name: docker
path: //./pipe/docker_engine/
trigger:
ref:
- refs/heads/main
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
kind: pipeline
name: Publish Linux alloy container
platform:
arch: amd64
Expand Down Expand Up @@ -627,40 +627,6 @@ volumes:
path: //./pipe/docker_engine/
name: docker
---
kind: pipeline
name: Publish Windows alloy-cngcrypto container
platform:
arch: amd64
os: windows
version: "1809"
steps:
- commands:
- '& "C:/Program Files/git/bin/bash.exe" -c ''mkdir -p $HOME/.docker'''
- '& "C:/Program Files/git/bin/bash.exe" -c ''printenv GCR_CREDS > $HOME/.docker/config.json'''
- '& "C:/Program Files/git/bin/bash.exe" -c ''docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD'''
- '& "C:/Program Files/git/bin/bash.exe" -c ''./tools/ci/docker-containers-windows
alloy-cngcrypto'''
environment:
DOCKER_LOGIN:
from_secret: docker_login
DOCKER_PASSWORD:
from_secret: docker_password
GCR_CREDS:
from_secret: gcr_admin
image: grafana/alloy-build-image:v0.1.0-windows
name: Build containers
volumes:
- name: docker
path: //./pipe/docker_engine/
trigger:
ref:
- refs/tags/v*
type: docker
volumes:
- host:
path: //./pipe/docker_engine/
name: docker
---
depends_on:
- Publish Linux alloy-devel container
- Publish Linux alloy-devel-boringcrypto container
Expand Down Expand Up @@ -712,7 +678,6 @@ depends_on:
- Publish Linux alloy container
- Publish Linux alloy-boringcrypto container
- Publish Windows alloy container
- Publish Windows alloy-cngcrypto container
image_pull_secrets:
- dockerconfigjson
kind: pipeline
Expand Down Expand Up @@ -870,6 +835,6 @@ kind: secret
name: updater_private_key
---
kind: signature
hmac: 8470d1cd1b7ab512b3adff1fc61af6576e427d81225f7b83ae228a3dad326aa9
hmac: 1cf3dfdb523c1cf8113b49cc8f69a10f714dac0ffc00c02826c36e7d3b9d94b1

...
13 changes: 12 additions & 1 deletion .drone/pipelines/crosscompile.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ local os_arch_tuples = [
local targets = [
'alloy',
];
local targets_boringcrypto = [
'alloy',
];


local os_arch_types_boringcrypto = [
// Linux boringcrypto
{ name: 'Linux amd64 boringcrypto', os: 'linux', arch: 'amd64', experiment: 'boringcrypto' },
{ name: 'Linux arm64 boringcrypto', os: 'linux', arch: 'arm64', experiment: 'boringcrypto' },
];

local build_environments(targets, tuples, image) = std.flatMap(function(target) (
std.map(function(platform) (
Expand Down Expand Up @@ -63,4 +73,5 @@ local build_environments(targets, tuples, image) = std.flatMap(function(target)
), tuples)
), targets);

build_environments(targets, os_arch_tuples, build_image.linux)
build_environments(targets, os_arch_tuples, build_image.linux) +
build_environments(targets_boringcrypto, os_arch_types_boringcrypto, build_image.boringcrypto)
1 change: 0 additions & 1 deletion .drone/pipelines/publish.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ local linux_containers = [
];
local windows_containers = [
{ devel: 'alloy-devel', release: 'alloy' },
{ devel: 'alloy-devel-cngcrypto', release: 'alloy-cngcrypto' },
];

local linux_containers_dev_jobs = std.map(function(container) (
Expand Down
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ v1.1.0-rc.0

- (_Public preview_) Add support for setting GOMEMLIMIT based on cgroup setting. (@mattdurham)

- (_Public preview_) Introduce `boringcrypto` and `cngcrypto` Docker images.
These Docker images are tagged with the `-boringcrypto` (for Linux) and
`-cngcrypto` (for Windows) suffixes. `boringcrypto` support is only available
mattdurham marked this conversation as resolved.
Show resolved Hide resolved
on AMD64 and ARM64, while `cngcrypto` support is only available on AMD64.
- (_Public preview_) Introduce `boringcrypto` Docker image.
This Docker image is tagged with the `-boringcrypto` and is
only available on AMD64 and ARM64.
mattdurham marked this conversation as resolved.
Show resolved Hide resolved
(@rfratto, @mattdurham)

- (_Public preview_) Introduce `boringcrypto` release assets. BoringCrypto
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ generate-winmanifest:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
go generate ./internal/winmanifest
GOOS=linux GOARCH=amd64 go generate ./internal/winmanifest
mattdurham marked this conversation as resolved.
Show resolved Hide resolved
endif
#
# Other targets
Expand Down
9 changes: 6 additions & 3 deletions tools/make/packaging.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ dist-alloy-binaries: dist/alloy-linux-amd64 \
dist/alloy-darwin-amd64 \
dist/alloy-darwin-arm64 \
dist/alloy-windows-amd64.exe \
dist/alloy-freebsd-amd64
dist/alloy-freebsd-amd64 \
dist-alloy-boringcrypto-binaries
mattdurham marked this conversation as resolved.
Show resolved Hide resolved

dist/alloy-linux-amd64: GO_TAGS += netgo builtinassets promtail_journal_enabled
dist/alloy-linux-amd64: GOOS := linux
Expand Down Expand Up @@ -73,10 +74,11 @@ dist/alloy-darwin-arm64: generate-ui
#
# TODO(rfratto): add netgo back to Windows builds if a version of Go is
# released which natively supports resolving DNS short names on Windows.
dist/alloy-windows-amd64.exe: generate-ui generate-winmanifest
dist/alloy-windows-amd64.exe: GO_TAGS += builtinassets
dist/alloy-windows-amd64.exe: GOOS := windows
dist/alloy-windows-amd64.exe: GOARCH := amd64
dist/alloy-windows-amd64.exe: generate-ui generate-winmanifest
dist/alloy-windows-amd64.exe:
$(PACKAGING_VARS) ALLOY_BINARY=$@ "$(MAKE)" -f $(PARENT_MAKEFILE) alloy

# NOTE(rfratto): do not use netgo when building Windows binaries, which
Expand Down Expand Up @@ -123,10 +125,11 @@ dist/alloy-boringcrypto-linux-arm64: generate-ui

dist-alloy-service-binaries: dist.temp/alloy-service-windows-amd64.exe

dist.temp/alloy-service-windows-amd64.exe: generate-ui generate-winmanifest
dist.temp/alloy-service-windows-amd64.exe: GO_TAGS += builtinassets
dist.temp/alloy-service-windows-amd64.exe: GOOS := windows
dist.temp/alloy-service-windows-amd64.exe: GOARCH := amd64
dist.temp/alloy-service-windows-amd64.exe: generate-ui generate-winmanifest
dist.temp/alloy-service-windows-amd64.exe:
$(PACKAGING_VARS) SERVICE_BINARY=$@ "$(MAKE)" -f $(PARENT_MAKEFILE) alloy-service

#
Expand Down
Loading