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

How can BITS be used in CI? #64

Open
prjemian opened this issue Mar 15, 2025 · 10 comments
Open

How can BITS be used in CI? #64

prjemian opened this issue Mar 15, 2025 · 10 comments
Labels
question Further information is requested

Comments

@prjemian
Copy link
Collaborator

It is foreseeable to use BITS in CI, such as GitHub Actions workflows. We can provide advice for this.

@prjemian prjemian added the question Further information is requested label Mar 15, 2025
@ravescovi
Copy link
Collaborator

I think we should define first, what are the set of "actions/commands" that we do when we are testing bits and what we expect out of it. If this is true, then we can create a real set of tests.

  • Clone bits
  • Install bits
  • run python
  • run demo_instrument startup
  • run demo_plan on demo_instrument
  • Create new package
  • install bits
  • run new_instrument startup
  • run demo_plan on new_instrument
  • Create new_device on demo_instrument
  • Create new_plan for new_device
  • Run new_plan with new_device on new_instrument

If this set of actions works, I think bits is doing its job?

@ravescovi
Copy link
Collaborator

Different deployments will be a different stages on this list and we could advice on how to test "from this point forward"

@prjemian
Copy link
Collaborator Author

This Issue is not about creating CI for testing BITS, it's about using BITS to set up a bluesky instrument for testing other packages. That will be very soon on my TODO list.

@ravescovi
Copy link
Collaborator

ravescovi commented Mar 17, 2025 via email

@prjemian
Copy link
Collaborator Author

prjemian commented Mar 17, 2025

Right. The scheme I imagine is to install BITS from the template, then git patch the modifications from a file created with some form of git diff. Probably good to go in a few steps.

@ravescovi
Copy link
Collaborator

I am confused about the git patch approach but I think it will be clear once I see it. I also keep thinking that once BITS is on pypi, this will be much more streamlined.
As far as testing environments go, have you seen this caprotro mini beamline ??

@prjemian
Copy link
Collaborator Author

I've seen that. It is trivial in comparison to what the synApps-based IOC provides. As a test case for developing caproto, it is not realistic for simulating any APS beamline. Fundamentally, the caproto IOC provides EPICS ChannelAccess PVs but lacks the internal database necessary for processing of records by the IOC's internal database management. It cannot simulate the sscan record. Since the sscan record is used copiously at APS for so-called fly scans, the caproto mini beamline is not interesting to test software for use at APS.

@prjemian
Copy link
Collaborator Author

prjemian commented Mar 18, 2025

the git patch approach

takes BITS as-delivered-from-template and applies a configuration (patch file) from a working instrument in a single step rather than a sequence of steps. The patch file is updated as desired from working instrument configuration (avoids the need to edit the "sequence of steps").

@ravescovi
Copy link
Collaborator

It seems this will be something like

  • clone DEMO-bits
  • pip install apsbits
  • create-bits newbits
  • Add/edit devices
  • Add/edit plans
  • check against container.

Feels pretty clean to me now.

@prjemian
Copy link
Collaborator Author

Might be easier still. Make a repo for the BITS instrument to use, then pick it up in the workflow (from tarball of GitHub repo or clone with minimal depth).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants