-
Notifications
You must be signed in to change notification settings - Fork 5
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
Remote git server as source for plans and devices #363
Comments
re: 'point blueapi at the new branch' re: risk re: Are we just using git as a database? re: self hosted vscode we should spin a container there with devcontainers with the auto commit extension re: making own editor from scratch I had a brief discussion about this. Main conclusion - it's very difficult. https://editorjs.io/ but those are not well-suited for code. Even still we could manage file updates - https://fastapi.tiangolo.com/tutorial/request-files/ . |
re: self-hosted but diff than vscodeI hope each of those could be pulled up with a simple helm chart. then the search for a self-hosted solution starts with awesome-selfhosted README. there we find coder eclipse Theia gitpod code-server and also some more niche projects for comparison, that are likely not mature enough for our use case: |
action recommendation: this proof of concept is not an MVP yet but every day that the scripts aren't version-controlled is a risk. Expected outcome: Once deployed presumably this would require little maintainance. One shared repository for all the plans across beamlines could be added as a nice feature. |
A few thoughts:
A couple of other things to consider:
|
I mean our local gitlab instance maintained by the cloud team. I mean for 1 beamline as an MVP, to try out there their specific plans. limiting the scope. messy git history is better than no history. why would we want to track history of each plan? that's a wild requirement. arguably we could cache a git ref or text snapshot in the plan metadata instead of just plan name. not sure what is the use case here |
testing the linuxserver /code-server image now https://hub.docker.com/r/linuxserver/code-server |
let's consider for a moment what if the experimental plans lived at the head, people just pushing to production all the time. of course the more long-lived plans would be in a different directory |
with that of course to not get stuck in the event of github coing down |
and the workspace dir could be mounted in |
gitdocs seems to work fine. next I'll try to commit a new ophyd device from there |
achieved a mirroring between 2 repos https://gitlab.diamond.ac.uk/import/github/status https://gitlab.diamond.ac.uk/xma12127/shared-scripts/-/tree/main |
one issue seems to be about the 'writing to local filesystem' and also then for multi-user access. perhaps the use of coder would be needed https://coder.com/docs/v2/latest/install/kubernetes update: our current cloud config should be ok to try out coder |
update: I have no idea how to deploy coder with helm in my namespace at the argus cluster |
MVP idea - just use the provided and managed https://code.visualstudio.com/docs/editor/profiles#_python-profile-template we could save the profiles as github gists we could hard-code script like this: the profile indicated here is the one from the github gist with the most stars: https://gist.github.com/search?l=JSON&o=desc&q=vscode+profile&s=stars |
Where does the local copy of the code live? |
ah I forgot to address this key question. |
From discussion: the core problem is to put git as the barrier between changes being written and read from blueapi. The target that blueapi is pointing at MUST BE beyond the local filesystem. Where the edits happen is secondary - that can be in a local vim or preconfigured vscode editor, or in the cloud with a tool like coder. A ligtweight git server could be tested to investigate this further. |
https://www.reddit.com/r/git/comments/seu9pe/is_there_a_way_to_consistently_mirror_one_repo_to/ first-pass survey of solutions for this mirror setup |
stumbled across another solution for this |
Continued in #509 |
@callumforrester this could still be kept here as part of the epic afaik |
@stan-dot Good point! |
Remote Git Repository as Source for Plans and Devices
Background
We introduced a scratch area in #313 so that plan/device code could be loaded from external files on startup. Typically we check out these files on a shared filesystem for prototyping. We have found several issues with this approach:
We are therefore looking for a more flexible, long-term solution that will enable more robust deployments at the facility level.
Proposed Solution
Outline
Add the option to configure blueapi to pull down and install git repositories into its environment on startup. Define a "workspace" i.e. a group of remote git repositories that blueapi uses. On startup/reload, it will pull these as-configured (latest
main
, latest tag, some specific branch or hash). It can be configured via REST endpoints. It will also cache what it pulls in case the remote goes down.Example Workflow for Prototyping Changes
An example workflow for prototyping changes to plans/devices is therefore:
This adds some extra overhead to get experimental changes in, however they can be addressed outside of blueapi. For example, we have considered an auto-commit program for less advanced users. From their perspective they click "save" and a few seconds later the changes are live.
Benefits
main
branch)Outstanding Concerns
The text was updated successfully, but these errors were encountered: