Skip to content

SIM_LOG_DIR points to "${SCRIPT_DIR:?}"/log rather then /etc/astra-sim which requires sudo priviledges.#255

Open
marcodamico wants to merge 1 commit intoaliyun:masterfrom
marcodamico:SIM_LOG_DIR_fix
Open

SIM_LOG_DIR points to "${SCRIPT_DIR:?}"/log rather then /etc/astra-sim which requires sudo priviledges.#255
marcodamico wants to merge 1 commit intoaliyun:masterfrom
marcodamico:SIM_LOG_DIR_fix

Conversation

@marcodamico
Copy link
Copy Markdown

This solves #254

@tianhao909 tianhao909 requested a review from Copilot March 31, 2026 13:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #254 by changing SIM_LOG_DIR in Astra-Sim build scripts from a system-level path (/etc/astra-sim) to a repo-local path ("${SCRIPT_DIR:?}"/log), avoiding the need for sudo during directory creation.

Changes:

  • Update SIM_LOG_DIR in the top-level astra-sim-alibabacloud/build.sh to use a writable repo-local log/ directory.
  • Update SIM_LOG_DIR in astra-sim-alibabacloud/build/astra_ns3/build.sh to use a script-local log/ directory.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
astra-sim-alibabacloud/build/astra_ns3/build.sh Changes SIM_LOG_DIR away from /etc/astra-sim to avoid sudo-required paths in the ns3 build script.
astra-sim-alibabacloud/build.sh Changes SIM_LOG_DIR away from /etc/astra-sim so the build creates log/input/result directories in a user-writable location.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

NS3_DIR="${SCRIPT_DIR:?}"/../../extern/network_backend/ns3-interface
NS3_APPLICATION="${NS3_DIR:?}"/simulation/src/applications/
SIM_LOG_DIR=/etc/astra-sim
SIM_LOG_DIR="${SCRIPT_DIR:?}"/log
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

SIM_LOG_DIR is now set relative to this sub-build script ("${SCRIPT_DIR}"/log), which differs from the top-level astra-sim-alibabacloud/build.sh log directory (repo-root/log). Even though SIM_LOG_DIR is currently unused here, this mismatch can cause confusion or inconsistent behavior if the commented-out copy-to-log logic is re-enabled; consider pointing both scripts at the same repo-level log directory (e.g., by computing it relative to the repo root) or passing it in from the parent script.

Copilot uses AI. Check for mistakes.
SIMAI_PHY_BUILD_DIR="${SCRIPT_DIR:?}"/build/simai_phy
SIMAI_ANALYTICAL_BUILD_DIR="${SCRIPT_DIR:?}"/build/simai_analytical
SIM_LOG_DIR=/etc/astra-sim
SIM_LOG_DIR="${SCRIPT_DIR:?}"/log
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This updates SIM_LOG_DIR to a writable repo-local path and the script creates directories under it, but parts of the simulator still appear to hardcode /etc/astra-sim for logs/results (e.g., MockNcclLog.h and SimAiMain.cc). If the goal is to avoid sudo requirements beyond just the build step, consider wiring SIM_LOG_DIR through to runtime (env/config/compile-time define) and aligning those hardcoded paths with this setting.

Suggested change
SIM_LOG_DIR="${SCRIPT_DIR:?}"/log
SIM_LOG_DIR="${SCRIPT_DIR:?}"/log
export SIM_LOG_DIR

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants