Skip to content

Commit

Permalink
Cherry pick v0.31.1 changes into release-v0.31 (#2931)
Browse files Browse the repository at this point in the history
* update go4.org/unsafe/assume-no-moving-gc (#2928)

(cherry picked from commit 7927df7)

* Mention zip executable breaking change and update the upgrade guide (#2899)

* Mention zip executable breaking change

* zip all .exes

---------

Co-authored-by: Robert Fratto <[email protected]>
(cherry picked from commit ca11d1a)

* prepare for release 0.31.1 (#2930)

(cherry picked from commit d9a80e0)

* fix upgrade guide

---------

Co-authored-by: Paulin Todev <[email protected]>
  • Loading branch information
rfratto and ptodev authored Feb 6, 2023
1 parent 47f1550 commit 2b0a182
Show file tree
Hide file tree
Showing 23 changed files with 86 additions and 58 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ This document contains a historical list of changes between releases. Only
changes that impact end-user behavior are listed; changes to documentation or
internal API changes are not present.

v0.31.1 (2023-02-06)
--------------------

> **BREAKING CHANGES**: This release has breaking changes. Please read entries
> carefully and consult the [upgrade guide][] for specific instructions.
### Breaking changes

- All release Windows `.exe` files are now published as a zip archive.
Previously, `grafana-agent-installer.exe` was unzipped. (@rfratto)

### Other changes

- Support Go 1.20 for builds. (@rfratto)

v0.31.0 (2023-01-31)
--------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ docker run \
-v "/proc:/host/proc:ro,rslave" \
-v /tmp/agent:/etc/agent \
-v /path/to/config.yaml:/etc/agent-config/agent.yaml \
grafana/agent:v0.31.0 \
grafana/agent:v0.31.1 \
--config.file=/etc/agent-config/agent.yaml
```

Expand Down Expand Up @@ -67,7 +67,7 @@ metadata:
name: agent
spec:
containers:
- image: grafana/agent:v0.31.0
- image: grafana/agent:v0.31.1
name: agent
args:
- --config.file=/etc/agent-config/agent.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ docker run \
-v "/proc:/proc:ro" \
-v /tmp/agent:/etc/agent \
-v /path/to/config.yaml:/etc/agent-config/agent.yaml \
grafana/agent:v0.31.0 \
grafana/agent:v0.31.1 \
--config.file=/etc/agent-config/agent.yaml
```

Expand All @@ -37,7 +37,7 @@ metadata:
name: agent
spec:
containers:
- image: grafana/agent:v0.31.0
- image: grafana/agent:v0.31.1
name: agent
args:
- --config.file=/etc/agent-config/agent.yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/operator/deploy-agent-operator-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ To deploy the `GrafanaAgent` resource:
labels:
app: grafana-agent
spec:
image: grafana/agent:v0.31.0
image: grafana/agent:v0.31.1
logLevel: info
serviceAccountName: grafana-agent
metrics:
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/operator/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ To install Agent Operator:
serviceAccountName: grafana-agent-operator
containers:
- name: operator
image: grafana/agent-operator:v0.31.0
image: grafana/agent-operator:v0.31.1
args:
- --kubelet-service=default/kubelet
---
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/set-up/install-agent-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Install Grafana Agent and get it up and running on Docker.
docker run \
-v /tmp/agent:/etc/agent/data \
-v /path/to/config.yaml:/etc/agent/agent.yaml \
grafana/agent:v0.31.0
grafana/agent:v0.31.1
```

2. Replace `/tmp/agent` with the folder you want to store WAL data in.
Expand All @@ -40,7 +40,7 @@ container through a bind mount for the flags to work properly.
docker run ^
-v c:\grafana-agent-data:c:\etc\grafana-agent\data ^
-v c:\workspace\config\grafana-agent:c:\etc\grafana-agent ^
grafana/agent:v0.31.0-windows
grafana/agent:v0.31.1-windows
```
2. Replace `c:\grafana-agent-data` with the folder you want to store WAL data in.
Expand Down
12 changes: 11 additions & 1 deletion docs/sources/upgrade-guide/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ weight: 800
This guide describes all breaking changes that have happened in prior
releases and how to migrate to newer versions.

## Unreleased changes
## v0.31.1

### Breaking change: all Windows executables are now zipped

All release Windows `.exe` files are now zipped. Prior to v0.31, only
`grafana-agent-installer.exe` was unzipped.

This fixes an issue from v0.31.0 where all `.exe` files were accidentally left
unzipped.

## v0.31.0

These changes will come in a future version.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ require (
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 // indirect
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230204201903-c31fa085b70e // indirect
gocloud.dev v0.24.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/oauth2 v0.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3156,8 +3156,8 @@ go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY=
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 h1:UXLjNohABv4S58tHmeuIZDO6e3mHpW2Dx33gaNt03LE=
go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7CuxiTW3eyJbWew4qx0qtQWDA=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 h1:FyBZqvoA/jbNzuAWLQE2kG820zMAkcilx6BMjGbL/E4=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230204201903-c31fa085b70e h1:AY/D6WBvaYJLmXK9VTIAX0tokDhrkkqdvIUwOU2nxio=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230204201903-c31fa085b70e/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
gocloud.dev v0.24.0 h1:cNtHD07zQQiv02OiwwDyVMuHmR7iQt2RLkzoAgz7wBs=
gocloud.dev v0.24.0/go.mod h1:uA+als++iBX5ShuG4upQo/3Zoz49iIPlYUWHV5mM8w8=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var (
"v0.30.1",
"v0.30.2",
"v0.31.0",
"v0.31.1",
// NOTE(rfratto): when performing an upgrade, add the newest version above instead of changing the existing reference.
}

Expand Down
58 changes: 30 additions & 28 deletions production/grafanacloud-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ param ($GCLOUD_STACK_ID, $GCLOUD_API_KEY, $GCLOUD_API_URL)
Write-Host "Setting up Grafana agent"

if ( -Not [bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544") ) {
Write-Host "ERROR: The script needs to be run with Administrator privileges"
exit
Write-Host "ERROR: The script needs to be run with Administrator privileges"
exit
}

# Check if required parameters are present
if ($GCLOUD_STACK_ID -eq "") {
Write-Host "ERROR: Required argument GCLOUD_STACK_ID missing"
exit
Write-Host "ERROR: Required argument GCLOUD_STACK_ID missing"
exit
}

if ($GCLOUD_API_KEY -eq "") {
Write-Host "ERROR: Required argument GCLOUD_API_KEY missing"
exit
Write-Host "ERROR: Required argument GCLOUD_API_KEY missing"
exit
}

if ($GCLOUD_API_URL -eq "") {
Write-Host "ERROR: Required argument GCLOUD_API_URL missing"
exit
Write-Host "ERROR: Required argument GCLOUD_API_URL missing"
exit
}

Write-Host "GCLOUD_STACK_ID:" $GCLOUD_STACK_ID
Expand All @@ -33,9 +33,11 @@ Write-Host "Checking and installing required Powershell-yaml module"
Install-Module PowerShell-yaml

Write-Host "Downloading Grafana agent Windows Installer"
$DOWLOAD_URL = "https://github.com/grafana/agent/releases/latest/download/grafana-agent-installer.exe"
$DOWLOAD_URL = "https://github.com/grafana/agent/releases/latest/download/grafana-agent-installer.exe.zip"
$OUTPUT_ZIP_FILE = ".\grafana-agent-installer.exe.zip"
$OUTPUT_FILE = ".\grafana-agent-installer.exe"
Invoke-WebRequest -Uri $DOWLOAD_URL -OutFile $OUTPUT_FILE
Invoke-WebRequest -Uri $DOWLOAD_URL -OutFile $OUTPUT_ZIP_FILE
Expand-Archive -LiteralPath $OUTPUT_ZIP_FILE -DestinationPath $OUTPUT_FILE

# Install Grafana agent in silent mode
Write-Host "Installing Grafana agent for Windows"
Expand All @@ -53,15 +55,15 @@ $response = Invoke-WebRequest $CONFIG_URI -Method 'GET' -Headers $headers -UseBa

$jsonObj = $response | ConvertFrom-Json
if ($jsonObj.status -eq "success") {
$config_file = ".\agent-config.yaml"
Write-Host "Saving and updating agent configuration file"
$yamlConfig = $jsonObj.data | ConvertTo-Yaml
Set-Content -Path $config_file -Value ($yamlConfig)
$config_file = ".\agent-config.yaml"
Write-Host "Saving and updating agent configuration file"
$yamlConfig = $jsonObj.data | ConvertTo-Yaml
Set-Content -Path $config_file -Value ($yamlConfig)
# Append APPDATA path to bookmark files
$line = Get-Content $config_file | Select-String bookmark_path | Select-Object -ExpandProperty Line
if ($line -ne $null) {
$content = Get-Content $config_file
$line | ForEach-Object {
$line | ForEach-Object {
$split_line = $_ -split ": "
$prefix = $split_line[0]
$bookmark_filename = $split_line[1] -replace "./",""
Expand All @@ -71,21 +73,21 @@ if ($jsonObj.status -eq "success") {
}
Move-Item $config_file "C:\Program Files\Grafana Agent\agent-config.yaml" -force

# Wait for service to initialize after first install
Write-Host "Wait for Grafana service to initialize"
Start-Sleep -s 5
# Wait for service to initialize after first install
Write-Host "Wait for Grafana service to initialize"
Start-Sleep -s 5

# Restart Grafana agent to load new configuration
Write-Host "Restarting Grafana agent service"
Stop-Service "Grafana Agent"
Start-Service "Grafana Agent"
# Restart Grafana agent to load new configuration
Write-Host "Restarting Grafana agent service"
Stop-Service "Grafana Agent"
Start-Service "Grafana Agent"

# Wait for service to startup after restart
Write-Host "Wait for Grafana service to initialize after restart"
Start-Sleep -s 10
# Wait for service to startup after restart
Write-Host "Wait for Grafana service to initialize after restart"
Start-Sleep -s 10

# Show Grafana agent service status
Get-Service "Grafana Agent"
# Show Grafana agent service status
Get-Service "Grafana Agent"
} else {
Write-Host "Failed to retrieve config"
Write-Host "Failed to retrieve config"
}
2 changes: 1 addition & 1 deletion production/grafanacloud-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ PACKAGE_SYSTEM=${PACKAGE_SYSTEM:=}
#
# Global constants.
#
RELEASE_VERSION="v0.31.0"
RELEASE_VERSION="v0.31.1"

# The DEB and RPM urls don't include the `v` version prefix in the file names,
# so we trim it out using ${RELEASE_VERSION#v} below.
Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/agent-bare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.31.0
image: grafana/agent:v0.31.1
imagePullPolicy: IfNotPresent
name: grafana-agent
ports:
Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/agent-loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.31.0
image: grafana/agent:v0.31.1
imagePullPolicy: IfNotPresent
name: grafana-agent-logs
ports:
Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/agent-traces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: grafana/agent:v0.31.0
image: grafana/agent:v0.31.1
imagePullPolicy: IfNotPresent
name: grafana-agent-traces
ports:
Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/build/lib/version.libsonnet
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'grafana/agent:v0.31.0'
'grafana/agent:v0.31.1'
4 changes: 2 additions & 2 deletions production/kubernetes/build/templates/operator/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ local ksm = import 'kube-state-metrics/kube-state-metrics.libsonnet';
local this = self,

_images:: {
agent: 'grafana/agent:v0.31.0',
agent_operator: 'grafana/agent-operator:v0.31.0',
agent: 'grafana/agent:v0.31.1',
agent_operator: 'grafana/agent-operator:v0.31.1',
ksm: 'registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.5.0',
},

Expand Down
2 changes: 1 addition & 1 deletion production/kubernetes/install-bare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ check_installed() {
check_installed curl
check_installed envsubst

MANIFEST_BRANCH=v0.31.0
MANIFEST_BRANCH=v0.31.1
MANIFEST_URL=${MANIFEST_URL:-https://raw.githubusercontent.com/grafana/agent/${MANIFEST_BRANCH}/production/kubernetes/agent-bare.yaml}
NAMESPACE=${NAMESPACE:-default}

Expand Down
4 changes: 2 additions & 2 deletions production/operator/templates/agent-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ spec:
containers:
- args:
- --kubelet-service=default/kubelet
image: grafana/agent-operator:v0.31.0
image: grafana/agent-operator:v0.31.1
imagePullPolicy: IfNotPresent
name: grafana-agent-operator
serviceAccount: grafana-agent-operator
Expand Down Expand Up @@ -436,7 +436,7 @@ metadata:
name: grafana-agent
namespace: ${NAMESPACE}
spec:
image: grafana/agent:v0.31.0
image: grafana/agent:v0.31.1
integrations:
selector:
matchLabels:
Expand Down
4 changes: 2 additions & 2 deletions production/tanka/grafana-agent/v1/main.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ local service = k.core.v1.service;
(import './lib/traces.libsonnet') +
{
_images:: {
agent: 'grafana/agent:v0.31.0',
agentctl: 'grafana/agentctl:v0.31.0',
agent: 'grafana/agent:v0.31.1',
agentctl: 'grafana/agentctl:v0.31.1',
},

// new creates a new DaemonSet deployment of the grafana-agent. By default,
Expand Down
4 changes: 2 additions & 2 deletions production/tanka/grafana-agent/v2/internal/base.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function(name='grafana-agent', namespace='') {
local this = self,

_images:: {
agent: 'grafana/agent:v0.31.0',
agentctl: 'grafana/agentctl:v0.31.0',
agent: 'grafana/agent:v0.31.1',
agentctl: 'grafana/agentctl:v0.31.1',
},
_config:: {
name: name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(
) {
local _config = {
api: error 'api must be set',
image: 'grafana/agentctl:v0.31.0',
image: 'grafana/agentctl:v0.31.1',
schedule: '*/5 * * * *',
configs: [],
} + config,
Expand Down
6 changes: 3 additions & 3 deletions tools/release
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# This script should be run from the root of the repository.
set -x

# Zip up all the agent binaries to reduce the download size. DEBs, RPMs, and
# Windows installers aren't included to be easier to work with.
# Zip up all the agent binaries to reduce the download size. DEBs and RPMs
# aren't included to be easier to work with.
find dist/ -type f \
-name 'grafana-agent*' -not -name '*.deb' -not -name '*.rpm' -not -name '*.exe' \
-name 'grafana-agent*' -not -name '*.deb' -not -name '*.rpm' \
-exec zip -j -m "{}.zip" "{}" \;

# Sign the RPM packages. DEB packages aren't signed.
Expand Down

0 comments on commit 2b0a182

Please sign in to comment.