Skip to content

Commit 2fbc7ab

Browse files
committed
update ci scripts
1 parent 4c93d9f commit 2fbc7ab

File tree

6 files changed

+23
-24
lines changed

6 files changed

+23
-24
lines changed

build/build.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
EPILOG = """
4646
From the root directory of the JAX repository, run
4747
`python build/build.py build --wheels=<list of JAX wheels>` to build JAX
48-
artifacts.
49-
50-
Multiple wheels can be built at the same time.
48+
artifacts.
49+
50+
Multiple wheels can be built with a single invocation of the CLI.
5151
E.g. python build/build.py build --wheels=jaxlib,jax-cuda-plugin
5252
5353
To update the requirements_lock.txt files, run
@@ -113,13 +113,13 @@ def add_global_arguments(parser: argparse.ArgumentParser):
113113
)
114114

115115
bazel_group.add_argument(
116-
"--bazel_build_options",
116+
"--bazel_options",
117117
action="append",
118118
default=[],
119119
help="""
120120
Additional build options to pass to Bazel, can be specified multiple
121121
times to pass multiple options.
122-
E.g. --bazel_build_options='--local_resources=HOST_CPUS'
122+
E.g. --bazel_options='--local_resources=HOST_CPUS'
123123
""",
124124
)
125125

@@ -369,11 +369,11 @@ async def main():
369369
# Requirements update subcommand execution
370370
if args.command == "requirements_update":
371371
requirements_command = copy.deepcopy(bazel_command_base)
372-
if args.bazel_build_options:
372+
if args.bazel_options:
373373
logging.debug(
374-
"Using additional build options: %s", args.bazel_build_options
374+
"Using additional build options: %s", args.bazel_options
375375
)
376-
for option in args.bazel_build_options:
376+
for option in args.bazel_options:
377377
requirements_command.append(option)
378378

379379
if args.nightly_update:
@@ -511,11 +511,11 @@ async def main():
511511

512512
# Append additional build options at the end to override any options set in
513513
# .bazelrc or above.
514-
if args.bazel_build_options:
514+
if args.bazel_options:
515515
logging.debug(
516-
"Additional Bazel build options: %s", args.bazel_build_options
516+
"Additional Bazel build options: %s", args.bazel_options
517517
)
518-
for option in args.bazel_build_options:
518+
for option in args.bazel_options:
519519
wheel_build_command.append(option)
520520

521521
if args.configure_only:

ci/build_artifacts.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
# ==============================================================================
16-
# Build JAX artifacts.
16+
# Build JAX artifacts.
1717
# Usage: ./ci/build_artifacts.sh "<artifact>"
1818
# Supported artifact values are: jax, jaxlib, jax-cuda-plugin, jax-cuda-pjrt
1919
# E.g: ./ci/build_artifacts.sh "jax" or ./ci/build_artifacts.sh "jaxlib"
@@ -46,10 +46,12 @@ if [[ $os =~ "msys_nt" ]] && [[ $arch == "x86_64" ]]; then
4646
fi
4747

4848
if [[ " ${allowed_artifacts[@]} " =~ " ${artifact} " ]]; then
49+
4950
# Build the jax artifact
5051
if [[ "$artifact" == "jax" ]]; then
5152
python -m build --outdir $JAXCI_OUTPUT_DIR
5253
else
54+
5355
# For bazel builds, use the "rbe_" config for Linux x86/Windows and "ci_" for other platforms
5456
bazelrc_config="${os}_${arch}"
5557
if ( [[ "$os" == "linux" ]] && [[ "$arch" == "x86_64" ]] ) || [[ "$os" == "windows" ]]; then
@@ -60,27 +62,28 @@ if [[ " ${allowed_artifacts[@]} " =~ " ${artifact} " ]]; then
6062

6163
# Build the jaxlib CPU artifact
6264
if [[ "$artifact" == "jaxlib" ]]; then
63-
python build/build.py build --wheels="jaxlib" --bazel_build_options=--config=$bazelrc_config --python_version=$JAXCI_HERMETIC_PYTHON_VERSION --verbose
65+
python build/build.py build --wheels="jaxlib" --bazel_options=--config="$bazelrc_config" --python_version=$JAXCI_HERMETIC_PYTHON_VERSION --verbose
6466
fi
6567

6668
# Build the jax-cuda-plugin artifact
6769
if [[ "$artifact" == "jax-cuda-plugin" ]]; then
68-
python build/build.py build --wheels="jax-cuda-plugin" --bazel_build_options=--config="${bazelrc_config}_cuda" --python_version=$JAXCI_HERMETIC_PYTHON_VERSION --verbose
70+
python build/build.py build --wheels="jax-cuda-plugin" --bazel_options=--config="${bazelrc_config}_cuda" --python_version=$JAXCI_HERMETIC_PYTHON_VERSION --verbose
6971
fi
7072

7173
# Build the jax-cuda-pjrt artifact
7274
if [[ "$artifact" == "jax-cuda-pjrt" ]]; then
73-
python build/build.py build --wheels="jax-cuda-pjrt" --bazel_build_options=--config="${bazelrc_config}_cuda" --verbose
75+
python build/build.py build --wheels="jax-cuda-pjrt" --bazel_options=--config="${bazelrc_config}_cuda" --verbose
7476
fi
7577

7678
# If building `jaxlib` or `jax-cuda-plugin` or `jax-cuda-pjrt` for Linux, we
7779
# run `auditwheel show` to verify manylinux compliance.
7880
if [[ "$os" == "linux" ]]; then
7981
./ci/utilities/run_auditwheel.sh
8082
fi
81-
fi
83+
84+
fi
8285

8386
else
84-
echo "Error: Invalid artifact '$artifact'. Allowed values are: ${allowed_artifacts[@]}"
87+
echo "Error: Invalid artifact: $artifact. Allowed values are: ${allowed_artifacts[@]}"
8588
exit 1
8689
fi

ci/envs/default.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export JAXCI_OUTPUT_DIR="$(pwd)/dist"
4141
# #############################################################################
4242

4343
# Docker specifc environment variables. Used by `run_docker_container.sh`
44-
export JAXCI_RUN_DOCKER_CONTAINER=${JAXCI_RUN_DOCKER_CONTAINER:-1}
4544
export JAXCI_DOCKER_WORK_DIR="/jax"
4645
export JAXCI_DOCKER_IMAGE=""
4746
export JAXCI_DOCKER_ARGS=""

ci/envs/docker.env

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ source ci/envs/default.env
2121
os=$(uname -s | awk '{print tolower($0)}')
2222
arch=$(uname -m)
2323

24-
export JAXCI_DOCKER_ARGS=""
25-
export JAXCI_DOCKER_IMAGE=""
26-
2724
# TODO: Set GPU Docker args and GPU Docker images
2825
# Linux x86 specifc settings
2926
if [[ $os == "linux" ]] && [[ $arch == "x86_64" ]]; then

ci/utilities/run_auditwheel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
# ==============================================================================
1616
#
17-
# Runs auditwheel to ensure manylinux compatibility.
17+
# Runs auditwheel to verify manylinux compatibility.
1818

1919
# Get a list of all the wheels in the output directory. Only look for wheels
2020
# that need to be verified for manylinux compliance.

ci/utilities/run_docker_container.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ if ! docker container inspect jax >/dev/null 2>&1 ; then
4949
# Start the container. `user_set_jaxci_envs` is read after `jax_ci_envs` to
5050
# allow the user to override any environment variables set by JAXCI_ENV_FILE.
5151
docker run $JAXCI_DOCKER_ARGS --name jax \
52-
-w /jax -itd --rm \
53-
-v "$JAXCI_JAX_GIT_DIR:/jax" \
52+
-w "$JAXCI_DOCKER_WORK_DIR" -itd --rm \
53+
-v "$JAXCI_JAX_GIT_DIR:$JAXCI_DOCKER_WORK_DIR" \
5454
"$JAXCI_DOCKER_IMAGE" \
5555
bash
5656

0 commit comments

Comments
 (0)