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

chore(build): upgrade Go to 1.21.10, use custom builder instead of cross-builder #2819

Merged
merged 6 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ DOCKER_TAG="kapacitor-$(date +%Y%m%d)"
docker build --rm=false --platform linux/amd64 -f ./Dockerfile_build -t builder:"$DOCKER_TAG" .
docker tag builder:"$DOCKER_TAG" quay.io/influxdb/builder:"$DOCKER_TAG"

docker push quay.io/influxdb/builder:"$DOCKER_TAG"
#docker push quay.io/influxdb/builder:"$DOCKER_TAG"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be uncommented, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, my apologies. I tested the script without pushing the new Docker image. It is fixed.

32 changes: 32 additions & 0 deletions builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Builds

Our CI/CD pipelines utilize a Docker build image configured with support for GoLang, Rust, and Protobuf. The `circle.yml` file references this Docker container to handle building, testing, and creating release packages.

## Custom Builder

The necessity for a custom builder arises from compatibility issues between the `protobuf` library and Chronograf's Python UDFs. The `cross-builder` was updated to `protobuf` version `26.1` in [PR #669](https://github.com/influxdata/edge/pull/669), introducing breaking changes in the Python protobuf library. Specifically, [protobuf 5.26.1 on PyPI](https://pypi.org/project/protobuf/5.26.1/) does not support Python 2. Consequently, using the newest `cross-builder` would result in the loss of Python v2 support in UDFs.

## Updating Component Versions

To update component versions like GoLang, Rust, and Protobuf, modifications must be made in `Dockerfile_build`. After updates, a new Docker image needs to be built, published, and then utilized in CI.

### Step 1: Authenticate with Quay.io

```sh
export QUAY_CD_USER=<quay.io username>
export QUAY_CD_PASSWORD=<quay.io token>
```

### Step 2: Build and Push the New Docker Image to Quay

Navigate to the builder directory and execute the build script:

```sh
cd $KAPACITOR_REPOSITORY_ROOT/builder
./Dockerfile_build_push.sh
```

### Step 3: Update Scripts and CircleCI Configuration

1. Update the `cross-builder` tag in `.circleci/config.yml` to the new version.
2. Update the `quay.io/influxdb/builder` tag in `Dockerfile_build_ubuntu64` to reflect the new version.