Skip to content

Commit

Permalink
ci: add unsupported build to CI (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre authored Jan 10, 2022
1 parent fdd38be commit d6f856d
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 50 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
e2eTests:
if: ${{ ! contains(github.event.pull_request.labels.*.name, 'ci/skip-e2e') }}
runs-on: ubuntu-20.04
strategy:
max-parallel: 7 # len(k8sVersion) is a good number to have here
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Windows build

on:
push:
branches:
- v2
pull_request:
branches:
- v2
workflow_dispatch:

jobs:
build:
name: Build integration for
strategy:
fail-fast: false
matrix:
windows:
# Here we specify the GH runner where the image will be built.
# Tag must exist in both https://hub.docker.com/_/microsoft-windows-servercore and
# https://hub.docker.com/_/microsoft-windows-nanoserver, and must be matched with the runner.
# In theory, newer versions could build old images using --isolation=hyperv, but unfortunately hyperv is not
# enabled in GHA.
- runner: windows-2019
tag: 1809
- runner: windows-2022
tag: ltsc2022
runs-on: ${{ matrix.windows.runner }}
env:
AGENT_VERSION: 1.20.7
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Get windows build
id: osinfo
shell: powershell
run: |
Get-ComputerInfo
- name: Build agent container
shell: powershell
run: |
mkdir infrastructure-agent
cd infrastructure-agent
# Get Dockerfile from https://github.com/newrelic/infrastructure-agent/pull/315/
Invoke-WebRequest https://raw.githubusercontent.com/newrelic/infrastructure-agent/26f92f4c504222e0558b80ac46e784369fe27117/build/container/Dockerfile.windows `
-OutFile Dockerfile.windows
Invoke-WebRequest https://download.newrelic.com/infrastructure_agent/binaries/windows/amd64/newrelic-infra-amd64.${{ env.AGENT_VERSION }}.zip `
-OutFile agent.zip
Expand-Archive agent.zip
docker build `
--pull `
--build-arg base_image_tag="${{ matrix.windows.tag }}" `
--build-arg image_version=${{ env.AGENT_VERSION }} `
--build-arg agent_version=${{ env.AGENT_VERSION }} `
--build-arg agent_bin="./agent/Program Files/New Relic/newrelic-infra/newrelic-infra.exe" `
--build-arg agent_ctl_bin="./agent/Program Files/New Relic/newrelic-infra/newrelic-infra-ctl.exe" `
--build-arg agent_service_bin="./agent/Program Files/New Relic/newrelic-infra/newrelic-infra-service.exe" `
-f Dockerfile.windows `
-t newrelic/infrastructure:${{ env.AGENT_VERSION }}-windows-${{ matrix.windows.tag }} .
- uses: actions/cache@v2
with:
path: |
%LocalAppData%\go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build integration
shell: bash
run: |
make compile CGO_ENABLED=1
- name: Build integration container
shell: bash
run: |
docker build -f Dockerfile.windows \
--build-arg IMAGE_TAG=${{ env.AGENT_VERSION }}-windows-${{ matrix.windows.tag }} \
-t newrelic/infrastructure-k8s:2-windows-${{ matrix.windows.tag }}-alpha \
.
# Release images if we're pushing to v2
- name: Login to DockerHub
if: ${{ ! github.event.pull_request }}
uses: docker/login-action@v1
with:
username: ${{ secrets.FSI_DOCKERHUB_USERNAME }}
password: ${{ secrets.FSI_DOCKERHUB_TOKEN }}

- name: Push image
if: ${{ ! github.event.pull_request }}
shell: bash
run: |
docker push newrelic/infrastructure-k8s:2-windows-${{ matrix.windows.tag }}-alpha
4 changes: 3 additions & 1 deletion Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ ARG IMAGE_NAME=newrelic/infrastructure
ARG IMAGE_TAG=1.10.36-windows-1809-alpha
FROM $IMAGE_NAME:$IMAGE_TAG

LABEL unsupported=true

ENV NRIA_IS_SECURE_FORWARD_ONLY true
ENV NRIA_CACHE_PATH "c:\var\cache\nr-kubernetes\infra-sdk-cache.json"
ENV NRIA_DISABLE_WIN_SHARED_WMI true

COPY ["nri-kubernetes-definition-windows.yml", "c:/Program Files/New Relic/newrelic-infra/newrelic-integrations/nri-kubernetes-definition.yml"]
COPY ["bin/nri-kubernetes.exe", "c:/Program Files/New Relic/newrelic-infra/newrelic-integrations/bin/nri-kubernetes.exe"]
COPY ["bin/nri-kubernetes", "c:/Program Files/New Relic/newrelic-infra/newrelic-integrations/bin/nri-kubernetes.exe"]
COPY ["nri-kubernetes-config.yml.sample", "c:/Program Files/New Relic/newrelic-infra/integrations.d/nri-kubernetes-config.yml"]

ENTRYPOINT ["c:\\Program Files\\New Relic\\newrelic-infra\\newrelic-infra.exe"]
120 changes: 71 additions & 49 deletions WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,52 +30,74 @@

## Missing metrics

This are the metrics that are not being exposed by the Windows kubelet.

### Node

/stats/summary

- memoryRssBytes: zero
- memoryPageFaults: zero
- memoryMajorPageFaultsPerSecond: zero
- net.rxBytesPerSecond
- net.txBytesPerSecond
- net.errorsPerSecond
- fsInodesFree
- fsInodes
- fsInodesUsed
- runtimeInodesFree
- runtimeInodes
- runtimeInodesUsed

### Pod

/stats/summary

- net.errorsPerSecond
- fsInodesFree
- fsInodes
- fsInodesUsed
- We still need to make a test for the pvc metrics

### Container

/stats/summary

- memoryUsedBytes
- fsUsedBytes: zero, so fsUsedPercent is zero
- fsInodesFree
- fsInodes
- fsInodesUsed

/metrics/cadvisor

- containerID
- containerImageID

### Pod

/stats/summary

- net.errorsPerSecond
### Host metrics

The following metrics will be missing from most samples as they are host metrics:
```
coreCount
processorCount
kernelVersion
```

### `K8sContainerSample`
```
containerID
containerImageID
containerMemoryMappedFileBytes
fsInodes
fsInodesFree
fsInodesUsed
fsUsedBytes*
fsUsedPercent*
memoryUsedBytes
memoryUtilization
```
`memoryWorkingSetBytes` and `memoryWorkingSetUtilization` can be used as alternatives to `memoryUsedBytes` and `memoryUtilization`.

### `K8sPodSample`:
```
net.errorsPerSecond
```

### `K8sNodeSample`

```
memoryRssBytes*
memoryPageFaults*
memoryMajorPageFaultsPerSecond*
allocatableHugepages1Gi
allocatableHugepages2Mi
capacityHugepages1Gi
capacityHugepages2Mi
condition.CorruptDockerOverlay2
condition.FrequentContainerdRestart
condition.FrequentDockerRestart
condition.FrequentKubeletRestart
condition.FrequentUnregisterNetDevice
condition.KernelDeadlock
condition.ReadonlyFilesystem
fsInodes
fsInodesFree
fsInodesUsed
linuxDistribution
net.errorsPerSecond
net.rxBytesPerSecond
net.txBytesPerSecond
runtimeInodes
runtimeInodesFree
runtimeInodesUsed
```

### `K8sVolumeSample`
```
fsInodes*
fsInodesFree*
fsInodesUsed*
```

> *: These metrics are reported, but always have the value `0`.
Metrics for other samples should be the same, as they are gathered from cluster-wide state broker `kube-state-metrics`.

0 comments on commit d6f856d

Please sign in to comment.