-
Notifications
You must be signed in to change notification settings - Fork 0
Draft: Add BinaryApp application type and p47 example deployment #23
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
==========================================
+ Coverage 42.55% 42.71% +0.15%
==========================================
Files 23 24 +1
Lines 860 899 +39
==========================================
+ Hits 366 384 +18
- Misses 494 515 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this PR is only a draft (it includes a bunch of unrelated changes), but I've still commented to help us figure out how to do it properly later on.
if h.hexdigest() != app.sha256: | ||
raise RuntimeError(f"Downloaded Binary {app.url} digest failure") | ||
|
||
binary_path.chmod(0o555) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permissions should at least be a module constant. At the moment, it is all tidied away in templater.py, but this obviously breaks that and it may be sensible to move these permissions to another location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely clear how you want to handle this. So I've left it as is for now in #26 - see #26 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an extra comment there - I recommend at least a module-level constant.
Download a URL, validate it against its sha256, make it executable | ||
and add it to PATH | ||
""" | ||
binary_folder = self._build_layout.get_binary_files_folder( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the same folder for all entrypoints. Maybe even rename it to bin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool - lets do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still todo - right now I'm using entrypoints
only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend calling it 'bin_folder' if you do decide to rename things, as 'binary_folder' isn't commonly used. I'm happy to make this change myself, later, if you want.
This is working beautifully now:
I'm going to split this work up into discrete PRs and eventually close this draft. |
@MJGaughran I have 4 new PRS for you
I included the commits from 1. in 2. and 3. (with the misguided intention of avoiding merge conflicts). So you should merge it first and rebase 2,3 over main if you want a cleaner PR conversation. Likewise 4. can be rebased after the others are all merged. |
Above PRs completed |
This includes a fully working demo of p47 beamline. But, it needs to be run outside of the devcontainer because your user ID is needed for login to argocd.
To try it out do this on your host after doing a sync:
sudo ln -s /scratch/...(root of workspaces) /workspaces export MODULEPATH=/workspaces/deploy-tools/demo-output/modulefiles module load p47/dev ec-login ec ps ec monitor
Some things to consider:
bin
host_binaries
instead - which finds binaries on the host by PATH and mounts them into/usr/bin
. At present I'm adding the argocd in the container build as well as in the module binaries. I would prefer to mount the argocd binary into the apptainer, but to do that I need a way to know what the path to it will be here:deploy-tools/src/deploy_tools/demo_configuration/p47/dev.yaml
Lines 33 to 37 in 30cc43d
e.g.