Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mongo/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o errexit
set -o verbose

if [[ "$OSTYPE" == "linux"* ]]; then
bash mongo/build_linux.sh "$1" "$2" "$3"
bash mongo/build_linux.sh "$1" "$2" "$3" "$4"
elif [[ "$OSTYPE" == "darwin"* ]]; then
bash mongo/build_macos.sh "$1" "$2" "$3"
else
Expand Down
10 changes: 8 additions & 2 deletions mongo/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
set -o errexit
set -o verbose

podman pull docker.io/redhat/ubi8:8.10-1184
podman run --mount type=bind,source=$PWD,destination=/tmp/bazel/,rw=true --workdir /tmp/bazel redhat/ubi8:8.10-1184 /tmp/bazel/mongo/container_build.sh "$1" "$2" "$3"
if [[ "$4" == "ubi7" ]]; then
docker pull registry.access.redhat.com/rhscl/devtoolset-7-toolchain-rhel7
docker run --user root --mount type=bind,source=$PWD,destination=/tmp/bazel/ --workdir /tmp/bazel registry.access.redhat.com/rhscl/devtoolset-7-toolchain-rhel7 /tmp/bazel/mongo/container_build_rhel7.sh "$1" "$2" "$3"
else
podman pull docker.io/redhat/ubi8:8.10-1184
podman run --mount type=bind,source=$PWD,destination=/tmp/bazel/,rw=true --workdir /tmp/bazel redhat/ubi8:8.10-1184 /tmp/bazel/mongo/container_build.sh "$1" "$2" "$3"
fi

"./$3" info
"./$3" --version
12 changes: 12 additions & 0 deletions mongo/container_build_rhel7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -o errexit
set -o verbose

yum install -y rh-python36 zip unzip
export CC=$(which gcc)
curl -L "$1" -o bazel_bootstrap
chmod +x ./bazel_bootstrap
scl enable rh-python36 './bazel_bootstrap build --compilation_mode=opt --subcommands --verbose_failures --stamp --embed_label=$2 //src:bazel'
cp bazel-bin/src/bazel "$3"
sha256sum -b "$3" > "${3}.sha256"
14 changes: 14 additions & 0 deletions mongo/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ functions:
working_dir: src
args:
- "mongo/update_expansions.sh"
- "${build_os|default}"
- "${version}"
- "${ext}"
- command: expansions.update
Expand Down Expand Up @@ -67,6 +68,7 @@ tasks:
- "${bazel_url}"
- "${bazel_version}"
- "${bazel_file_name}"
- "${ubi_version}"
- func: "upload binary"

- name: push
Expand Down Expand Up @@ -144,6 +146,18 @@ buildvariants:
- name: build
- name: push

- name: rhel7_x86_64
display_name: RHEL7 x86_64
run_on:
- ubuntu2204-large
expansions:
bazel_url: https://github.com/bazelbuild/bazel/releases/download/7.5.0/bazel-7.5.0-linux-x86_64
ubi_version: ubi7
build_os: rhel7
tasks:
- name: build
- name: push

- name: linux_s390x
display_name: Linux s390x
run_on:
Expand Down
7 changes: 5 additions & 2 deletions mongo/update_expansions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ set -o verbose

if [[ "$OSTYPE" == "linux"* ]]; then
os="linux"
if [[ "$1" == "rhel7" ]]; then
os="rhel7"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think bazelisk will be able to find this, does it do distro level specific access? Is there a way to control the exact URL?

Generally you give bazelisk a top level URL and it finds the binary to download based on version, os, and arch, so I don't think its going to know to look for rhel7 os

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I have a companion PR that changes bazelisk.py to determine linux distro

fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
os="darwin"
else
Expand All @@ -24,9 +27,9 @@ fi

bazel_short_git=$(git rev-parse --short HEAD)

bazel_version=$1-mongo_$bazel_short_git
bazel_version=$2-mongo_$bazel_short_git

bazel_file_name=bazel-$bazel_version-$os-${ARCH}${2}
bazel_file_name=bazel-$bazel_version-$os-${ARCH}${3}

echo "bazel_version: $bazel_version" > bazel_expansions.yml
echo "bazel_file_name: $bazel_file_name" >> bazel_expansions.yml