Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
463490d
Bump to v2.0.8: Bootstrap VMWatch Process if vmWatchSettings present …
frank-pang-msft Nov 17, 2023
7d3df06
Resource governance, heartbeat and dev container changes (#43)
dpoole73 Dec 1, 2023
10f4a64
fix script variable syntax (#46)
dpoole73 Dec 7, 2023
ee2640a
cgroup fixes (#47)
dpoole73 Jan 3, 2024
03813f3
adding more properties to pass down to vmwatch
manishsat Jan 4, 2024
5d53e50
Add debug flag when running vmwatch
zmyzheng Jan 4, 2024
b9a863f
Merge pull request #49 from zmyzheng/dev/zmyzheng/debugflag
zmyzheng Jan 5, 2024
5794e7b
added parameters to schema
manishsat Jan 8, 2024
0bda300
Merge branch 'feature/v2/bootstrapVMWatch' into feature/v2/bootstrapV…
manishsat Jan 8, 2024
314b7a1
adding compatible binaries
manishsat Jan 10, 2024
1d7ac0a
Merge pull request #48 from manishsat/feature/v2/bootstrapVMWatch
manishsat Jan 10, 2024
3900799
removing type from tag, unmarshal is failing otherwise
manishsat Jan 10, 2024
48c44fc
Adding test case unmarshal public settings
manishsat Jan 10, 2024
87048b9
added asserts on enabled and globalConfigUrl
manishsat Jan 10, 2024
e7ab697
Merge pull request #50 from manishsat/feature/v2/bootstrapVMWatch
manishsat Jan 10, 2024
23fde9d
adding a way to provide custom container to upload artifact
manishsat Jan 13, 2024
1e33779
removed extra space
manishsat Jan 13, 2024
0f218be
use variable instead of hard coded value
manishsat Jan 13, 2024
e27e5e5
Merge pull request #51 from manishsat/feature/v2/bootstrapVMWatch
manishsat Jan 13, 2024
1f5e41b
Passing Extension Version to VMWatch (#52)
klugorosado Jan 18, 2024
f443d2e
updating vmwatch version to 1.0.8
dpoole73 Jan 22, 2024
3791d08
move to version 1.0.9
dpoole73 Jan 22, 2024
8f3fd75
updating to 1.0.10 version
dpoole73 Jan 25, 2024
9c6393a
1.0.11
dpoole73 Jan 26, 2024
57bca90
Merge pull request #54 from Azure/dev/dpoole/update-vmwatch-to-1.0.8
dpoole73 Jan 26, 2024
cba77e8
Configurable rg settings
dpoole73 Feb 8, 2024
d29ce6a
add validation of default value
dpoole73 Feb 9, 2024
a537451
clean up logic a bit
dpoole73 Feb 9, 2024
d6fedcb
feedback
dpoole73 Feb 9, 2024
b2f1012
Merge pull request #55 from Azure/dev/dpoole/tweak-resource-governance
dpoole73 Feb 10, 2024
16ab06c
update vmwatch to 1.0.13
dpoole73 Feb 12, 2024
1bc094c
Merge pull request #56 from Azure/dev/dpoole/update-vmwatch-to-1.0.13
dpoole73 Feb 15, 2024
3ae2bd3
Fixing bug to successfully kill AppHealth Gracefully & VMWatch. (#59)
klugorosado Mar 19, 2024
7a9c4ff
Bump to v2.0.9
frank-pang-msft Mar 19, 2024
8dae5e7
Switch to use systemd-run to launch vmwatch
dpoole73 Apr 22, 2024
fc430b0
correct typo
dpoole73 Apr 22, 2024
c864997
make sure bash files are lf line endings
dpoole73 Apr 22, 2024
e4c00e9
feedback
dpoole73 Apr 23, 2024
0c9a693
feedback
dpoole73 Apr 24, 2024
b30ee91
feedback
dpoole73 Apr 24, 2024
fea2ebd
fix test issue. There seems to be a non-deterministic case where the…
dpoole73 Apr 24, 2024
3e94eb6
revert
dpoole73 Apr 24, 2024
23cb651
correcting the search term
dpoole73 Apr 24, 2024
043d2a2
Merge pull request #64 from Azure/dev/dpoole/cgroup-using-systemd-run
dpoole73 Apr 26, 2024
152b39c
Updating vmwatch binaries to 1.1.0 package
dpoole73 Apr 30, 2024
6596189
bump version to 2.0.10
zmyzheng Apr 30, 2024
b552134
Merge pull request #65 from Azure/dev/dpoole/update-vmwatch-4-30
dpoole73 Apr 30, 2024
e8e69f4
Merge pull request #66 from Azure/release-2.0.10
zmyzheng Apr 30, 2024
b56f2ad
Adding Kusto Telemetry to ApplicationHealthLinux v2 (#63)
klugorosado May 2, 2024
30a2d4c
update the latest vmwatch binaries (1.1.1)
dpoole73 May 2, 2024
bd1dbc0
Merge pull request #67 from Azure/dev/dpoole/update-vmwatch-5-2
dpoole73 May 3, 2024
6279931
Removing Unnecessary Telemetry Events and Log CustomMetrics Changes o…
klugorosado May 3, 2024
f9ff9c5
Change the commandline used for systemd-run depeding on the installed…
dpoole73 May 6, 2024
5b29a32
feedback
dpoole73 May 6, 2024
6d2ff1e
Merge pull request #69 from Azure/dpoole/systemd-run-commandline-fix
dpoole73 May 6, 2024
c7b28f0
fix(cgroups): Fixing the check for systemd-run
dpoole73 May 14, 2024
c84eb7b
fix error check
dpoole73 May 14, 2024
89379ba
fix accidental edit
dpoole73 May 14, 2024
486672b
preserving the original logic
dpoole73 May 14, 2024
c079e29
revert accidental new variable creation
dpoole73 May 14, 2024
03446f8
feedback
dpoole73 May 15, 2024
baa630d
corrected test to match the new way the error shows up based on previ…
dpoole73 May 15, 2024
b484db3
Changes to support running devcontainer based tests on Mac Silicon (#72)
dpoole73 May 16, 2024
3051598
fix(cgroups): Fixing the check for systemd-run (#70)
dpoole73 May 16, 2024
e698028
Adding CodeQL Code Scanning Workflow (#71) (#73)
klugorosado May 16, 2024
af6cd72
fix: Update manifest.xml version to 2.0.11
klugorosado May 16, 2024
62444c8
bump version to 2.0.11 (#74)
zmyzheng May 17, 2024
aefdba0
Improve logging to kusto for better debugging (#77)
frank-pang-msft May 21, 2024
f723cfd
AppHealthLinux manifest version bump to 2.0.12
zmyzheng May 23, 2024
46fbe02
update VMWatch binary
zmyzheng May 23, 2024
b2b0c04
AppHealthLinux manifest version bump to 2.0.12 (#81)
zmyzheng May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 47 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM mcr.microsoft.com/devcontainers/go:1.22-bullseye

RUN apt-get -qqy update && \
apt-get -qqy install jq openssl ca-certificates && \
apt-get -qqy clean && \
rm -rf /var/lib/apt/lists/*

# Create the directories and files that need to be present
RUN mkdir -p /var/lib/waagent && \
mkdir -p /var/lib/waagent/Extension/config && \
mkdir -p /var/lib/waagent/Extension/status && \
mkdir -p /var/log/azure/Extension/VE.RS.ION \
mkdir -p /var/log/azure/Extension/events

# copy default extension settings into the appropriate location
COPY extension-settings.json /var/lib/waagent/Extension/config/0.settings
# install go tools we need for build
RUN go install github.com/ahmetb/govvv@latest

# Install npm
RUN apt-get update && \
apt-get install -y npm

# Updating npm to the latest version
RUN npm cache clean -f && npm install -g n && n stable

# Install dev enviroment dependencies
RUN npm install bats -g

#Install Bats-Assert and Bats-Support
RUN npm install -g https://github.com/bats-core/bats-assert && \
npm install -g https://github.com/bats-core/bats-support

# Install Parallel
RUN apt-get install -y parallel

# Install Docker
RUN apt-get install runc -y && \
apt-get install containerd -y && \
apt-get install docker.io -y

# Install Docker Engine
RUN curl -fsSL https://test.docker.com -o test-docker.sh && \
sh test-docker.sh

# Creating ENV variables
ENV CUSTOM_BATS_LIB_PATH /usr/local/lib/node_modules
33 changes: 33 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Dev Container Info

This directory contains files to support running the code in a dev container. This allows you build and debug the code locally, either on a PC, Mac or linux machine.

This works using VSCode's dev container support.

# Requirements

1. Docker – needed for building the docker image and for devcontainer workflow. Microsoft has an enterprise agreement with docker, details [here](https://microsoft.service-now.com/sp?id=sc_cat_item&sys_id=234197ba1b418d54bba22173b24bcbf0)
- Windows Installer is [here](https://docs.docker.com/desktop/install/windows-install/)
- Mac installer is [here](https://docs.docker.com/desktop/install/mac-install/)

1. Dev Containers VSCode extension
- installation info is [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)

# Running In DevContainer

This works either on windows/mac machine or via a remote SSH session on a linux machine (this is the only way that the integration tests can reliably run, debugging works in all modes)

1. Go to the root of the repo in a command window
1. Open vscode using `code .`
1. Click the Blue `><` thing in thr bottom left of the screen and select `reopen in container` (the first time this runs it will take some time as it will build the docker container for the dev environment based on the dockerfile in the .devcontainer directory)
1. Once it has opened, open a bash terminal in vscode
1. run `make devcontainer`
1. you are now ready to run and debug the extension

## Debugging

1. configure the appropriate settings in the file `.devcontainer/extension-settings.json` (the default one enables the `simple` and `process` tests for vmwatch but you can change it)
1. click the debug icon on the left and select `devcontainer run - enable` target
- you can add more in `launch.json` as needed
1. set breakpoints as required
1. hit f5 to launch the extension code
Empty file added .devcontainer/devcontainer.env
Empty file.
68 changes: 68 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.0/containers/dotnet
{
"name": "Golang",
"build": {
"dockerfile": "Dockerfile",
"args": {}
},
"runArgs": [
// add this if we need privileged access
"--privileged",
"--env-file",
".devcontainer/devcontainer.env"
],
"containerEnv": {
"RUNNING_IN_DEV_CONTAINER": "1",
"ALLOW_VMWATCH_CGROUP_ASSIGNMENT_FAILURE": "1",
"DOCKER_DEFAULT_PLATFORM": "linux/amd64"
},

"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.go",
"ms-azuretools.vscode-docker"
],
"recommendations": [
"GitHub.copilot",
"GitHub.copilot-chat",
"GitHub.vscode-pull-request-github"
]
}
},
"remoteUser": "root",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "go mod download && echo hello",
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
]

// // Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],B
// [Optional] To reuse of your local HTTPS dev cert:
//
// 1. Export it locally using this command:
// * Windows PowerShell:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
// * macOS/Linux terminal:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
//
// 2. Uncomment these 'remoteEnv' lines:
// "remoteEnv": {
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
// },
//
// 3. Do one of the following depending on your scenario:
// * When using GitHub Codespaces and/or Remote - Containers:
// 1. Start the container
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
//
// * If only using Remote - Containers with a local container, uncomment this line instead:
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
}
26 changes: 26 additions & 0 deletions .devcontainer/extension-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"runtimeSettings": [
{
"handlerSettings": {
"protectedSettingsCertThumbprint": "$cert_tp",
"publicSettings": {
"requestPath": "/health",
"port": 8080,
"numberOfProbes": 1,
"intervalInSeconds": 5,
"gracePeriod": 10,
"vmWatchSettings": {
"enabled": true,
"signalFilters": {
"disabledSignals" : [ "outbound_connectivity", "disk_io", "az_storage_blob", "clockskew", "process", "dns" ],
"enabledOptionalSignals" : [ "simple" ]
},
"environmentAttributes" : {
"OutboundConnectivityEnabled" : true
}
}
}
}
}
]
}
6 changes: 6 additions & 0 deletions .gitattibutes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# make sure sh files are encoded with unix line endings
*.sh text eol=lf
*.bash text eol=lf
103 changes: 103 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches:
- master
- feature/**
pull_request:
branches:
- master
- feature/**
schedule:
- cron: '0 9 * * *'


jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ matrix.os }}
env:
GOPATH: ${{ github.workspace }}/go

timeout-minutes: 360
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: manual
os : [ubuntu-latest]
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- run : pwd
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'

- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
run: |
go env
make binary

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
31 changes: 23 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
name: Go
name: Go (Ext V2)

on:
workflow_dispatch:
push:
branches:
- master
- feature/*
- feature/**
pull_request:
branches:
- master
- feature/*
- feature/**

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-20.04]

Expand All @@ -27,9 +28,9 @@ jobs:
run: sudo apt-get update

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.18.10'
go-version: '1.22.2'

- name: Setup Go Environment
run: |
Expand All @@ -52,6 +53,20 @@ jobs:
sudo apt install npm
sudo npm install -g bats

- name: Setup bats libs
uses: bats-core/bats-action@1.5.6
with:
assert-install: true
support-install: true
bats-install: false
detik-install: false
file-install: false

- name: Testing Bats Installation
run: |
bats --version
sudo bats --version

- name: Install Parallel
run: |
sudo apt install parallel
Expand All @@ -78,7 +93,7 @@ jobs:
working-directory: ${{ env.repo_root }}

- name: Unit Tests
continue-on-error: true
continue-on-error: false
run: go list ./... | grep -v '/vendor/' | xargs go test -v -cover
working-directory: ${{ env.repo_root }}

Expand Down Expand Up @@ -109,10 +124,10 @@ jobs:
continue-on-error: true
run: |
mkdir -p integration-test/test/parallel/.bats/run-logs/
sudo bats integration-test/test/parallel --jobs 10 -T --trace
sudo bats integration-test/test/parallel --jobs 10 -T --trace --filter-tags !linuxhostonly
working-directory: ${{ env.repo_root }}

- name: Retry Failing Parallel Integration Tests
run: |
sudo bats integration-test/test/parallel --filter-status failed -T --trace
sudo bats integration-test/test/parallel --filter-status failed -T --trace --filter-tags !linuxhostonly
working-directory: ${{ env.repo_root }}
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"ms-vscode-remote.remote-containers",
"ms-vscode-remote.remote-ssh",
"github.copilot",
"ms-azuretools.vscode-docker",
"github.vscode-pull-request-github"
]
}
Loading