Skip to content

[MacOS] Add arm64 support. #315

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ bazel_dep(name = "mbedtls", version = "3.6.0")
# Python
bazel_dep(name = "rules_python", version = "1.1.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.10", is_default = True)
python.toolchain(python_version = "3.11")
python.toolchain(python_version = "3.12")
python.toolchain(python_version = "3.10", ignore_root_user_error = True, is_default = True)
python.toolchain(python_version = "3.11", ignore_root_user_error = True)
python.toolchain(python_version = "3.12", ignore_root_user_error = True)

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
Expand Down
79 changes: 1 addition & 78 deletions src/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed src/assets/3rd-party.tgz
Binary file not shown.
Binary file added src/assets/bazelisk.tgz
Binary file not shown.
2 changes: 0 additions & 2 deletions src/deps/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
redis>=5.0.0,<6.0.0
pymongo>=4.5.0,<4.6.0
python-dotenv>=1.0.0,<2.0.0
hyperon-das-atomdb-cpp>=0.0.2

# Query Engine deps
hyperon-das-atomdb==0.8.10
requests>=2.31.0,<3.0.0
grpcio>=1.62.2,<2.0.0
google>=3.0.0,<4.0.0
Expand Down
30 changes: 3 additions & 27 deletions src/deps/requirements_lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,19 @@ google==3.0.0
# via -r deps/requirements.in
grpcio==1.69.0
# via -r deps/requirements.in
hyperon-das-atomdb==0.8.10
# via -r deps/requirements.in
hyperon-das-atomdb-cpp==0.0.2
# via
# -r deps/requirements.in
# hyperon-das-atomdb
idna==3.10
# via requests
mongomock==4.3.0
# via hyperon-das-atomdb
packaging==24.2
# via mongomock
protobuf==4.25.5
# via -r deps/requirements.in
pymongo==4.5.0
# via
# -r deps/requirements.in
# hyperon-das-atomdb
# via -r deps/requirements.in
python-dotenv==1.0.1
# via
# -r deps/requirements.in
# hyperon-das-atomdb
pytz==2024.2
# via mongomock
# via -r deps/requirements.in
redis==5.2.1
# via
# -r deps/requirements.in
# hyperon-das-atomdb
# via -r deps/requirements.in
requests==2.32.3
# via -r deps/requirements.in
sentinels==1.0.0
# via mongomock
soupsieve==2.6
# via beautifulsoup4
urllib3==2.3.0
# via requests

# The following packages are considered to be unsafe in a requirements file:
setuptools==70.3.0
# via hyperon-das-atomdb
18 changes: 8 additions & 10 deletions src/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,27 @@ ARG DATA_DIR="${BASE_DIR}/data"
ARG GRPC_DIR="${BASE_DIR}/grpc"
ARG PROTO_DIR="${BASE_DIR}/proto"
ARG BAZEL_DIR="${BASE_DIR}/bazel"
ARG THIRD_PARTY="${BASE_DIR}/3rd-party"

RUN mkdir -p \
${DAS_DIR} \
${DATA_DIR} \
${GRPC_DIR} \
${BAZEL_DIR} \
${PROTO_DIR} \
${THIRD_PARTY}
${PROTO_DIR}

RUN yes | apt update -y \
&& yes | apt install -y git build-essential curl protobuf-compiler python3 python3-pip cmake \
libevent-dev libssl-dev pkg-config \
&& yes | apt clean -y \
&& rm -rf /var/lib/apt/lists/*

COPY src/assets/3rd-party.tgz ${THIRD_PARTY}
RUN cd ${THIRD_PARTY} \
&& tar xzvf 3rd-party.tgz \
&& rm -f 3rd-party.tgz \
&& mkdir -p ${DAS_DIR}/src/3rd-party \
&& ln -s ${THIRD_PARTY} ${DAS_DIR}/src/3rd-party \
&& mv bazelisk ${BAZEL_DIR}
COPY src/assets/bazelisk.tgz /tmp
RUN ARCH=$(if [ "$(uname -m)" = "aarch64" ]; then echo "arm64"; else echo "amd64"; fi) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
RUN ARCH=$(if [ "$(uname -m)" = "aarch64" ]; then echo "arm64"; else echo "amd64"; fi) \
RUN ARCH=$([ "$(uname -m)" = "aarch64" ] && echo "arm64" || echo "amd64") \

&& cd /tmp \
&& tar xzvf bazelisk.tgz \
&& echo ARCH=${ARCH} \
&& mv bazelisk-${ARCH} ${BAZEL_DIR}/bazelisk \
&& rm -f bazelisk*

################################################################################
# To be removed when AtomDB is properly integrated
Expand Down
10 changes: 5 additions & 5 deletions src/hyperon_das/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ py_library(
"//hyperon_das/cache:cache_controller",
"//hyperon_das/query_engines:local_query_engine",
"//hyperon_das/query_engines:remote_query_engine",
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)

Expand All @@ -93,7 +93,7 @@ py_library(
":logger",
":type_alias",
":utils",
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
requirement("requests"),
],
)
Expand All @@ -104,7 +104,7 @@ py_library(
deps = [
"//hyperon_das/cache",
"//hyperon_das/cache:iterators",
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)

Expand All @@ -113,7 +113,7 @@ py_library(
srcs = ["context.py"],
deps = [
":utils",
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)

Expand Down Expand Up @@ -165,6 +165,6 @@ py_library(
name = "link_filters",
srcs = ["link_filters.py"],
deps = [
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)
2 changes: 1 addition & 1 deletion src/hyperon_das/cache/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ py_library(
"//hyperon_das:link_filters",
"//hyperon_das:utils",
"//hyperon_das/query_engines:query_engine_protocol",
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)
2 changes: 1 addition & 1 deletion src/hyperon_das/pattern_matcher/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ py_library(
name = "pattern_matcher",
srcs = [":py_files"],
deps = [
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)
6 changes: 3 additions & 3 deletions src/hyperon_das/query_engines/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ py_library(
"//hyperon_das:link_filters",
"//hyperon_das:type_alias",
"//hyperon_das:utils",
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)

Expand All @@ -29,7 +29,7 @@ py_library(
"//hyperon_das:utils",
"//hyperon_das/cache:cache_controller",
"//hyperon_das/cache:iterators",
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)

Expand All @@ -47,6 +47,6 @@ py_library(
"//hyperon_das:utils",
"//hyperon_das/cache:cache_controller",
"//hyperon_das/cache:iterators",
requirement("hyperon_das_atomdb"),
"//hyperon_das_atomdb",
],
)
6 changes: 3 additions & 3 deletions src/hyperon_das_atomdb/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ py_library(
":logger",
"//hyperon_das_atomdb/adapters",
"//hyperon_das_atomdb/utils",
requirement("hyperon_das_atomdb_cpp"),
"//hyperon_das_atomdb_cpp",
],
)

Expand Down Expand Up @@ -58,15 +58,15 @@ py_library(
name = "database",
srcs = ["database.py"],
deps = [
requirement("hyperon_das_atomdb_cpp"),
"//hyperon_das_atomdb_cpp",
],
)

py_library(
name = "exceptions",
srcs = ["exceptions.py"],
deps = [
requirement("hyperon_das_atomdb_cpp"),
"//hyperon_das_atomdb_cpp",
],
)

Expand Down
2 changes: 1 addition & 1 deletion src/hyperon_das_atomdb/adapters/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ py_library(
name = "ram_only",
srcs = ["ram_only.py"],
deps = [
requirement("hyperon_das_atomdb_cpp"),
"//hyperon_das_atomdb_cpp",
],
)

Expand Down
4 changes: 3 additions & 1 deletion src/hyperon_das_atomdb_cpp/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@pypi//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_library")
load("@nanobind_bazel//:build_defs.bzl", "nanobind_extension")
load("@rules_python//python:packaging.bzl", "py_wheel")

Expand Down Expand Up @@ -30,7 +32,7 @@ py_wheel(
description_content_type = "text/markdown",
description_file = "README.md",
distribution = "hyperon_das_atomdb_cpp",
platform = "manylinux_2_28_x86_64",
platform = "any",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will be a possible issue when publishing the module on PyPI.

python_requires = ">=3.10",
python_tag = "cp310",
stamp = 1,
Expand Down
2 changes: 1 addition & 1 deletion src/hyperon_das_node/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ py_wheel(
description_content_type = "text/markdown",
description_file = "README_hyperon_das_node.md",
distribution = "hyperon_das_node",
platform = "manylinux_2_28_x86_64",
platform = "any",
python_requires = ">=3.10",
python_tag = "cp310",
stamp = 1,
Expand Down
Loading
Loading