File tree Expand file tree Collapse file tree 4 files changed +45
-9
lines changed
Expand file tree Collapse file tree 4 files changed +45
-9
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ RUN apt-get update && sudo apt-get install -y jq
99
1010RUN pip install uv
1111RUN echo "unset RAY_RUNTIME_ENV_HOOK" >> /home/ray/.bashrc
12+ # Disable usage stats by default for users who are sensitive to sharing usage.
13+ # Users are encouraged to enable if the wish.
14+ ENV RAY_USAGE_STATS_ENABLED=0
1215
1316FROM base AS hermetic
1417# hermetic creates a virtual environment with the default dependencies pre-installed for convenience
3841COPY --chown=ray --chmod=755 . /opt/reinforcer
3942RUN uv pip install --no-deps --editable /opt/reinforcer
4043
41- FROM base
44+ FROM base
Original file line number Diff line number Diff line change 1+ import os
12from nemo_reinforcer .package_info import (
23 __contact_emails__ ,
34 __contact_names__ ,
1112 __shortversion__ ,
1213 __version__ ,
1314)
15+
16+ os .environ ["RAY_USAGE_STATS_ENABLED" ] = "0"
Original file line number Diff line number Diff line change @@ -19,13 +19,6 @@ MOUNTS=$MOUNTS
1919COMMAND=${COMMAND:- } # This is a script relative to the SLURM_SUBMIT_DIR. If left empty, it will leave the cluster idle after it's brought up.
2020# #######################################################
2121
22- # #######################################################
23- # Global settings
24- # #######################################################
25- # Disable usage stats by default so that it's opt-in
26- export RAY_USAGE_STATS_ENABLED=${RAY_USAGE_STATS_ENABLED:- 0}
27- # #######################################################
28-
2922COMMON_SRUN_ARGS=" "
3023COMMON_SRUN_ARGS+=" --export=ALL"
3124COMMON_SRUN_ARGS+=" --no-container-mount-home"
@@ -70,6 +63,7 @@ head_cmd=$(cat <<EOF
7063env
7164cat <<EOFINNER | tee /launch-head.sh
7265ray start --head \
66+ --disable-usage-stats \
7367--num-cpus=0 \
7468--num-gpus=0 \
7569--node-ip-address="$head_node_ip " \
@@ -104,9 +98,11 @@ for ((i = 0; i < SLURM_JOB_NUM_NODES; i++)); do
10498env
10599cat <<EOFINNER | tee /launch-worker.sh
106100ray start --address "$ip_head " \
101+ --disable-usage-stats \
107102 --resources="{\"worker_units\": $gpus_per_node }" \
108103 --min-worker-port=$min_worker_port \
109- --max-worker-port=$max_worker_port --block
104+ --max-worker-port=$max_worker_port \
105+ --block
110106EOFINNER
111107
112108count=0
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # This module tests things outside of any package (e.g., things in the root __init__.py)
16+
17+ import pytest
18+ import os
19+
20+
21+ def test_usage_stats_disabled_by_default ():
22+ import nemo_reinforcer
23+
24+ assert os .environ ["RAY_USAGE_STATS_ENABLED" ] == "0" , (
25+ f"Our dockerfile, slurm submission script and default environment setting when importing reinforcer should all disable usage stats collection. This failing is not expected."
26+ )
27+
28+
29+ def test_usage_stats_disabled_in_tests ():
30+ import tests
31+
32+ assert os .environ ["RAY_USAGE_STATS_ENABLED" ] == "0" , (
33+ f"Our dockerfile, slurm submission script and default environment setting when importing reinforcer should all disable usage stats collection. This failing is not expected."
34+ )
You can’t perform that action at this time.
0 commit comments