Skip to content

Add podman support and registry login to container scripts#3497

Open
mcosgriff wants to merge 7 commits into
mainfrom
3496-add-ability-to-check-if-logged-into-container-registry
Open

Add podman support and registry login to container scripts#3497
mcosgriff wants to merge 7 commits into
mainfrom
3496-add-ability-to-check-if-logged-into-container-registry

Conversation

@mcosgriff

@mcosgriff mcosgriff commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace hard-coded docker / docker compose references with cached runtime detection that supports both Docker and Podman (including podman compose and podman-compose variants)
  • Add registry_login before run, run-ubi, and build commands to avoid 403 errors when pulling images — logs into OPENC3_REGISTRY (core) and OPENC3_ENTERPRISE_REGISTRY (enterprise) using interactive credentials
  • Apply matching logic to both openc3.sh and openc3.bat

Changes

openc3.sh

  • detect_container_runtime() — cached function that finds docker or podman
  • detect_compose_cmd() — cached function that finds the compose command ( compose or -compose), exports DOCKER_COMPOSE_COMMAND for backward compatibility
  • registry_login() — sources .env, calls login on configured registries (prompts for credentials if not already authenticated)
  • All docker and ${DOCKER_COMPOSE_COMMAND} references replaced with ${CONTAINER_CMD} and ${CONTAINER_COMPOSE_CMD}

openc3.bat

  • Equivalent runtime and compose detection using where command
  • :registry_login subroutine with matching logic
  • All docker compose references replaced with !CONTAINER_COMPOSE_CMD!

scripts/linux/openc3_test.sh

  • Uses exported DOCKER_COMPOSE_COMMAND from parent if available, otherwise detects runtime with podman support

scripts/linux/openc3_util.sh

  • Fixed $@ → "$@" quoting in podman wrapper for proper argument handling

openc3/lib/openc3/utilities/store_queued.rb

  • Wrapped the process_queue() call in shutdown with a rescue block. This fixes the CI failure where all tests pass but the at_exit hook raises Redis::CannotConnectError when Redis is unavailable during process shutdown, causing exit code 1.

Closes #3497

…ipts

Replace hard-coded docker references with cached runtime detection that
supports both docker and podman, including their compose variants. Add registry_login to run/build commands to avoid 403 errors when pulling images. Matching logic applied to both sh and bat scripts.

Co-Authored-By: Claude noreply@anthropic.com
@mcosgriff mcosgriff linked an issue Jun 22, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.29%. Comparing base (2322dbf) to head (0a2df55).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3497      +/-   ##
==========================================
- Coverage   79.32%   79.29%   -0.04%     
==========================================
  Files         670      689      +19     
  Lines       56846    57334     +488     
  Branches      728      728              
==========================================
+ Hits        45095    45463     +368     
- Misses      11673    11793     +120     
  Partials       78       78              
Flag Coverage Δ
python 80.39% <ø> (-0.01%) ⬇️
ruby-api 81.13% <ø> (-0.65%) ⬇️
ruby-backend 83.13% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Use modern $() syntax instead of backticks for pwd in cli and cliroot volume mount arguments for consistency and readability.
@mcosgriff mcosgriff self-assigned this Jun 26, 2026
Add registry authentication checks to avoid overwriting valid stored credentials with stale environment variables. In openc3_build_ubi.sh, use docker manifest inspect to verify access before attempting login. In openc3.sh, check Docker/Podman config files for existing credentials. Rescue Redis connection errors in StoreQueued shutdown to prevent CI test failures when Redis is unavailable during process exit.
Comment thread openc3/lib/openc3/utilities/store_queued.rb Fixed
…ariable'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@mcosgriff mcosgriff requested review from clayandgen and jmthomas June 26, 2026 19:44
@mcosgriff mcosgriff marked this pull request as ready for review June 26, 2026 19:58
jmthomas
jmthomas previously approved these changes Jun 27, 2026

@jmthomas jmthomas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I made equivalent change to store_queued.py. This change forced me to login to docker.io during the build but I think that's ok. I previously was building fine without this login.

Comment thread openc3/lib/openc3/utilities/store_queued.rb
Comment thread openc3/python/openc3/utilities/store_queued.py Fixed
@jmthomas jmthomas self-requested a review June 27, 2026 18:29
@sonarqubecloud

Copy link
Copy Markdown

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.

Add ability to check if logged into container registry

2 participants