Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof of concept for enabling inferno services start anywhere. #582

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arscan
Copy link
Contributor

@arscan arscan commented Dec 20, 2024

Proof of concept for discussion.

I believe that if we have command line tools that require an 'inferno environment' (that is, very specific services up and running for the command to work), then we must have a way to create the environment from any directory. Cloning "inferno core" and making users put files they want to analyze in that directory makes no sense to me.

This is just a quick and dirty proof of concept that it is not particularly hard for us to ship a docker-compose file in the gem. I can't say for certain there aren't edge cases to deal with, but in my environment this seems to work just fine (unless i messed something up and didn't actually use it how I thought I did :) )

I believe it works though... I used both bin/inferno services start from the inferno_core directory, as well as tried packaging it up as a gem, installing it, and then running inferno services start in other directories (then, going back to inferno_core, starting the web app, and running it to show that the services are fully up). I use rvm so the gems are installed to /Users/rscanlon/.rvm/gems/ruby-3.1.2, but didn't try with other ruby version managers. I admit that there might be more complexities here, and I didn't really try everything, but I don't see what might be a problem here.

I optimized here to keep the touch as small as possible, but also there are plenty of opportunities to clean this all up. Do we really need to maintain the old validator and the validator UI? Do we really need to persist redis? We should consider have the gem create a ~/.inferno/ subdirectory where we start storing stuff when not running within a Test Kit (I don't think redis matters, but the validator needs a cache to avoid rate limiting).

Buttom line to me though: the evaluator will be fairly hostile to use once we get that into the CLI if we also have to say "now, clone inferno_core or some other test kit, go to that directory, copy your files to be analyzed there, etc etc". So we need this type of thing.

inferno services start
inferno evaluate --ig:xyz *.json

# at this point, might as well just add something like this as a way to quickly validate one or more files
inferno validate --ig:xyz --profile:http://blah *.json

inferno services stop

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.29%. Comparing base (2bb20b5) to head (d590f28).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #582   +/-   ##
=======================================
  Coverage   84.29%   84.29%           
=======================================
  Files         274      274           
  Lines       11663    11663           
  Branches     1302     1302           
=======================================
  Hits         9831     9831           
  Misses       1822     1822           
  Partials       10       10           
Flag Coverage Δ
backend 92.61% <ø> (ø)
frontend 79.20% <ø> (ø)

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.

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.

1 participant