-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add Windows 2019 and Windows 2022 infrastructure bundle images(NR-528123) #641
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
base: master
Are you sure you want to change the base?
Changes from all commits
de2812c
79c89ff
fa6ba64
3615523
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,7 +47,7 @@ | ||||||||||||||||||||||
| password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | |||||||||||||||||||||||
| - name: Build and push docker image | |||||||||||||||||||||||
| run: ./docker-build.sh . --push | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| build-fips: | |||||||||||||||||||||||
| name: Build fips and push image | |||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||
|
|
@@ -92,3 +92,67 @@ | ||||||||||||||||||||||
| password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | |||||||||||||||||||||||
| - name: Build and push docker image | |||||||||||||||||||||||
| run: ./docker-build.sh . --push | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| build-windows-2019: | |||||||||||||||||||||||
| name: Build and push Windows 2019 image | |||||||||||||||||||||||
| runs-on: windows-2022 | |||||||||||||||||||||||
| env: | |||||||||||||||||||||||
| DOCKER_IMAGE: newrelic/infrastructure-bundle | |||||||||||||||||||||||
| DOCKER_IMAGE_TAG: dev | |||||||||||||||||||||||
| AGENT_VERSION: ${{ github.event.inputs.agent_version }} | |||||||||||||||||||||||
| WINDOWS_VERSION: ltsc2019 | |||||||||||||||||||||||
| steps: | |||||||||||||||||||||||
| - uses: actions/checkout@v4 | |||||||||||||||||||||||
| - name: Switch to Windows containers | |||||||||||||||||||||||
| run: | | |||||||||||||||||||||||
| Stop-Service docker -Force | |||||||||||||||||||||||
| $configPath = "$env:ProgramData\docker\config\daemon.json" | |||||||||||||||||||||||
| if (-not (Test-Path (Split-Path $configPath))) { | |||||||||||||||||||||||
| New-Item -ItemType Directory -Force -Path (Split-Path $configPath) | Out-Null | |||||||||||||||||||||||
| } | |||||||||||||||||||||||
| Set-Content -Path $configPath -Value '{"experimental":true}' | |||||||||||||||||||||||
| Start-Service docker | |||||||||||||||||||||||
| Start-Sleep 5 | |||||||||||||||||||||||
| shell: pwsh | |||||||||||||||||||||||
| - uses: actions/setup-go@v5 | |||||||||||||||||||||||
| with: | |||||||||||||||||||||||
| go-version-file: go.mod | |||||||||||||||||||||||
| - uses: docker/login-action@v3 | |||||||||||||||||||||||
| with: | |||||||||||||||||||||||
| username: ${{ secrets.OHAI_DOCKER_HUB_ID }} | |||||||||||||||||||||||
| password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | |||||||||||||||||||||||
| - name: Build and push Windows 2019 image | |||||||||||||||||||||||
| shell: bash | |||||||||||||||||||||||
| run: ./docker-build-windows.sh --push | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| build-windows-2022: | |||||||||||||||||||||||
|
Comment on lines
+97
to
+128
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 months ago In general, you fix this by explicitly setting For this workflow, the best minimal change without altering existing functionality is to add a root-level permissions:
contents: readThis will cover all jobs (
Suggested changeset
1
.github/workflows/on-demand.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||
| name: Build and push Windows 2022 image | |||||||||||||||||||||||
| runs-on: windows-2022 | |||||||||||||||||||||||
| env: | |||||||||||||||||||||||
| DOCKER_IMAGE: newrelic/infrastructure-bundle | |||||||||||||||||||||||
| DOCKER_IMAGE_TAG: dev | |||||||||||||||||||||||
| AGENT_VERSION: ${{ github.event.inputs.agent_version }} | |||||||||||||||||||||||
| WINDOWS_VERSION: ltsc2022 | |||||||||||||||||||||||
| steps: | |||||||||||||||||||||||
| - uses: actions/checkout@v4 | |||||||||||||||||||||||
| - name: Switch to Windows containers | |||||||||||||||||||||||
| run: | | |||||||||||||||||||||||
| Stop-Service docker -Force | |||||||||||||||||||||||
| $configPath = "$env:ProgramData\docker\config\daemon.json" | |||||||||||||||||||||||
| if (-not (Test-Path (Split-Path $configPath))) { | |||||||||||||||||||||||
| New-Item -ItemType Directory -Force -Path (Split-Path $configPath) | Out-Null | |||||||||||||||||||||||
| } | |||||||||||||||||||||||
| Set-Content -Path $configPath -Value '{"experimental":true}' | |||||||||||||||||||||||
| Start-Service docker | |||||||||||||||||||||||
| Start-Sleep 5 | |||||||||||||||||||||||
| shell: pwsh | |||||||||||||||||||||||
| - uses: actions/setup-go@v5 | |||||||||||||||||||||||
| with: | |||||||||||||||||||||||
| go-version-file: go.mod | |||||||||||||||||||||||
| - uses: docker/login-action@v3 | |||||||||||||||||||||||
| with: | |||||||||||||||||||||||
| username: ${{ secrets.OHAI_DOCKER_HUB_ID }} | |||||||||||||||||||||||
| password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | |||||||||||||||||||||||
| - name: Build and push Windows 2022 image | |||||||||||||||||||||||
| shell: bash | |||||||||||||||||||||||
| run: ./docker-build-windows.sh --push | |||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,15 +9,15 @@ | |||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| original_repo_name: 'newrelic/infrastructure-bundle' | ||||||||||||||||||||||||||||||||
| docker_image_name: 'newrelic/infrastructure-bundle' | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| release_command_sh: | | ||||||||||||||||||||||||||||||||
| go run downloader.go | ||||||||||||||||||||||||||||||||
| ./docker-build.sh . --push | ||||||||||||||||||||||||||||||||
| if [[ "${{ github.event.release.prerelease }}" == "false" ]]; then | ||||||||||||||||||||||||||||||||
| export DOCKER_IMAGE_TAG=latest | ||||||||||||||||||||||||||||||||
| ./docker-build.sh . --push | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| secrets: | ||||||||||||||||||||||||||||||||
| docker_username: ${{ secrets.OHAI_DOCKER_HUB_ID }} | ||||||||||||||||||||||||||||||||
| docker_password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | ||||||||||||||||||||||||||||||||
|
|
@@ -30,7 +30,7 @@ | |||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| original_repo_name: 'newrelic/infrastructure-bundle' | ||||||||||||||||||||||||||||||||
| docker_image_name: 'newrelic/infrastructure-bundle-fips' | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| release_command_sh: | | ||||||||||||||||||||||||||||||||
| go run downloader.go -bundle=bundle-fips.yml -outdir=out-fips | ||||||||||||||||||||||||||||||||
| export DOCKER_PLATFORMS=linux/amd64,linux/arm64 | ||||||||||||||||||||||||||||||||
|
|
@@ -42,10 +42,106 @@ | |||||||||||||||||||||||||||||||
| export DOCKER_IMAGE_TAG=latest | ||||||||||||||||||||||||||||||||
| ./docker-build.sh . --push | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| secrets: | ||||||||||||||||||||||||||||||||
| docker_username: ${{ secrets.OHAI_DOCKER_HUB_ID }} | ||||||||||||||||||||||||||||||||
| docker_password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | ||||||||||||||||||||||||||||||||
| bot_token: ${{ secrets.COREINT_BOT_TOKEN }} | ||||||||||||||||||||||||||||||||
| slack_channel: ${{ secrets.COREINT_SLACK_CHANNEL }} | ||||||||||||||||||||||||||||||||
| slack_token: ${{ secrets.COREINT_SLACK_TOKEN }} | ||||||||||||||||||||||||||||||||
| slack_token: ${{ secrets.COREINT_SLACK_TOKEN }} | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| container-release-windows-2019: | ||||||||||||||||||||||||||||||||
| name: Release Windows 2019 image | ||||||||||||||||||||||||||||||||
| runs-on: windows-2022 | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
| - name: Switch to Windows containers | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| Stop-Service docker -Force | ||||||||||||||||||||||||||||||||
| $configPath = "$env:ProgramData\docker\config\daemon.json" | ||||||||||||||||||||||||||||||||
| if (-not (Test-Path (Split-Path $configPath))) { | ||||||||||||||||||||||||||||||||
| New-Item -ItemType Directory -Force -Path (Split-Path $configPath) | Out-Null | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| Set-Content -Path $configPath -Value '{"experimental":true}' | ||||||||||||||||||||||||||||||||
| Start-Service docker | ||||||||||||||||||||||||||||||||
| Start-Sleep 5 | ||||||||||||||||||||||||||||||||
| shell: pwsh | ||||||||||||||||||||||||||||||||
| - uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| go-version-file: go.mod | ||||||||||||||||||||||||||||||||
| - uses: docker/login-action@v3 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| username: ${{ secrets.OHAI_DOCKER_HUB_ID }} | ||||||||||||||||||||||||||||||||
| password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | ||||||||||||||||||||||||||||||||
| - name: Set release tag | ||||||||||||||||||||||||||||||||
| id: release_tag | ||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| TAG="${{ github.event.release.tag_name }}" | ||||||||||||||||||||||||||||||||
| TAG="${TAG#v}" | ||||||||||||||||||||||||||||||||
| if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then | ||||||||||||||||||||||||||||||||
| TAG="${TAG}-rc" | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||
| - name: Build and push Windows 2019 image | ||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||
| DOCKER_IMAGE: newrelic/infrastructure-bundle | ||||||||||||||||||||||||||||||||
| DOCKER_IMAGE_TAG: ${{ steps.release_tag.outputs.tag }} | ||||||||||||||||||||||||||||||||
| WINDOWS_VERSION: ltsc2019 | ||||||||||||||||||||||||||||||||
| run: ./docker-build-windows.sh --push | ||||||||||||||||||||||||||||||||
| - name: Push latest tag for Windows 2019 | ||||||||||||||||||||||||||||||||
| if: ${{ github.event.release.prerelease == false }} | ||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| docker tag "newrelic/infrastructure-bundle:${{ steps.release_tag.outputs.tag }}-servercore-ltsc2019" \ | ||||||||||||||||||||||||||||||||
| "newrelic/infrastructure-bundle:latest-servercore-ltsc2019" | ||||||||||||||||||||||||||||||||
| docker push "newrelic/infrastructure-bundle:latest-servercore-ltsc2019" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| container-release-windows-2022: | ||||||||||||||||||||||||||||||||
|
Comment on lines
+54
to
+101
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 months ago In general, fix this by explicitly defining a The best fix with minimal functional change is to add a single top-level
Suggested changeset
1
.github/workflows/release.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||
| name: Release Windows 2022 image | ||||||||||||||||||||||||||||||||
| runs-on: windows-2022 | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
| - name: Switch to Windows containers | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| Stop-Service docker -Force | ||||||||||||||||||||||||||||||||
| $configPath = "$env:ProgramData\docker\config\daemon.json" | ||||||||||||||||||||||||||||||||
| if (-not (Test-Path (Split-Path $configPath))) { | ||||||||||||||||||||||||||||||||
| New-Item -ItemType Directory -Force -Path (Split-Path $configPath) | Out-Null | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| Set-Content -Path $configPath -Value '{"experimental":true}' | ||||||||||||||||||||||||||||||||
| Start-Service docker | ||||||||||||||||||||||||||||||||
| Start-Sleep 5 | ||||||||||||||||||||||||||||||||
| shell: pwsh | ||||||||||||||||||||||||||||||||
| - uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| go-version-file: go.mod | ||||||||||||||||||||||||||||||||
| - uses: docker/login-action@v3 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| username: ${{ secrets.OHAI_DOCKER_HUB_ID }} | ||||||||||||||||||||||||||||||||
| password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | ||||||||||||||||||||||||||||||||
| - name: Set release tag | ||||||||||||||||||||||||||||||||
| id: release_tag | ||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| TAG="${{ github.event.release.tag_name }}" | ||||||||||||||||||||||||||||||||
| TAG="${TAG#v}" | ||||||||||||||||||||||||||||||||
| if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then | ||||||||||||||||||||||||||||||||
| TAG="${TAG}-rc" | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||
| - name: Build and push Windows 2022 image | ||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||
| DOCKER_IMAGE: newrelic/infrastructure-bundle | ||||||||||||||||||||||||||||||||
| DOCKER_IMAGE_TAG: ${{ steps.release_tag.outputs.tag }} | ||||||||||||||||||||||||||||||||
| WINDOWS_VERSION: ltsc2022 | ||||||||||||||||||||||||||||||||
| run: ./docker-build-windows.sh --push | ||||||||||||||||||||||||||||||||
| - name: Push latest tag for Windows 2022 | ||||||||||||||||||||||||||||||||
| if: ${{ github.event.release.prerelease == false }} | ||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| docker tag "newrelic/infrastructure-bundle:${{ steps.release_tag.outputs.tag }}-servercore-ltsc2022" \ | ||||||||||||||||||||||||||||||||
| "newrelic/infrastructure-bundle:latest-servercore-ltsc2022" | ||||||||||||||||||||||||||||||||
| docker push "newrelic/infrastructure-bundle:latest-servercore-ltsc2022" | ||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ARG base_image_tag=latest | ||
| ARG base_image_name=newrelic/infrastructure-windows | ||
|
|
||
| FROM ${base_image_name}:${base_image_tag} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 3 months ago
In general, the fix is to add an explicit
permissions:block that grants only the minimal required scopes forGITHUB_TOKEN. Since these jobs just build and scan images, check out code, and validate markdown, they only need read access to repository contents; no write scopes are required.The best minimal fix without changing existing functionality is to add a workflow‑level
permissions:block after thename:(or afteron:) settingcontents: read. This will apply to all jobs (build,build-fips,build-windows-2019,build-windows-2022) since none of them define their ownpermissions:. No additional imports or definitions are needed; this is a pure YAML configuration change in.github/workflows/build.yml.Concretely:
.github/workflows/build.yml.right after the
name: Container buildline (line 2 in the snippet). This constrainsGITHUB_TOKENfor all jobs, resolving the CodeQL finding for thebuild-windows-2019job and the workflow as a whole.