ROX-33124: Support roxie-based deployment with deploy script by mclasmeier · Pull Request #20731 · stackrox/stackrox · GitHub
Skip to content

ROX-33124: Support roxie-based deployment with deploy script#20731

Merged
mclasmeier merged 10 commits into
masterfrom
mc/roxie-deploy-script
Jun 24, 2026
Merged

ROX-33124: Support roxie-based deployment with deploy script#20731
mclasmeier merged 10 commits into
masterfrom
mc/roxie-deploy-script

Conversation

@mclasmeier

@mclasmeier mclasmeier commented May 20, 2026

Copy link
Copy Markdown
Contributor

Description

This is for those who have ./deploy/deploy.sh in their muscle memory.

The roxie flow is currently opt-in via USE_ROXIE_DEPLOY=true.

User-facing documentation

Not customer facing. Internal eng docs added.

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

n/a

How I validated my change

Tried deploying with ./deploy/deploy.sh and teardown with ./scripts/teardown.sh.

@openshift-ci

openshift-ci Bot commented May 20, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit b9b5b62. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.12.x-302-gb9b5b62037

@mclasmeier mclasmeier changed the title Support roxie-based deployments in deploy script ROX-33124: Support roxie-based deployment with deploy script May 20, 2026
@mclasmeier mclasmeier force-pushed the mc/roxie-deploy-script branch from b2910ef to 343ed76 Compare May 20, 2026 19:30
@mclasmeier mclasmeier marked this pull request as ready for review May 20, 2026 19:30

@davdhacs davdhacs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good. I don't like adding a ROXIE_VERSION.yaml to the root and I think the checksum is not needed, but those are my opinions and not a problem or blocking anything.

Comment thread deploy/deploy.sh Outdated
Comment thread ROXIE_VERSION.yaml Outdated
Comment thread scripts/roxie.sh
Comment thread scripts/roxie.sh Outdated
Comment thread scripts/roxie.sh Outdated

@porridge porridge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I also think the checksum verification is an overkill. It's not like we are worried about malicious entities injecting trojaned binaries into roxie releases, are we? IMHO built-in github.com TLS cert validation would be enough.

Comment thread ROXIE_VERSION.yaml Outdated
@mclasmeier

Copy link
Copy Markdown
Contributor Author

@porridge @davdhacs I have simplified and removed the checksums, relying on TLS entirely.

@mclasmeier mclasmeier requested review from davdhacs and porridge May 21, 2026 07:23
@mclasmeier mclasmeier force-pushed the mc/roxie-deploy-script branch from 1114993 to d04b960 Compare May 21, 2026 07:23

@porridge porridge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe add some retry flags to curl calls?

@davdhacs

davdhacs commented May 21, 2026

Copy link
Copy Markdown
Contributor

@porridge @davdhacs I have simplified and removed the checksums, relying on TLS entirely.

ty! and TLS includes a checksum on download, maybe safe enough? 😉

Also I really like that ROXIE_VERSION now matches the name and content-type of the other *_VERSION files. 📏

@davdhacs davdhacs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🥳

@mclasmeier mclasmeier force-pushed the mc/roxie-deploy-script branch from e002c27 to b88f5b0 Compare June 23, 2026 09:15
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added an opt-in roxie-based deployment flow using a config file for full-stack deployment.
    • Introduced a repo-local roxie launcher pinned to version 0.4.1.
    • Added a single-namespace teardown entrypoint.
  • Documentation
    • Updated deployment docs with roxie usage, configuration examples, and guidance for legacy deployment.
  • Bug Fixes
    • Improved deployment consistency by reducing unintended environment carryover during roxie runs.

Walkthrough

Adds roxie as a version-pinned deployment tool. scripts/roxie.sh installs the matching GitHub release binary from ROXIE_VERSION. deploy/deploy.sh can dispatch through roxie using deploy/roxie-config.yaml, scripts/teardown.sh delegates teardown to roxie, and deploy/README.md documents the new flow.

Changes

Roxie deployment integration

Layer / File(s) Summary
roxie binary installer
ROXIE_VERSION, scripts/roxie.sh
ROXIE_VERSION sets the pinned version (0.4.1). scripts/roxie.sh detects OS/arch, validates the installed binary version, downloads the matching GitHub Release asset when needed, and execs the installed binary with forwarded CLI arguments.
deploy and teardown roxie wiring
deploy/deploy.sh, deploy/roxie-config.yaml, scripts/teardown.sh
deploy.sh adds a USE_ROXIE_DEPLOY branch that routes to scripts/roxie.sh for shell or deploy --config deploy/roxie-config.yaml, then exits with that status; the legacy path prints a banner and continues. roxie-config.yaml sets pauseReconciliation: true and namespace: stackrox for central and securedCluster. teardown.sh delegates teardown --single-namespace to scripts/roxie.sh.
deployment README updates
deploy/README.md
Rewrites the README to document roxie as the recommended deployment method, the deploy.sh wrapper, YAML config vs environment variable behavior, an example config structure, MAIN_IMAGE_TAG handling, and a legacy flow section with an adjusted Env variables heading level.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: opt-in roxie-based deployment via deploy.sh.
Description check ✅ Passed The description covers the purpose, docs, and validation steps, with only the checklist items left unfilled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mc/roxie-deploy-script

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mclasmeier mclasmeier requested review from davdhacs and porridge June 23, 2026 09:17
@mclasmeier

mclasmeier commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@davdhacs & @porridge, after having completed several roxie features (stackrox/roxie#203, stackrox/roxie#204, stackrox/roxie#214), I am picking this PR up again and would like to get this merged.

I have polished some parts, fleshed out the README, added a roxie-config for persisting default deployment settings, rebased from current master.

Looking forward to some fresh review. :-)

@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown

@mclasmeier: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ocp-4-12-scanner-v4-install-tests 4b79520 link false /test ocp-4-12-scanner-v4-install-tests
ci/prow/ocp-4-22-qa-e2e-tests 4b79520 link false /test ocp-4-22-qa-e2e-tests
ci/prow/ocp-4-21-scanner-v4-install-tests 4b79520 link false /test ocp-4-21-scanner-v4-install-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Comment thread deploy/README.md Outdated
Co-authored-by: Marcin Owsiany <porridge@redhat.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/README.md`:
- Line 31: Fix the typo in the deployment README sentence by changing “habbits”
to “habits” in the text about deploy.sh invoking roxie; update the phrasing in
the affected README content only, keeping the rest of the sentence unchanged.
- Around line 35-37: The deployment example uses an absolute path that won’t
work as written, so update the command in the README example to use the relative
script path instead. Fix the shell snippet near the USE_ROXIE_DEPLOY example by
changing the deploy.sh invocation to match the other documented examples and
keep the command consistent with the deploy/deploy.sh usage shown elsewhere.

In `@scripts/roxie.sh`:
- Around line 37-51: The host_arch function only recognizes arm64, so Linux
ARM64 machines using uname -m = aarch64 are incorrectly rejected. Update
host_arch to map both aarch64 and arm64 to arm64, keeping the existing amd64
handling and the unsupported-architecture fallback unchanged.
- Around line 100-120: In gh_download_release, add a guard after the jq lookup
and before the asset download so an empty asset_id is treated as an explicit
“asset not found” failure instead of letting curl hit a blank releases/assets
URL. Use the existing gh_download_release function variables (repo, version,
asset_name, asset_id) to emit a clear error and stop execution when no matching
asset is returned.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 5a796a10-ed3f-40fc-8d14-43b9868d8e1b

📥 Commits

Reviewing files that changed from the base of the PR and between 860f073 and 607eeee.

📒 Files selected for processing (6)
  • ROXIE_VERSION
  • deploy/README.md
  • deploy/deploy.sh
  • deploy/roxie-config.yaml
  • scripts/roxie.sh
  • scripts/teardown.sh

Comment thread deploy/README.md Outdated
Comment thread deploy/README.md
Comment thread scripts/roxie.sh
Comment thread scripts/roxie.sh
@mclasmeier

Copy link
Copy Markdown
Contributor Author

@coderabbitai, please a fresh review, resolve all comments that are properly addressed.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== PR Review Comments ==="
gh pr view 20731 --repo stackrox/stackrox --json reviews,reviewRequests,comments | jq '.'

echo ""
echo "=== PR Review Threads ==="
gh api graphql -f query='
{
  repository(owner: "stackrox", name: "stackrox") {
    pullRequest(number: 20731) {
      reviewThreads(first: 50) {
        nodes {
          id
          isResolved
          isOutdated
          comments(first: 10) {
            nodes {
              author { login }
              body
              path
              line
              createdAt
            }
          }
        }
      }
    }
  }
}' | jq '.'

Length of output: 44881


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== scripts/roxie.sh ==="
cat -n scripts/roxie.sh

echo ""
echo "=== deploy/deploy.sh (new content) ==="
cat -n deploy/deploy.sh | head -100

echo ""
echo "=== ROXIE_VERSION ==="
cat ROXIE_VERSION

echo ""
echo "=== deploy/roxie-config.yaml ==="
cat deploy/roxie-config.yaml

echo ""
echo "=== scripts/teardown.sh ==="
cat scripts/teardown.sh

echo ""
echo "=== deploy/README.md ==="
cat deploy/README.md

Length of output: 19126



@mclasmeier All four comments from the previous round are properly addressed — the aarch64 fix, the asset_id guard, the typo, and the path correction are all in the current code. I've confirmed those threads are already resolved.

Here are two new observations from the fresh read:


scripts/roxie.sh, lines 74–76 — xattr -d on a curl download may always fail on macOS

if [[ "$os" == "darwin" ]]; then
    xattr -d com.apple.quarantine "$tmp_roxie"
fi

The macOS quarantine extended attribute (com.apple.quarantine) is set by GUI applications (Finder, Safari, etc.) via LSSetItemAttribute. Command-line curl does not set it. So when this path is hit, xattr -d will return exit code 1 because the attribute doesn't exist on the mktemp-created file. With set -euo pipefail at the top of the script, that non-zero exit aborts the entire installation.

Suggested fix — swallow the error when the attribute is absent:

if [[ "$os" == "darwin" ]]; then
    xattr -d com.apple.quarantine "$tmp_roxie" 2>/dev/null || true
fi

scripts/roxie.sh, line 116 — unusual GitHub API version date

-H "X-GitHub-Api-Version: 2026-03-10" \

The widely-documented stable GitHub REST API version is 2022-11-28. The date 2026-03-10 is after my knowledge cutoff — if this is intentional (e.g. a newly published version), that's fine, but it's worth a quick confirmation that this header value works correctly with the GitHub Releases API endpoint, since an unrecognised version value may cause unexpected behaviour.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/roxie.sh`:
- Around line 74-76: The macOS quarantine removal in the install flow can fail
when the attribute is missing, causing the script to exit under set -e. Update
the Darwin branch in roxie.sh so the xattr -d com.apple.quarantine call is
treated as best-effort and does not fail the installation if the metadata is
absent. Keep the change localized to the existing os == darwin check around
$tmp_roxie.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: ac0767a5-a8b7-4857-8663-74e56d662bb9

📥 Commits

Reviewing files that changed from the base of the PR and between 860f073 and e587878.

📒 Files selected for processing (6)
  • ROXIE_VERSION
  • deploy/README.md
  • deploy/deploy.sh
  • deploy/roxie-config.yaml
  • scripts/roxie.sh
  • scripts/teardown.sh

Comment thread scripts/roxie.sh Outdated
@mclasmeier

Copy link
Copy Markdown
Contributor Author

@coderabbitai, final review?
The API version works just fine, no need to complain about it.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/deploy.sh`:
- Around line 42-47: The deploy wrapper’s roxie config handling is inconsistent
because deploy/deploy.sh always injects a default --config before forwarding
arguments, so passing another --config creates duplicates. Update the deploy.sh
argument handling around the roxie.sh deploy call to either let the
caller-supplied --config override the default or only add the default when no
config was provided, and make the wrapper behavior match the roxie deploy
contract used by the examples.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: f35ca309-b654-4f33-a2e6-134326ba427d

📥 Commits

Reviewing files that changed from the base of the PR and between 860f073 and 8df455d.

📒 Files selected for processing (6)
  • ROXIE_VERSION
  • deploy/README.md
  • deploy/deploy.sh
  • deploy/roxie-config.yaml
  • scripts/roxie.sh
  • scripts/teardown.sh

Comment thread deploy/deploy.sh
@mclasmeier mclasmeier merged commit b9b5b62 into master Jun 24, 2026
98 of 107 checks passed
@mclasmeier mclasmeier deleted the mc/roxie-deploy-script branch June 24, 2026 16:34
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.

3 participants