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 .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ matrix:
- ubuntu2204
- macos_arm64
bazel:
- 7.x
- 8.x
tasks:
verify_targets:
name: Verify build and test targets
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_and_publish_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-14]
os: [ubuntu-22.04, ubuntu-22.04-arm, macos-15]

env:
USE_BAZEL_VERSION: "7.4.1"
USE_BAZEL_VERSION: "8.8.2"
steps:
- name: Set up Bazel
uses: bazel-contrib/setup-bazel@4fd964a13a440a8aeb0be47350db2fc640f19ca8 # 0.15.0
Expand All @@ -54,7 +54,7 @@ jobs:
export PYTHON_VERSION=${{ matrix.python-version }}
export PYTHON_MAJOR_VERSION=$(echo $PYTHON_VERSION | cut -d. -f1)
export PYTHON_MINOR_VERSION=$(echo $PYTHON_VERSION | cut -d. -f2)
export BAZEL_VERSION="7.4.1"
export BAZEL_VERSION="8.8.2"
export OUTPUT_DIR="/tmp/array_record"
export SOURCE_DIR="/tmp/array_record"
. "${SOURCE_DIR}"'/oss/runner_common.sh'
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
path: dist/
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
attestations: false
verbose: true
16 changes: 8 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ module(
repo_name = "com_google_array_record",
)

bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "rules_cc", version = "0.2.22")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_python", version = "1.6.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "protobuf", version = "31.1")
bazel_dep(name = "rules_python", version = "2.4.1")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "protobuf", version = "35.1")
bazel_dep(name = "boringssl", version = "0.20260413.0")

bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "abseil-cpp", version = "20260107.1")
bazel_dep(name = "googletest", version = "1.18.0")
bazel_dep(name = "abseil-cpp", version = "20260817.0")
bazel_dep(name = "abseil-py", version = "2.1.0")
bazel_dep(name = "eigen", version = "3.4.0.bcr.3")
bazel_dep(name = "riegeli", version = "0.0.0-20250717-5b2e77e")
bazel_dep(name = "pybind11_bazel", version = "2.13.6")
bazel_dep(name = "riegeli", version = "0.0.0-20261117-64d553d")
bazel_dep(name = "pybind11_bazel", version = "3.0.0")

SUPPORTED_PYTHON_VERSIONS = [
"3.11",
Expand Down
2 changes: 1 addition & 1 deletion cpp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ cc_library(
"@riegeli//riegeli/base:initializer",
"@riegeli//riegeli/base:object",
"@riegeli//riegeli/base:status",
"@riegeli//riegeli/base:types",
"@riegeli//riegeli/bytes:writer",
"@riegeli//riegeli/chunk_encoding:chunk",
"@riegeli//riegeli/chunk_encoding:constants",
"@riegeli//riegeli/records:chunk_writer",
"@riegeli//riegeli/records:record_writer",
],
)

Expand Down
6 changes: 3 additions & 3 deletions cpp/sequenced_chunk_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ limitations under the License.
#include "absl/strings/str_format.h"
#include "absl/synchronization/mutex.h"
#include "riegeli/base/status.h"
#include "riegeli/base/types.h"
#include "riegeli/chunk_encoding/chunk.h"
#include "riegeli/chunk_encoding/constants.h"
#include "riegeli/records/chunk_writer.h"
#include "riegeli/records/record_writer.h"

namespace array_record {

Expand Down Expand Up @@ -118,8 +118,8 @@ void SequencedChunkWriterBase::TrySubmitFirstFutureChunk(
return;
}
if (pad_to_block_boundary_) {
if (!chunk_writer->PadToBlockBoundary())
{
if (!chunk_writer->WritePadding(
riegeli::RecordWriterBase::kImplicitPadding)) {
Fail(riegeli::Annotate(
chunk_writer->status(),
absl::StrFormat("Could not pad boundary for chunk: %d",
Expand Down
6 changes: 4 additions & 2 deletions oss/build_whl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ function main() {
cp LICENSE "${TMPDIR}"
rsync -avm -L --exclude="bazel-*/" . "${TMPDIR}/array_record"
rsync -avm -L --include="*.so" --include="*_pb2.py" \
--exclude="*.runfiles" --exclude="*_obj" --include="*/" --exclude="*" \
--exclude="*.runfiles" --exclude="*.venv" --exclude="*_obj" \
--include="*/" --exclude="*" \
bazel-bin/cpp "${TMPDIR}/array_record"
rsync -avm -L --include="*.so" --include="*_pb2.py" \
--exclude="*.runfiles" --exclude="*_obj" --include="*/" --exclude="*" \
--exclude="*.runfiles" --exclude="*.venv" --exclude="*_obj" \
--include="*/" --exclude="*" \
bazel-bin/python "${TMPDIR}/array_record"

pushd ${TMPDIR}
Expand Down
2 changes: 1 addition & 1 deletion oss/runner_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ build_and_test_array_record() {
else
# Automatically decide which platform to build for by checking on which
# platform this runs.
AUDITWHEEL_PLATFORM='manylinux2014_'"$(uname -m)"
AUDITWHEEL_PLATFORM='manylinux_2_28_'"$(uname -m)"
docker rmi -f array_record:${PYTHON_VERSION}
docker rm -f array_record
DOCKER_BUILDKIT=1 docker build --progress=plain --no-cache \
Expand Down
28 changes: 27 additions & 1 deletion python/array_record_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
#include <stddef.h>
#include <stdint.h>

#include <cstdlib>
#include <stdexcept>
#include <string>
#include <utility>
Expand All @@ -40,6 +41,31 @@ limitations under the License.

namespace py = pybind11;

namespace {

// Returns the GCS client used by `ArrayRecordReader` for `gs://` paths.
//
// When a storage emulator is configured, google-cloud-cpp 3.x still uses
// Application Default Credentials, even though `Client()` documents otherwise.
// Outside of GCE they look up the metadata server and the request is retried
// until the retry policy expires, so the reader appears to hang. Use insecure
// credentials, as emulators expect.
//
// TODO(zhixiangli): Use `google::cloud::storage::Client()` again once
// https://github.com/googleapis/google-cloud-cpp/issues/16678 is fixed in the
// google-cloud-cpp release used by the OSS build.
google::cloud::storage::Client MakeGcsClient() {
google::cloud::Options options;
if (std::getenv("CLOUD_STORAGE_EMULATOR_ENDPOINT") != nullptr ||
std::getenv("CLOUD_STORAGE_TESTBENCH_ENDPOINT") != nullptr) {
options.set<google::cloud::UnifiedCredentialsOption>(
google::cloud::MakeInsecureCredentials());
}
return google::cloud::storage::Client(std::move(options));
}

} // namespace

PYBIND11_MODULE(array_record_module, m) {
using array_record::ArrayRecordReaderBase;
using array_record::ArrayRecordWriterBase;
Expand Down Expand Up @@ -104,7 +130,7 @@ PYBIND11_MODULE(array_record_module, m) {
status_or_option->footer_prefetch_bytes();
return new array_record::ArrayRecordReader(
riegeli::Maker<riegeli::GcsReader>(
google::cloud::storage::Client(),
MakeGcsClient(),
riegeli::GcsObject(path), std::move(gcs_reader_options),
footer_prefetch_bytes > 0
? google::cloud::storage::ReadLast(
Expand Down
Loading