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

Move pixldc commands into PIXL CLI #411

Merged
merged 30 commits into from
Jun 19, 2024
Merged

Conversation

milanmlft
Copy link
Member

@milanmlft milanmlft commented Jun 13, 2024

Fixes #392

  • **Add pixl dc CLI command as a wrapper around docker compose
  • Remove pixldc
  • Update docs

Periphery changes:

  • Use common pixl-db envvars for orthanc-anon
  • Remove obsolete cli._utils

@milanmlft milanmlft requested a review from stefpiatek June 13, 2024 17:13
@milanmlft milanmlft changed the title Move docker commands into PIXL CLI Move pixldc commands into PIXL CLI Jun 13, 2024
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 96.87500% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.04%. Comparing base (1c356f2) to head (b6ebc33).

Files Patch % Lines
cli/src/pixl_cli/_docker_commands.py 93.93% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #411      +/-   ##
==========================================
- Coverage   83.26%   83.04%   -0.22%     
==========================================
  Files          78       76       -2     
  Lines        3268     3061     -207     
==========================================
- Hits         2721     2542     -179     
+ Misses        547      519      -28     

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

Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

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

Looking nice, adding in a couple of suggestions, we can try them out on the GAE this afternoon as well

@milanmlft milanmlft requested a review from stefpiatek June 14, 2024 18:08
@milanmlft
Copy link
Member Author

milanmlft commented Jun 17, 2024

Reverted back to using docker compose directly in run-system-test.sh because attempting to use pixl up/down requires the following:

  • They need to be run from the project root directory (though the exact reason for this is still vague to me)
  • They require all of the environment variables in test/.env to be set, because running the CLI through Python results in a series of imports and config() calls, which will fail when the envvar is not set

There's a couple of workarounds for this, like temporarily copying over the test/.env file to project root, or loading the test/.env file through Python. But I'm going to leave it at this because this PR already took way too much time for what should have been a simple change 🫠

More importantly though, I think this points to some not-so-ideal design choices in the way we're handling these environment variables and .env files. Because when I'm running pixl down, I don't really care whether RABBITMQ_HOST is defined or not, but at the moment that will result in an error. Might be worth having a think about!

Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

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

⭐ All working nicely on the GAE, though couldn't do dry run with the version of docker so tested out the prod volumes locally.

I think probably best to make just a pixl dc subcommand which is a wrapper around a subprocess to docker compose, as the aim is to make this an easier experience and then we don't have to document what the args are for docker compose etc.

Happy for you to merge once you've done that

@milanmlft milanmlft enabled auto-merge (squash) June 19, 2024 15:55
@milanmlft milanmlft merged commit de8ea69 into main Jun 19, 2024
10 checks passed
@milanmlft milanmlft deleted the milanmlft/pixldc-to-pixl-cli branch June 19, 2024 16:26
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.

Bring pixldc into pixl CLI
2 participants