diff --git a/.github/workflows/push_oci_artifact.yml b/.github/workflows/push_oci_artifact.yml deleted file mode 100644 index 60750720e..000000000 --- a/.github/workflows/push_oci_artifact.yml +++ /dev/null @@ -1,158 +0,0 @@ -# This action creates a new Testing Infra-agent OCI package version in the agent-control GitHub's package registry. -# -# The blob is a zip or tar containing: -# - newrelic-infra (.exe) -# - integrations/nri-docker (.exe) -# - -name: OCI test repo - compile & push multi-platform testing-infra-agent -on: - workflow_dispatch: - inputs: - agent_version: - description: 'Version tag' - required: true - nri_docker_version: - description: 'Embedded docker version' - required: false - default: "2.6.6" - -env: - IMAGE_NAME: "testing-infra-agent" - AGENT_VERSION: ${{ github.event.inputs.agent_version }} - NRI_DOCKER_VERSION: ${{ github.event.inputs.nri_docker_version }} - -jobs: - build-and-push: - runs-on: ubuntu-latest - strategy: - matrix: - include: - - { os: linux, arch: amd64, binary: newrelic-infra, format: tar+gzip } - - { os: linux, arch: arm64, binary: newrelic-infra, format: tar+gzip } - - { os: windows, arch: amd64, binary: newrelic-infra.exe, format: zip } - - { os: windows, arch: arm64, binary: newrelic-infra.exe, format: zip } - - { os: darwin, arch: arm64, binary: newrelic-infra, format: tar+gzip } - - { os: darwin, arch: amd64, binary: newrelic-infra, format: tar+gzip } - - permissions: - packages: write - contents: read - - steps: - - name: Checkout Source - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - repository: newrelic/infrastructure-agent - ref: ${{ env.AGENT_VERSION }} - - - name: Setup Go - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6 - with: - go-version: '1.26.0' - - - name: Download and Add nri-docker integration - shell: bash - run: | - mkdir -p integrations - - if [ "${{ matrix.os }}" = "windows" ]; then - # we always package amd64 docker because arm64 doesn't exist. - URL="https://download.newrelic.com/infrastructure_agent/binaries/windows/amd64/nri-docker-amd64.${{ env.NRI_DOCKER_VERSION }}.zip" - curl -L -o nri-docker.zip "$URL" - unzip -j nri-docker.zip '*/nri-docker.exe' -d integrations - rm nri-docker.zip - elif [ "${{ matrix.os }}" = "linux" ]; then - URL="https://download.newrelic.com/infrastructure_agent/binaries/linux/${{ matrix.arch }}/nri-docker_linux_${{ env.NRI_DOCKER_VERSION }}_${{ matrix.arch }}.tar.gz" - echo $URL - curl -L -o nri-docker.tar.gz "$URL" - tar -xzf nri-docker.tar.gz --strip-components=6 -C integrations - rm nri-docker.tar.gz - fi - - - name: Compile Binary - run: | - # force amd64 if OS is windows because compiling infra arm64 is unsupported - GOARCH_VALUE=${{ matrix.os == 'windows' && 'amd64' || matrix.arch }} - - GOOS=${{ matrix.os }} GOARCH=$GOARCH_VALUE go build \ - -o ${{ matrix.binary }} \ - ./cmd/newrelic-infra - - - name: Package Artifact - id: package - run: | - if [ "${{ matrix.os }}" = "windows" ]; then - FILENAME="newrelic-infra-${{ matrix.arch }}.zip" - zip -r $FILENAME ${{ matrix.binary }} integrations/ - else - FILENAME="newrelic-infra-${{ matrix.os }}-${{ matrix.arch }}.tar.gz" - tar -cvzf $FILENAME ${{ matrix.binary }} integrations/ - fi - echo "filename=$FILENAME" >> $GITHUB_OUTPUT - - - name: Install ORAS - uses: oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6 # v1 - - - name: Push Platform Tag - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin - - cat < layer_annotations.json - { - "${{ steps.package.outputs.filename }}": { - "org.opencontainers.image.title": "${{ steps.package.outputs.filename }}", - "org.opencontainers.image.version": "${{ env.AGENT_VERSION }}", - "com.newrelic.artifact.type": "package" - } - } - EOF - - DIGEST=$(oras push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} \ - --artifact-type application/vnd.newrelic.agent.v1 \ - --artifact-platform ${{ matrix.os }}/${{ matrix.arch }} \ - --annotation-file layer_annotations.json \ - ${{ steps.package.outputs.filename }}:application/vnd.newrelic.agent.content.v1.${{ matrix.format }} | grep "Digest:" | awk '{print $2}') - - echo "$DIGEST" > digest-${{ matrix.os }}-${{ matrix.arch }}.txt - - - name: Upload Digest Artifact - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 - with: - name: digest-${{ matrix.os }}-${{ matrix.arch }} - path: digest-${{ matrix.os }}-${{ matrix.arch }}.txt - - create-index: - needs: build-and-push - runs-on: ubuntu-latest - permissions: - packages: write - steps: - - name: Install ORAS - uses: oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6 # v1 - - - name: Download All Digests - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 - with: - path: digests - pattern: digest-* - merge-multiple: true - - - name: Create Multi-Platform Index - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin - REPO="ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}" - VERSION="${{ env.AGENT_VERSION }}" - - # Combine all downloaded digests into a single string for the command - # Each entry looks like REPO@sha256:xxxx - DIGEST_LIST="" - for f in digests/*.txt; do - D=$(cat "$f") - DIGEST_LIST="$DIGEST_LIST $REPO@$D" - done - - echo "Creating index for: $DIGEST_LIST" - - # Create the single tagged index pointing to all anonymous platform manifests - oras manifest index create $REPO:v$VERSION $DIGEST_LIST diff --git a/agent-control/agent-type-registry/newrelic/com.newrelic.infrastructure-0.1.0.yaml b/agent-control/agent-type-registry/newrelic/com.newrelic.infrastructure-0.1.0.yaml index 7ad8f5949..f8c0c618a 100644 --- a/agent-control/agent-type-registry/newrelic/com.newrelic.infrastructure-0.1.0.yaml +++ b/agent-control/agent-type-registry/newrelic/com.newrelic.infrastructure-0.1.0.yaml @@ -159,7 +159,6 @@ deployment: port: ${nr-var:health_port} packages: infra-agent: - type: zip download: oci: registry: ${nr-var:oci.registry} diff --git a/agent-control/agent-type-registry/newrelic/com.newrelic.opentelemetry.collector-0.1.0.yaml b/agent-control/agent-type-registry/newrelic/com.newrelic.opentelemetry.collector-0.1.0.yaml index 8882eb2d9..f4cfe2be7 100644 --- a/agent-control/agent-type-registry/newrelic/com.newrelic.opentelemetry.collector-0.1.0.yaml +++ b/agent-control/agent-type-registry/newrelic/com.newrelic.opentelemetry.collector-0.1.0.yaml @@ -130,7 +130,6 @@ deployment: port: ${nr-var:health_check.port} packages: nrdot: - type: zip download: oci: registry: ${nr-var:oci.registry} diff --git a/agent-control/src/agent_type/definition.rs b/agent-control/src/agent_type/definition.rs index 593c7ceac..947d72020 100644 --- a/agent-control/src/agent_type/definition.rs +++ b/agent-control/src/agent_type/definition.rs @@ -441,7 +441,6 @@ deployment: - ${nr-var:config2} packages: infra-agent: - type: tar.gz download: oci: registry: ${nr-var:registry} diff --git a/agent-control/src/agent_type/runtime_config/on_host.rs b/agent-control/src/agent_type/runtime_config/on_host.rs index 0568d13d5..8ebbb2654 100644 --- a/agent-control/src/agent_type/runtime_config/on_host.rs +++ b/agent-control/src/agent_type/runtime_config/on_host.rs @@ -189,7 +189,6 @@ executables: args: [] packages: my-pkg: - type: tar download: oci: registry: my.registry @@ -258,7 +257,6 @@ executables: args: [] packages: my-pkg: - type: tar download: oci: registry: my.registry @@ -751,7 +749,6 @@ executables: last_retry_interval: 30s packages: otel-first: - type: tar.gz download: oci: registry: ${nr-var:registry} @@ -759,7 +756,6 @@ packages: version: ${nr-var:version} public_key_url: ${nr-var:public-key-url} otel-second: - type: tar.gz download: oci: registry: ${nr-var:registry}