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

Automatically init scratch area and remove startup script #520

Merged
merged 16 commits into from
Jul 10, 2024

Conversation

callumforrester
Copy link
Contributor

Fixes #510 and #399

Write python code to do the job of container-startup.sh and add code to clone the required repos. Replace container-startup.sh with this code. Stop blueapi from initializing scratch automatically on container startup, replace this job with an initContainer. Copy the blueapi venv to an emptyDir so the initContainers can manipulate it.

@callumforrester
Copy link
Contributor Author

This will need testing on k8s

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 98.11321% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.51%. Comparing base (84c39cf) to head (3783354).

Files Patch % Lines
src/blueapi/cli/cli.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #520      +/-   ##
==========================================
+ Coverage   91.32%   91.51%   +0.18%     
==========================================
  Files          41       42       +1     
  Lines        1880     1933      +53     
==========================================
+ Hits         1717     1769      +52     
- Misses        163      164       +1     

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

{{- if .Values.scratch.hostPath }}
- name: init-venv
image: busybox:1.28
command: ['sh', '-c', "cp -r /venv /emptyDir/venv"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My current concern with this is the added startup time

@callumforrester callumforrester force-pushed the init-scratch branch 4 times, most recently from 351c8bc to 376561e Compare July 1, 2024 08:55
@callumforrester callumforrester marked this pull request as ready for review July 1, 2024 09:48
@callumforrester
Copy link
Contributor Author

callumforrester commented Jul 3, 2024

Still to do:

  • Cloned repos have wrong permissions (Done)
  • If cloning/pip install errors, container starts anyway (Done)

tests/cli/test_scratch.py Outdated Show resolved Hide resolved
tests/cli/test_scratch.py Outdated Show resolved Hide resolved
callumforrester and others added 2 commits July 10, 2024 13:21
Co-authored-by: Joe Shannon <[email protected]>
Co-authored-by: Joe Shannon <[email protected]>
@callumforrester callumforrester merged commit 38f1ad5 into main Jul 10, 2024
24 checks passed
@callumforrester callumforrester deleted the init-scratch branch July 10, 2024 12:34
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.

InitContainer to set up scratch area
2 participants