Skip to content

Allow traefik to route to the as-named tools bucket#2871

Merged
jmthomas merged 5 commits intomainfrom
deploy
Feb 26, 2026
Merged

Allow traefik to route to the as-named tools bucket#2871
jmthomas merged 5 commits intomainfrom
deploy

Conversation

@jmthomas
Copy link
Copy Markdown
Member

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.82%. Comparing base (2d83173) to head (f600b75).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2871      +/-   ##
==========================================
- Coverage   78.83%   78.82%   -0.01%     
==========================================
  Files         667      667              
  Lines       54533    54543      +10     
  Branches      728      731       +3     
==========================================
+ Hits        42990    42993       +3     
- Misses      11465    11470       +5     
- Partials       78       80       +2     
Flag Coverage Δ
python 80.83% <ø> (-0.02%) ⬇️
ruby-api 80.24% <100.00%> (+0.02%) ⬆️
ruby-backend 82.15% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

else
result.each do |tuples|
entry = { "__type" => "items" }
entry = { "__type" => "ITEMS" }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was a regression that I caught porting the OpenMCT plugin

# Required for Traefik v3.6.4+ which blocks them by default
allowEncodedSlash: true
ping:
entryPoint: "web"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Matching entry in Enterprise

changeTools:
replacePathRegex:
regex: "^/([^/]*)/(.*)"
replacement: '/{{env "OPENC3_TOOLS_BUCKET"}}/$2'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You can use these types of go templates in traefik

passHostHeader: false
servers:
- url: "http://openc3-buckets:9000"
- url: '{{ env "OPENC3_BUCKET_URL" }}'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This allows you to set the S3 url and seamlessly transition to real buckets

unless validate_only
bucket = Bucket.getClient()
bucket.ensure_public(ENV['OPENC3_TOOLS_BUCKET'])
end
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's weird that the widget_model was applying the policy. This should be done in init now.

Comment thread openc3/Dockerfile
&& chmod -R 777 /openc3/

ENV HOME=/openc3
ENV XDG_CACHE_HOME=/tmp/.cache
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Someone had an issue with a stack trace as follows:

23T18:11:59.332821Z","level":"ERROR","container_name":"2c0d7c5fb5a9","message":"Error undeploying plugin model openc3-cosmos-nowl-0.0.154.gem__0 in scope DEFAULT due to: EACCES : Permission denied @ dir_s_mkdir - /openc3/.cache/gem\n/usr/lib/ruby/3.4.0/fileutils.rb:403:in 'Dir.mkdir'\n/usr/lib/ruby/3.4.0/fileutils.rb:403:in 'FileUtils.fu_mkdir'\n/usr/lib/ruby/3.4.0/fileutils.rb:381:in 'block (2 levels) in FileUtils.mkdir_p'\n/usr/lib/ruby/3.4.0/fileutils.rb:379:in 'Array#reverse_each'\n/usr/lib/ruby/3.4.0/fileutils.rb:379:in 'block in FileUtils.mkdir_p'\n/usr/lib/ruby/3.4.0/fileutils.rb:371:in 'Array#each'\n/usr/lib/ruby/3.4.0/fileutils.rb:371:in 'FileUtils.mkdir_p'\n/usr/local/lib/site_ruby/3.4.0/rubygems/source.rb:136:in 'Gem::Source#fetch_spec'\n/usr/local/lib/site_ruby/3.4.0/rubygems/resolver/api_specification.rb:93:in 'Gem::Resolver::APISpecification#spec'\n/usr/local/lib/site_ruby/3.4.0/rubygems/resolver/activation_request.rb:91:in 'Gem::Resolver::ActivationRequest#full_spec'\n/usr/local/lib/site_ruby/3.4.0/rubygems/resolver/activation_request.rb:106:in 'Gem::Resolver::ActivationRequest#installed?'\n/usr/local/lib/site_ruby/3.4.0/rubygems/request_set.rb:174:in 'block (2 levels) in Gem::RequestSet#install'","type":"log"}

Permission denied in Dir.mkdir at /openc3/.cache/gem. Supposedly this sets the cache dir to /tmp which everyone has access to.

Note I was not able to reproduce this error.

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.

This will probably need to change when we move to readonly containers.

Comment thread .env
# Change to arn:aws-us-gov for deploying to AWS Gov Cloud
OPENC3_AWS_ARN_PREFIX=arn:aws
# Update based on deployed region
AWS_REGION=us-east-1
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is also required if using real S3

Comment thread .env
MIGRATION_FILES_BEFORE_PAUSE=10
# Seconds to pause after processing MIGRATION_FILES_BEFORE_PAUSE files
MIGRATION_PAUSE_SECONDS=30

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dead code .. these are now part of the tsdb migration plugin

Comment thread openc3/bin/openc3cli
client.ensure_public(ENV['OPENC3_TOOLS_BUCKET'])
end
# Always ensure the scriptrunner policy is in place since it is required for script execution
client.ensure_scriptrunner_policy(ENV['OPENC3_CONFIG_BUCKET'], ENV['OPENC3_LOGS_BUCKET'])
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This wasn't happening in cloud deployments

@jmthomas jmthomas requested a review from clayandgen February 25, 2026 23:17
Comment thread compose.yaml Outdated
REQUESTS_CA_BUNDLE: "/devel/cacert.pem"
NODE_EXTRA_CA_CERTS: "/devel/cacert.pem"
env_file:
- .env
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.

Only pass required environment variables not all of .env.

@sonarqubecloud
Copy link
Copy Markdown

@jmthomas jmthomas merged commit 6aac97e into main Feb 26, 2026
50 of 51 checks passed
@jmthomas jmthomas deleted the deploy branch February 26, 2026 18:27
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