Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fe0dfd5
Bootstrapping has no integration test regressions
frank-pang-msft Aug 17, 2023
9078203
Add cleanup of VMWatch process during shutdown signals and upon other…
frank-pang-msft Aug 18, 2023
5fd629f
Added integration tests for VMWatch
frank-pang-msft Aug 21, 2023
bbba094
Linting
frank-pang-msft Aug 21, 2023
ef79852
Fix file vet issues
frank-pang-msft Aug 21, 2023
e9a1176
attempt to fix handler command: install - creates the data dir
frank-pang-msft Aug 21, 2023
386d170
nit integration tests
frank-pang-msft Aug 21, 2023
39821e1
Use handlerenvironment to dictate vmwatch signal folder and verbose l…
frank-pang-msft Aug 31, 2023
bab9e56
Include missing changes in previous commit
frank-pang-msft Aug 31, 2023
38448b5
Merge remote-tracking branch 'origin/master' into dev/frankpang/boots…
frank-pang-msft Aug 31, 2023
e96d5e9
Remove unnecessary changes
frank-pang-msft Aug 31, 2023
eafdb41
Try to fix docker installation error in go workflow
frank-pang-msft Aug 31, 2023
057a679
Fix integration tests
frank-pang-msft Aug 31, 2023
2c8547b
Update HandlerManifest with process names for guest agent to monitor …
frank-pang-msft Aug 31, 2023
f61b8d7
Run linting
frank-pang-msft Aug 31, 2023
ca73b0a
Remove cpu/memory limits in HandlerManifest + update VMWatch binary d…
frank-pang-msft Sep 12, 2023
0f6ec4e
Merge branch 'master' into dev/frankpang/bootstrapVMWatch
frank-pang-msft Sep 12, 2023
ce89552
Update test.Dockerfile
frank-pang-msft Sep 12, 2023
c4d42b1
Rename workflow
frank-pang-msft Sep 12, 2023
5488445
Merge branch 'dev/frankpang/bootstrapVMWatch' of https://github.com/A…
frank-pang-msft Sep 12, 2023
19c3f0a
Add formatting & linting
frank-pang-msft Sep 12, 2023
7105db3
Add logic to do retries on failed tests + don't fail fast
frank-pang-msft Sep 12, 2023
c0225cf
Minor nits
frank-pang-msft Sep 14, 2023
a6cfc63
Update integration tests + code changes to resolve comments regarding…
frank-pang-msft Sep 14, 2023
e6025db
Formatting + Linting + Vet
frank-pang-msft Sep 14, 2023
198ba22
Add logic for recover and defer for executing VMWatch. Proper close a…
frank-pang-msft Sep 15, 2023
726adaa
fix integration tests
frank-pang-msft Sep 15, 2023
e6bdc4e
Bump to v2.0.7
frank-pang-msft Sep 15, 2023
7ce2f7f
revert unnecessary changes to schema.go
frank-pang-msft Sep 15, 2023
688e744
Small fix to killVMWatch
frank-pang-msft Sep 15, 2023
7934366
Fix logic for killing VMWatch
frank-pang-msft Sep 15, 2023
f4147d5
v2.0.8 Added Support for dynamic EventsFolder directory from extensio…
klugorosado Sep 22, 2023
8fbc6ee
Merge remote-tracking branch 'origin/master' into dev/frankpang/boots…
frank-pang-msft Nov 16, 2023
6ce2e42
nits after merging from master
frank-pang-msft Nov 16, 2023
d5e8c02
feature branch should trigger workflow
frank-pang-msft Nov 16, 2023
982cbb7
Extra asterisk is not necessary
frank-pang-msft Nov 16, 2023
7f7c945
Add back feature/**
frank-pang-msft Nov 16, 2023
1e04c3f
Fix load directory
frank-pang-msft Nov 16, 2023
6bee769
Add container name to mk_container
frank-pang-msft Nov 16, 2023
6ca1b85
Fix naming
frank-pang-msft Nov 16, 2023
22d82e5
Add back VE.RS.ION
frank-pang-msft Nov 16, 2023
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: Merge Validation (Ext V2)

on:
workflow_dispatch:
Expand All @@ -10,6 +10,7 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-20.04]

Expand Down Expand Up @@ -91,5 +92,13 @@ jobs:
working-directory: ${{ env.repo_root }}

- name: Run Integration Tests
run: sudo bats integration-test/test
continue-on-error: true
run: |
mkdir -p integration-test/test/.bats/run-logs/
sudo bats integration-test/test
working-directory: ${{ env.repo_root }}

- name: Retry Failing Integration Tests
run: |
sudo bats integration-test/test --filter-status failed
working-directory: ${{ env.repo_root }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ applicationhealth-extension-linux
_obj
_test
testbin
integration-test/test/.bats

# Architecture specific extensions/prefixes
*.[568vq]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Azure ApplicationHealth Extension for Linux (1.0.0)
[![Build Status](https://travis-ci.org/Azure/applicationhealth-extension-linux.svg?branch=master)](https://travis-ci.org/Azure/applicationhealth-extension-linux)

[![GitHub Build Status](https://github.com/Azure/applicationhealth-extension-linux/actions/workflows/go.yml/badge.svg)](https://github.com/Azure/applicationhealth-extension-linux/actions/workflows/go.yml)
[![GitHub Build Status](https://github.com/Azure/applicationhealth-extension-linux/actions/workflows/merge_validation_v2.yml/badge.svg)](https://github.com/Azure/applicationhealth-extension-linux/actions/workflows/merge_validation_v2.yml)

The application health extension periodically probes for application health within a Linux VM when configured.
The result of the health checks guide automatic actions that can take place on VMs such as stopping rolling upgrades
Expand Down
2 changes: 1 addition & 1 deletion integration-test/env/Extension/HandlerEnvironment.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"seqNo": "0",
"version": 1,
"handlerEnvironment": {
"logFolder": "/var/log/azure/Extension/VE.RS.ION",
"logFolder": "/var/log/azure/Extension",
"configFolder": "/var/lib/waagent/Extension/config",
"statusFolder": "/var/lib/waagent/Extension/status",
"heartbeatFile": "/var/lib/waagent/Extension/heartbeat.log"
Expand Down
154 changes: 154 additions & 0 deletions integration-test/env/Extension/bin/VMWatch/vmwatch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Telegraf Configuration
#
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
#
# Plugins must be declared in here to be active.
# To deactivate a plugin, comment out the name and any variables.
#
# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
# file would generate.
#
# Environment variables can be used anywhere in this config file, simply surround
# them with ${}. For strings the variable must be within quotes (ie, "${STR_VAR}"),
# for numbers and booleans they should be plain (ie, ${INT_VAR}, ${BOOL_VAR})

# Configuration for telegraf agent
[agent]
## Default data collection interval for all inputs
interval = "10s"
## Rounds collection interval to 'interval'
## ie, if interval="10s" then always collect on :00, :10, :20, etc.
round_interval = true

## Telegraf will send metrics to outputs in batches of at most
## metric_batch_size metrics.
## This controls the size of writes that Telegraf sends to output plugins.
metric_batch_size = 1000

## Maximum number of unwritten metrics per output. Increasing this value
## allows for longer periods of output downtime without dropping metrics at the
## cost of higher maximum memory usage.
metric_buffer_limit = 10000

## Collection jitter is used to jitter the collection by a random amount.
## Each plugin will sleep for a random time within jitter before collecting.
## This can be used to avoid many plugins querying things like sysfs at the
## same time, which can have a measurable effect on the system.
collection_jitter = "0s"

## Collection offset is used to shift the collection by the given amount.
## This can be be used to avoid many plugins querying constraint devices
## at the same time by manually scheduling them in time.
# collection_offset = "0s"

## Default flushing interval for all outputs. Maximum flush_interval will be
## flush_interval + flush_jitter
flush_interval = "10s"
## Jitter the flush interval by a random amount. This is primarily to avoid
## large write spikes for users running a large number of telegraf instances.
## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
flush_jitter = "0s"

## Collected metrics are rounded to the precision specified. Precision is
## specified as an interval with an integer + unit (e.g. 0s, 10ms, 2us, 4s).
## Valid time units are "ns", "us" (or "µs"), "ms", "s".
##
## By default or when set to "0s", precision will be set to the same
## timestamp order as the collection interval, with the maximum being 1s:
## ie, when interval = "10s", precision will be "1s"
## when interval = "250ms", precision will be "1ms"
##
## Precision will NOT be used for service inputs. It is up to each individual
## service input to set the timestamp at the appropriate precision.
precision = "0s"

## Log at debug level.
# debug = false
## Log only error level messages.
# quiet = false

## Log target controls the destination for logs and can be one of "file",
## "stderr" or, on Windows, "eventlog". When set to "file", the output file
## is determined by the "logfile" setting.
# logtarget = "file"

## Name of the file to be logged to when using the "file" logtarget. If set to
## the empty string then logs are written to stderr.
# logfile = ""

## The logfile will be rotated after the time interval specified. When set
## to 0 no time based rotation is performed. Logs are rotated only when
## written to, if there is no log activity rotation may be delayed.
# logfile_rotation_interval = "0h"

## The logfile will be rotated when it becomes larger than the specified
## size. When set to 0 no size based rotation is performed.
# logfile_rotation_max_size = "0MB"

## Maximum number of rotated archives to keep, any older logs are deleted.
## If set to -1, no archives are removed.
# logfile_rotation_max_archives = 5

## Pick a timezone to use when logging or type 'local' for local time.
## Example: America/Chicago
# log_with_timezone = ""

## Override default hostname, if empty use os.Hostname()
hostname = ""
## If set to true, do no set the "host" tag in the telegraf agent.
omit_hostname = true

## Method of translating SNMP objects. Can be "netsnmp" (deprecated) which
## translates by calling external programs snmptranslate and snmptable,
## or "gosmi" which translates using the built-in gosmi library.
# snmp_translator = "netsnmp"

## Name of the file to load the state of plugins from and store the state to.
## If uncommented and not empty, this file will be used to save the state of
## stateful plugins on termination of Telegraf. If the file exists on start,
## the state in the file will be restored for the plugins.
# statefile = ""

[[inputs.outbound_connectivity]]
urls = []
timeout_in_seconds = 30

[[inputs.disk_io]]
drives = []

[[inputs.simple]]
ok = true
interval = "10s"

# Send telegraf metrics to file(s)
[[outputs.file]]
flush_interval = "30s"
## Files to write to, "stdout" is a specially handled file.
#folder = "/Users/mizhe/tmporary"
#folder = "stdout"
folder = "/var/log/azure/Microsoft.ManagedServices.ApplicationHealthLinux/events"

## Use batch serialization format instead of line based delimiting. The
## batch format allows for the production of non line based output formats and
## may more efficiently encode and write metrics.
use_batch_format = true

## The file will be rotated after the time interval specified. When set
## to 0 no time based rotation is performed.
rotation_interval = "10s"

## The logfile will be rotated when it becomes larger than the specified
## size. When set to 0 no size based rotation is performed.
# rotation_max_size = "0MB"

## Data format to output.
## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
data_format = "json"
json_timestamp_format = "2006-01-02T15:04:05Z07:00"
json_transformation = '''
metrics.$merge([{"Timestamp": timestamp, "Message": $string(fields)}, tags])
'''

Binary file not shown.
19 changes: 11 additions & 8 deletions integration-test/env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ integration testing Docker image.

```
.
├── {THUMBPRINT}.crt <-- tests generate and push this certificate
├── {THUMBPRINT}.prv <-- tests generate and push this private key
└── Extension/
├── HandlerManifest.json <-- docker image build pushes it here
├── HandlerEnvironment.json <-- the extension reads this
├── bin/ <-- docker image build pushes the extension binary here
├── config/ <-- tests push 0.settings file here
└── status/ <-- extension should write here
├── {THUMBPRINT}.crt <-- tests generate and push this certificate
├── {THUMBPRINT}.prv <-- tests generate and push this private key
├── Extension/
├ ├── HandlerManifest.json <-- docker image build pushes it here
├ ├── HandlerEnvironment.json <-- the extension reads this
├ ├── bin/ <-- docker image build pushes the extension binary here
├ ├ └── VMWatch/
├ ├ ├── vmwatch_linux_amd64 <-- VMWatch AMD64 binary
├ ├ └── vmwatch.conf <-- VMWatch configuration file
├───├── config/ <-- tests push 0.settings file here
└───└── status/ <-- extension should write here
```
2 changes: 1 addition & 1 deletion integration-test/test/2_handler-commands.bats
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ teardown(){
}

@test "handler command: install - creates the data dir" {
mk_container sh -c "fake-waagent install && sleep 2"
mk_container sh -c "fake-waagent install"
push_settings '' ''

run start_container
Expand Down
Loading