Skip to content
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

Updating bucket references from O11y to Ingest path #454

Merged
merged 65 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9f9b34a
Update Dockerfile.tmpl
rowlandgeoff Sep 11, 2024
79c7889
Update Dockerfile.tmpl
rowlandgeoff Sep 11, 2024
1c27a1e
Update Dockerfile.tmpl
rowlandgeoff Sep 11, 2024
fafd1b9
Update Dockerfile.tmpl
rowlandgeoff Sep 11, 2024
98f7ed2
Update Dockerfile.tmpl
rowlandgeoff Sep 11, 2024
7e47a11
Update README.md
rowlandgeoff Sep 11, 2024
80e9948
Update pre-command gcp cred path
rowlandgeoff Sep 11, 2024
6999d79
Merge branch 'main' into bucketPathUpdate
rowlandgeoff Sep 18, 2024
c9df1a1
Merge branch 'main' into bucketPathUpdate
v1v Sep 18, 2024
c11e968
Try switching the secret back to o11y
rowlandgeoff Sep 19, 2024
a262c52
Merge branch 'main' into bucketPathUpdate
rowlandgeoff Sep 19, 2024
2d455f5
Comment out sha checking for testing
rowlandgeoff Sep 19, 2024
ccb79e8
Update Dockerfile.tmpl
rowlandgeoff Sep 19, 2024
6d37227
Update Dockerfile.tmpl
rowlandgeoff Sep 19, 2024
45a1269
Update Dockerfile.tmpl
rowlandgeoff Sep 19, 2024
758adaf
Update Dockerfile.tmpl
rowlandgeoff Sep 19, 2024
dae9ff6
Update Dockerfile.tmpl
rowlandgeoff Sep 19, 2024
f3052bb
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
7261b25
Update Makefile.common
rowlandgeoff Sep 20, 2024
6aa8836
Update Makefile.common
rowlandgeoff Sep 20, 2024
e668270
Update Makefile.common
rowlandgeoff Sep 20, 2024
fb60a38
Update Makefile.common
rowlandgeoff Sep 20, 2024
0564024
Update Makefile.common
rowlandgeoff Sep 20, 2024
2a3f6bb
Update Makefile.common
rowlandgeoff Sep 20, 2024
a1f7632
Update Makefile.common
rowlandgeoff Sep 20, 2024
fbac907
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
be3a3b5
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
40ae11f
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
63aee44
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
bd97250
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
06e326c
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
b2a8317
Update Makefile.common
rowlandgeoff Sep 20, 2024
96426ca
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
0fb95b2
Update Makefile.common
rowlandgeoff Sep 20, 2024
10aa6ec
Update Dockerfile.tmpl
rowlandgeoff Sep 20, 2024
359b6b2
Update Makefile.common
rowlandgeoff Sep 20, 2024
93ad11b
Update Makefile.common
rowlandgeoff Sep 26, 2024
b323f1c
Update Dockerfile.tmpl
rowlandgeoff Sep 26, 2024
c3d4f5a
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
39d622f
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
4555565
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
f89c3a4
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
1d5526e
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
e279391
Update Makefile.common
rowlandgeoff Sep 27, 2024
082c4f7
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
c9d26b0
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
f7be9a3
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
0e07dc9
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
04a68f9
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
5a841fd
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
1f26f78
Update Makefile.common
rowlandgeoff Sep 27, 2024
8074083
Update Makefile.common
rowlandgeoff Sep 27, 2024
52afa62
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
eb05571
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
4901395
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
c444782
Update Makefile.common
rowlandgeoff Sep 27, 2024
6ab14a7
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
9543fe8
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
0211f16
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
f7bed96
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
f216c7c
Update Dockerfile.tmpl
rowlandgeoff Sep 27, 2024
e2fd8e2
Update Makefile.common
rowlandgeoff Sep 27, 2024
6b2b78d
Update Dockerfile.tmpl
rowlandgeoff Sep 30, 2024
d2c940f
Update Dockerfile.tmpl - use OSX_SDK
rowlandgeoff Oct 2, 2024
46617a2
Update go/darwin/Dockerfile.tmpl
rowlandgeoff Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ else
@echo 'Only available if running in the CI'
endif

# Requires login at google storage.
copy-sdks:
ifeq ($(CI),true)
@gcloud storage cp gs://ingest-buildkite-ci/sdks . --recursive
else
@echo 'Only available if running in the CI'
endif

push:
$(MAKE) atomic-push

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ It was added to golang-crossbuild due limitations of the build system.
The `main` image is the base image for the `amd64` architecture, it is build for Debian 7+.
It is used to cross compile for `linux/amd`, `linux/amd64`, `win/amd`, and `win/amd64`.
This Docker immage add two libraries to the `base` image, `libpcap` and `WpdPack` to be able to capture network packages on diferent OS.
Thes two libraries are precompiled and stores at https://storage.googleapis.com/obs-ci-cache.
Thes two libraries are precompiled and stored at https://storage.googleapis.com/ingest-buildkite-ci/sdks.

## go/darwin Docker image

Expand Down Expand Up @@ -379,5 +379,5 @@ XCODEDIR=osxcross/build/tmp_<X> ./tools/gen_sdk_package.sh
The SDK should be in the working directory.
The tmp dir can be safely deleted after this.

The SDKs should be uploaded into the `gs://obs-ci-cache` bucket on GCP (Google Cloud Platform).
This is accessible to authorized users in the `elastic-observability` project [here](https://console.cloud.google.com/storage/browser/obs-ci-cache).
The SDKs should be uploaded into the `gs://ingest-buildkite-ci/sdks` bucket on GCP (Google Cloud Platform).
This is accessible to authorized users in the `platform-ingest` project [here](https://console.cloud.google.com/storage/browser/ingest-buildkite-ci/sdks).
4 changes: 2 additions & 2 deletions go/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export DEBIAN_VERSION TAG_EXTENSION NPCAP_FILE

DOCKER_CMD := docker build

build: copy-npcap
build: copy-npcap copy-sdks
@echo ">> Building $(REPOSITORY)/$(NAME):$(VERSION)$(SUFFIX)$(TAG_EXTENSION)"
@go run $(SELF_DIR)/../template.go -t Dockerfile.tmpl -o Dockerfile
@$(DOCKER_CMD) -t "$(REPOSITORY)/$(NAME):$(VERSION)$(SUFFIX)$(TAG_EXTENSION)" \
Expand All @@ -25,7 +25,7 @@ build: copy-npcap
--build-arg BUILD_DATE="$(BUILD_DATE)" \
.

build-arm:
build-arm: copy-sdks
@echo $(SELF_DIR)
@echo ">> Building $(REPOSITORY)/$(NAME):$(VERSION)$(SUFFIX)$(TAG_EXTENSION)"
@go run $(SELF_DIR)/../template.go -t Dockerfile.tmpl -o Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions go/base-arm/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ RUN go mod init github.com/elastic/golang-crossbuild-$GOLANG_VERSION-arm \
&& go build -o /crossbuild /entrypoint.go \
&& rm -rf /go/* /root/.cache/* /entrypoint.go

RUN curl -sSLO https://storage.googleapis.com/obs-ci-cache/beats/libpcap-1.8.1.tar.gz \
&& mkdir /libpcap \
&& tar -xzf libpcap-1.8.1.tar.gz -C /libpcap \
COPY sdks/libpcap-1.8.1.tar.gz .
RUN mkdir /libpcap \
&& tar -xzf libpcap-1.8.1.tar.gz -C /libpcap \
&& cd /libpcap/libpcap-1.8.1 \
&& ./configure --enable-usb=no --enable-bluetooth=no --enable-dbus=no --host=aarch64-unknown-linux-gnu --with-pcap=linux \
&& make
Expand Down
9 changes: 4 additions & 5 deletions go/base/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ RUN go mod init github.com/elastic/golang-crossbuild-$GOLANG_VERSION \
&& CGO_ENABLED=0 go build -o /crossbuild /entrypoint.go \
&& rm -rf /go/* /root/.cache/* /entrypoint.go

RUN curl -sSLO https://storage.googleapis.com/obs-ci-cache/beats/libpcap-1.8.1.tar.gz \
&& echo "673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e libpcap-1.8.1.tar.gz" | sha256sum -c - \
&& mkdir /libpcap \
&& tar -xzf libpcap-1.8.1.tar.gz -C /libpcap \
&& rm libpcap-1.8.1.tar.gz
COPY sdks/libpcap-1.8.1.tar.gz .
RUN mkdir /libpcap \
&& tar -xzf libpcap-1.8.1.tar.gz -C /libpcap \
&& rm libpcap-1.8.1.tar.gz


ENV GOLANG_CROSSBUILD=1
Expand Down
6 changes: 3 additions & 3 deletions go/darwin/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ COPY --from=build-llvm-apple /osxcross.tar.gz /tmp/osxcross.tar.gz
RUN tar -xzf /tmp/osxcross.tar.gz -C / \
&& rm /tmp/osxcross.tar.gz
{{- else }}
ARG OSXCROSS_SDK_URL=https://storage.googleapis.com/obs-ci-cache/beats/MacOSX10.11.sdk.tar.xz
ARG OSXCROSS_PATH=/usr/osxcross
ARG OSXCROSS_REV=3034f7149716d815bc473d0a7b35d17e4cf175aa
ARG SDK_VERSION=10.11
ARG DARWIN_VERSION=15
ARG OSX_VERSION_MIN=10.10

COPY sdks/MacOSX10.11.sdk.tar.xz /tmp/osxcross/tarballs/MacOSX${SDK_VERSION}.sdk.tar.xz
RUN \
mkdir -p /tmp/osxcross && cd /tmp/osxcross \
cd /tmp/osxcross \
&& curl -sSL "https://codeload.github.com/tpoechtrager/osxcross/tar.gz/${OSXCROSS_REV}" \
| tar -C /tmp/osxcross --strip=1 -xzf - \
&& curl -sSLo "tarballs/MacOSX${SDK_VERSION}.sdk.tar.xz" "${OSXCROSS_SDK_URL}" \
&& UNATTENDED=yes ./build.sh >/dev/null \
&& mv target "${OSXCROSS_PATH}" \
&& rm -rf /tmp/osxcross "/usr/osxcross/SDK/MacOSX${SDK_VERSION}.sdk/usr/share/man"
Expand Down
4 changes: 1 addition & 3 deletions go/llvm-apple/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ RUN mkdir -p /tmp/llvm-project && cd /tmp/llvm-project \
ARG OSX_SDK="MacOSX11.3.sdk"
# Packaging the SDK on macOS https://github.com/tpoechtrager/osxcross#packaging-the-sdk
# alternative SDK already generated
#ARG OSXCROSS_SDK_URL=https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/${OSX_SDK}.tar.xz
ARG OSXCROSS_SDK_URL=https://storage.googleapis.com/obs-ci-cache/beats/${OSX_SDK}.tar.xz
ARG OSXCROSS_PATH=/usr/local/osxcross
ARG OSXCROSS_REV=062922bbb81ac52787d8e53fa4af190acb552ec7
ARG OSX_VERSION_MIN=10.10
Expand All @@ -61,11 +59,11 @@ RUN mkdir -p /tmp/osxcross
# https://raw.githubusercontent.com/crazy-max/docker-osxcross/main/patches/lcxx.patch
COPY lcxx.patch /tmp/osxcross/lcxx.patch

COPY sdks/MacOSX10.11.sdk.tar.xz tarballs/${OSX_SDK}.tar.xz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think 10.11 could be replaced with a similar arg ${SDK_VERSION}? However, it's not defined in the ARG section above, but it's already defined in go/darwin/Dockerfile.tmpl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good catch! It looks like through my copy/paste that I changed which SDK version was getting used here. Will fix.

RUN \
cd /tmp/osxcross \
&& curl -sSL "https://codeload.github.com/tpoechtrager/osxcross/tar.gz/${OSXCROSS_REV}" \
| tar -C /tmp/osxcross --strip=1 -xzf - \
&& curl -sSLo "tarballs/${OSX_SDK}.tar.xz" "${OSXCROSS_SDK_URL}" \
&& patch -p1 < lcxx.patch \
&& UNATTENDED=1 ENABLE_COMPILER_RT_INSTALL=1 OSX_VERSION_MIN=${OSX_VERSION_MIN} TARGET_DIR=${OSXCROSS_PATH} ./build.sh >/dev/null \
&& rm -rf "/usr/osxcross/SDK/${OSX_SDK}/usr/share/man" \
Expand Down
6 changes: 3 additions & 3 deletions go/main/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ RUN cd /libpcap/libpcap-1.8.1 \
&& ./configure --enable-usb=no --enable-bluetooth=no --enable-dbus=no \
&& make

RUN curl -sSLO https://storage.googleapis.com/obs-ci-cache/beats/WpdPack_4_1_2.zip \
&& mkdir -p /libpcap/win \
COPY sdks/WpdPack_4_1_2.zip .
RUN mkdir -p /libpcap/win \
&& echo "ea799cf2f26e4afb1892938070fd2b1ca37ce5cf75fec4349247df12b784edbd WpdPack_4_1_2.zip" | sha256sum -c - \
&& unzip WpdPack_4_1_2.zip -d /libpcap/win \
&& rm WpdPack_4_1_2.zip \
Expand All @@ -84,4 +84,4 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name=$IMAGE \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.schema-version="1.0"
org.label-schema.schema-version="1.0"