Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
41 changes: 18 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ ENV PATH="${PATH}:/usr/local/go/bin"

WORKDIR /work

# 1. Download dependencies for the main repository
# 1. Copy go.mod files for both main and submodule
COPY go.mod go.sum ./
RUN go mod download

# 2. Download dependencies for the OTEL submodule
COPY ./submodules/opentelemetry-operations-collector/go.mod ./submodules/opentelemetry-operations-collector/go.sum submodules/opentelemetry-operations-collector/

# 2. Download dependencies
RUN go mod download
RUN cd submodules/opentelemetry-operations-collector && go mod download

# Copy full source code
Expand All @@ -111,13 +111,8 @@ RUN \
./builds/otel.sh /work/cache/

# 4. Build ops-agent-engine (CGO disabled)
RUN . VERSION && \
BUILD_INFO_IMPORT_PATH="github.com/GoogleCloudPlatform/ops-agent/internal/version" && \
BUILD_X1="-X ${BUILD_INFO_IMPORT_PATH}.BuildDistro=sles12" && \
BUILD_X2="-X ${BUILD_INFO_IMPORT_PATH}.Version=${PKG_VERSION}" && \
LD_FLAGS="-s -w ${BUILD_X1} ${BUILD_X2}" && \
CGO_ENABLED=0 go build -buildvcs=false -o "/work/google_cloud_ops_agent_engine" \
-ldflags "${LD_FLAGS}" \
RUN CGO_ENABLED=0 go build -buildvcs=false -o "/work/google_cloud_ops_agent_engine" \
-ldflags "-s -w" \
github.com/GoogleCloudPlatform/ops-agent/cmd/google_cloud_ops_agent_engine

# 5. Build ops_agent plugin helper (CGO disabled)
Expand Down Expand Up @@ -178,7 +173,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=centos8-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -230,7 +225,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=rockylinux9-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -282,7 +277,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=rockylinux10-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -331,7 +326,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=bookworm-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -380,7 +375,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=bullseye-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -429,7 +424,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=trixie-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -485,7 +480,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=sles12-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -535,7 +530,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=sles15-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -585,7 +580,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=sles16-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -634,7 +629,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=jammy-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -683,7 +678,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=noble-build-systemd /work/cache /work/cache

Expand Down Expand Up @@ -732,7 +727,7 @@ COPY . /work
COPY --from=go-build /work/google_cloud_ops_agent_engine /work/google_cloud_ops_agent_engine
COPY --from=go-build /work/cache /work/cache

COPY ./confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml
COPY ./submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml /work/cache/etc/google-cloud-ops-agent/config.yaml

COPY --from=questing-build-systemd /work/cache /work/cache

Expand Down
10 changes: 5 additions & 5 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ COPY submodules/opentelemetry-operations-collector /work/submodules/opentelemetr

WORKDIR /work/submodules/opentelemetry-operations-collector/otelopscol

RUN & ./build.ps1 -outDir /work/out/bin
RUN Get-Content ../../../VERSION | Where-Object length | ForEach-Object { Invoke-Expression "\`$env:\`$_" }; `
& ./build.ps1 -outDir /work/out/bin -version $env:PKG_VERSION -buildDistro $env:BUILD_DISTRO

###############################################################################
# Config generator/service installer
Expand All @@ -67,10 +68,9 @@ COPY . /work

ARG WINDOWS_VERSION
ARG BUILD_DISTRO=windows-$WINDOWS_VERSION
RUN Get-Content VERSION | Where-Object length | ForEach-Object { Invoke-Expression "`$env:$_" }; `
go build -o bin/google-cloud-ops-agent.exe -ldflags \"-X github.com/GoogleCloudPlatform/ops-agent/internal/version.BuildDistro=$env:BUILD_DISTRO -X github.com/GoogleCloudPlatform/ops-agent/internal/version.Version=$env:PKG_VERSION\" ./cmd/ops_agent_windows; `
RUN go build -o bin/google-cloud-ops-agent.exe -ldflags "-s -w" ./cmd/ops_agent_windows; `
Copy-Item -Path bin/google-cloud-ops-agent.exe -Destination /work/out/bin/; `
Copy-Item -Path confgenerator/default-config.yaml -Destination /work/out/config/config.yaml;
Copy-Item -Path submodules/opentelemetry-operations-collector/confgenerator/default-config.yaml -Destination /work/out/config/config.yaml;

###############################################################################

Expand All @@ -87,7 +87,7 @@ COPY . /work
ARG WINDOWS_VERSION
ARG BUILD_DISTRO=windows-$WINDOWS_VERSION
RUN Get-Content VERSION | Where-Object length | ForEach-Object { Invoke-Expression "`$env:$_" }; `
go build -o bin/ops_agent.exe -ldflags \"-X github.com/GoogleCloudPlatform/ops-agent/internal/version.BuildDistro=$env:BUILD_DISTRO -X github.com/GoogleCloudPlatform/ops-agent/internal/version.Version=$env:PKG_VERSION\" ./cmd/ops_agent_uap_plugin; `
go build -o bin/ops_agent.exe -ldflags "-s -w" ./cmd/ops_agent_uap_plugin; `
Copy-Item -Path bin/ops_agent.exe -Destination /work/out/bin/; `
$env:PKG_VERSION | Out-File -FilePath /work/out/bin/OPS_AGENT_VERSION -Encoding UTF8;

Expand Down
108 changes: 0 additions & 108 deletions apps/builtinconf.go

This file was deleted.

92 changes: 0 additions & 92 deletions apps/common_logging_processors.go

This file was deleted.

Loading
Loading