Skip to content

FEAT local Docker setup for running GUI or Jupyter#1357

Open
romanlutz wants to merge 10 commits intoAzure:mainfrom
romanlutz:romanlutz/docker_for_gui_or_notebooks
Open

FEAT local Docker setup for running GUI or Jupyter#1357
romanlutz wants to merge 10 commits intoAzure:mainfrom
romanlutz:romanlutz/docker_for_gui_or_notebooks

Conversation

@romanlutz
Copy link
Contributor

Description

We had an existing local Docker setup in the /docker directory that was very fragile and didn't work well. This PR improves this docker setup in a variety of ways:

  • It's now based on the devcontainer Dockerfile for minimal duplication
  • There are new helper scripts to build the image and run the Docker container
  • Orthogonal to Docker but related since we do the same build for the image: updated release instructions to include the built frontend
  • added github workflows for automated validation

Comment on lines +71 to +74
if result.returncode != 0:
print()
print("❌ Failed to build devcontainer base image")
return False
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this error be more descriptive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It still prints out the entire build info so it's not hiding any details 🙂

Comment on lines +65 to +71
# Production mode but no frontend found - warn but don't exit
# This allows API-only usage
print("⚠️ WARNING: Frontend not found!")
print(f" Expected location: {frontend_path}")
print(" The frontend must be built and included in the package.")
print(" Run: python build_scripts/prepare_package.py")
sys.exit(1)
print(" API endpoints will still work but the UI won't be available.")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand why this is a warning. Is API-only access not a desired behavior for production PyRIT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In "dev" mode you run the frontend separately with vite because it auto-updates when you make changes. In "prod" (i.e., release version) the frontend is bundled with the package so it really should have the frontend available otherwise something is wrong. That said, I anticipate that we'll have backend-only use cases at some point.


# Check if npm is available
try:
result = subprocess.run(["npm", "--version"], capture_output=True, text=True, check=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check npm versioning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but it can't hurt?

@romanlutz romanlutz force-pushed the romanlutz/docker_for_gui_or_notebooks branch from 9a60687 to 8006366 Compare February 6, 2026 21:50
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.

4 participants