Skip to content

Add support for scratch area to automatically add packages when running on Kubernetes - #313

Merged
callumforrester merged 9 commits into
mainfrom
scratch
Oct 23, 2023
Merged

callumforrester merged 9 commits into
mainfrom
scratch

Conversation

@callumforrester

Copy link
Copy Markdown
Contributor

Recent discussion has emphasized the need for an area to checkout Python packages and do dev work against a live instance of blueapi running on Kubernetes. This has previously been done by pushing alpha tags of various packages and continually rebuilding and redeploying the blueapi container, which has become a lengthy and unweildy process.

This PR introduces the "scratch area", a shared directory that can be mounted from the container running on kubernetes, and can install any (pip installable) Python libraries that are cloned into it. In the cases where a dev version of an existing dependency is required (e.g. Dodal), the cloned version will overwrite the existing version installed in the container.
Removing a package and restarting the container works like a factory reset. See documentation addtions for more information.

Changes:

  • Add confiugration for a scratch directory
  • If configured, make blueapi pip install all packages in it on startup
  • If configured, automatically create the scratch directory on startup
  • Mount scratch in the helm chart if configured
  • Tests and docs for new functionality

Comment thread helm/blueapi/values.yaml Resolved
@codecov

codecov Bot commented Oct 20, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #313 (3ccc793) into main (508a628) will increase coverage by 0.08%.
The diff coverage is 91.07%.

@@            Coverage Diff             @@
##             main     #313      +/-   ##
==========================================
+ Coverage   88.99%   89.07%   +0.08%     
==========================================
  Files          38       39       +1     
  Lines        1390     1446      +56     
==========================================
+ Hits         1237     1288      +51     
- Misses        153      158       +5     
Files Coverage Δ
src/blueapi/config.py 95.65% <100.00%> (+0.26%) ⬆️
src/blueapi/service/main.py 89.36% <50.00%> (-1.75%) ⬇️
src/blueapi/service/scratch.py 93.75% <93.75%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DiamondJoseph DiamondJoseph left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems to work for both existing library dependencies (dodal) and for modules to import (i22_bluesky)

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.

3 participants