Skip to content

Automatically init scratch area and remove startup script - #520

Merged
callumforrester merged 16 commits into
mainfrom
init-scratch
Jul 10, 2024
Merged

callumforrester merged 16 commits into
mainfrom
init-scratch

Conversation

@callumforrester

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

This will need testing on k8s

@codecov

codecov Bot commented Jun 24, 2024 •

Copy link
Copy Markdown

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.

Comment thread helm/blueapi/templates/deployment.yaml Outdated
{{- if .Values.scratch.hostPath }}
- name: init-venv
image: busybox:1.28
command: ['sh', '-c', "cp -r /venv /emptyDir/venv"]

Copy link
Copy Markdown
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

Comment thread src/blueapi/cli/scratch.py Resolved
Comment thread src/blueapi/cli/scratch.py Resolved
Comment thread src/blueapi/config.py Resolved
@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

callumforrester commented Jul 3, 2024 •

Copy link
Copy Markdown
Contributor Author

Still to do:

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

Comment thread tests/cli/test_scratch.py Resolved
Comment thread tests/cli/test_scratch.py 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]>
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