Skip to content
Closed
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
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ permissions:

env:
CARGO_TERM_COLOR: always
CARGO_TARGET_DIR: target

jobs:
build-and-test:
Expand All @@ -34,12 +35,15 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-

- name: Build
run: cargo build --workspace --all-targets

- name: Test
run: cargo test --workspace --all-targets

- name: Pre-build release binaries and codex for acceptance step
if: github.event_name == 'push'
run: |
cargo build --release -p rocm -p rocmd -p rocm-engine-pytorch -p rocm-engine-llama-cpp -p rocm-engine-lemonade -p rocm-engine-atom -p rocm-engine-vllm -p rocm-engine-sglang
bash scripts/build-vendored-codex.sh release

- name: Local no-fallback smoke
run: python scripts/smoke_local.py --skip-build

Expand All @@ -61,6 +65,7 @@ jobs:
run: python scripts/release_readiness.py --self-test

- name: Acceptance install lifecycle
if: github.event_name == 'push'
run: ./scripts/acceptance-install-upgrade-tui-uninstall.sh

windows-build-and-test:
Expand All @@ -70,10 +75,6 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- name: Build
shell: pwsh
run: cargo build --workspace --all-targets

- name: Test
shell: pwsh
run: cargo test --workspace --all-targets
Expand Down
18 changes: 18 additions & 0 deletions scripts/acceptance-install-upgrade-tui-uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,24 @@ expect_failure() {
echo "acceptance: build release binaries"
(cd "${REPO_ROOT}" && cargo build --release -p rocm -p rocmd -p rocm-engine-pytorch -p rocm-engine-llama-cpp -p rocm-engine-lemonade -p rocm-engine-atom -p rocm-engine-vllm -p rocm-engine-sglang)

# Resolve the prebuilt Codex binary location so packaging can skip a second
# full compilation of the large vendored Codex workspace. The binary is built
# once during the main CI build step (which uses the same CARGO_TARGET_DIR)
# and reused here. If the binary is not present (e.g. first local run) the
# packaging script will compile it normally.
CODEX_CANDIDATE="${REPO_ROOT}/target/release/rocm-codex"
if [[ -n "${CARGO_TARGET_DIR:-}" ]]; then
if [[ "${CARGO_TARGET_DIR}" = /* ]]; then
CODEX_CANDIDATE="${CARGO_TARGET_DIR}/release/rocm-codex"
else
CODEX_CANDIDATE="${REPO_ROOT}/${CARGO_TARGET_DIR}/release/rocm-codex"
fi
fi
if [[ -x "${CODEX_CANDIDATE}" ]]; then
export ROCM_CODEX_PREBUILT_BINARY="${CODEX_CANDIDATE}"
echo "acceptance: reusing prebuilt rocm-codex at ${CODEX_CANDIDATE}"
fi

echo "acceptance: generate signing key"
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out "${SIGNING_PRIVATE_KEY}" >/dev/null 2>&1 \
|| fail "failed to generate acceptance signing private key"
Expand Down
39 changes: 39 additions & 0 deletions scripts/build-vendored-codex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,45 @@ need_cmd() {

need_cmd cargo

# ---------------------------------------------------------------------------
# Prebuilt binary fast path.
#
# Set ROCM_CODEX_PREBUILT_BINARY to an absolute path of an already-compiled
# `codex` binary to skip the full Cargo build. The binary is still installed
# into the same ROCM_PROFILE_DIR location as the compiled one, so the rest of
# the packaging pipeline is unaffected.
#
# In CI this lets the acceptance step reuse the binary that was produced by the
# earlier release build step instead of compiling the large vendored Codex
# workspace a second time.
# ---------------------------------------------------------------------------
if [[ -n "${ROCM_CODEX_PREBUILT_BINARY:-}" ]]; then
if [[ ! -f "${ROCM_CODEX_PREBUILT_BINARY}" ]]; then
echo "ROCM_CODEX_PREBUILT_BINARY is set but file not found: ${ROCM_CODEX_PREBUILT_BINARY}" >&2
exit 1
fi
if [[ -n "${CARGO_TARGET_DIR:-}" ]]; then
if [[ "${CARGO_TARGET_DIR}" = /* ]]; then
ROCM_TARGET_DIR="${CARGO_TARGET_DIR}"
else
ROCM_TARGET_DIR="${REPO_ROOT}/${CARGO_TARGET_DIR}"
fi
else
ROCM_TARGET_DIR="${REPO_ROOT}/target"
fi
if [[ -n "${TARGET_TRIPLE}" ]]; then
ROCM_PROFILE_DIR="${ROCM_TARGET_DIR}/${TARGET_TRIPLE}/${PROFILE}"
else
ROCM_PROFILE_DIR="${ROCM_TARGET_DIR}/${PROFILE}"
fi
mkdir -p "${ROCM_PROFILE_DIR}"
install -m 0755 "${ROCM_CODEX_PREBUILT_BINARY}" "${ROCM_PROFILE_DIR}/rocm-codex"
echo "using prebuilt vendored Codex binary"
echo " source: ${ROCM_CODEX_PREBUILT_BINARY}"
echo " installed wrapper binary: ${ROCM_PROFILE_DIR}/rocm-codex"
exit 0
fi

if [[ "$(uname -s)" == "Linux" ]]; then
need_cmd pkg-config
LOCAL_DEV_SYSROOT="${ROCM_CLI_PORTABLE_BUILD_DEPS_ROOT:-${REPO_ROOT}/.rocm-work/tools/wsl-build-deps}/root"
Expand Down
Loading