Skip to content

Conversation

@tristpinsm
Copy link
Contributor

@tristpinsm tristpinsm commented Apr 30, 2025

Using caput to directly access the register here is not ideal and it would probably be better to wrap this in a function in pysmurf. What do you think?

Pending simonsobs/smurf_dockers#4 and simonsobs/smurf-streamer#43

@tristpinsm tristpinsm requested review from msilvafe and swh76 April 30, 2025 18:14
@tristpinsm
Copy link
Contributor Author

We should probably also tag and upgrade sodetlib as long as we're at it so that fixed tones and other features are included.

@tristpinsm
Copy link
Contributor Author

I wasn't able to test the new action on the SLAC system without disrupting the running OCS agents.

@msilvafe
Copy link
Contributor

msilvafe commented May 1, 2025

Looks good to me.

@tristpinsm tristpinsm marked this pull request as ready for review May 2, 2025 18:48
@tristpinsm tristpinsm requested a review from BrianJKoopman May 2, 2025 18:48
Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

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

Agreed that a wrapped function in pysmurf for this would be better than the S._caput() call.

Any plans to test this somewhere, even at site, before we merge?

One comment below, but not super critical to add.

@tristpinsm
Copy link
Contributor Author

Note that this is an opportunity to deploy some new features in sodetlib. Merging simonsobs/sodetlib#457 and bumping the tag before releasing this version is something we should consider.

@tristpinsm
Copy link
Contributor Author

Agreed that a wrapped function in pysmurf for this would be better than the S._caput() call.

Any plans to test this somewhere, even at site, before we merge?

One comment below, but not super critical to add.

re testing: I haven't worked with OCS before and I was trying to figure out how to test it. I think you would have to update the code checked out by the crossbar and restart everything (?) This seemed like it could be disruptive

@BrianJKoopman
Copy link
Member

re testing: I haven't worked with OCS before and I was trying to figure out how to test it. I think you would have to update the code checked out by the crossbar and restart everything (?) This seemed like it could be disruptive

It'll sort of depend on your lab setup. You could bring down a pysmurf-controller agent there, and start up this modified agent in its place, then run the new task and verify functionality. This certainly is disruptive if you're actively using the pysmurf-controller. Rolling back once testing is complete is generally straight forward though.

For starting up the modified agent you can either build the image with the modified code in it, or run it directly on the host via something like:

$ cd $OCS_CONFIG_DIR
$ OCS_CONFIG_DIR=$(pwd) ocs-agent-cli --site-file=default.yaml --instance-id=pysmurf-controller-id --site-host=hostname

You'll need to change pysmurf-controller-id and hostname to suite your setup.

Building the docker image, you'd need to update the docker-compose.yml file with the new image tag and run a docker compose up -d (or down/up if you're using Host Manager.) This is the more thorough option, as it would catch any issues with how the software within the image runs, useful especially if the underlying image is going to change with those potential sodetlib changes.

@tristpinsm
Copy link
Contributor Author

OK, thanks for the suggestions. Starting the pysmurf-controller docker with the updated code is not an issue. I just don't know how to trigger the new command. The way things are set up there is a "crossbar" server running on another host -- which does not have updated software. So if I spawn a client there it doesn't know about the new restart_rssi command.

@BrianJKoopman
Copy link
Member

Starting the pysmurf-controller docker with the updated code is not an issue. I just don't know how to trigger the new command.

From any host on the network that can access the crossbar server you can run:

$ ocs-client-cli shell <agent instance-id>

That will drop you into a python session with an OCSClient object called client. You can then run client.restart_rssi(). (This assumes the default.yaml is properly configured and OCS_CONFIG_DIR is set.)

The way things are set up there is a "crossbar" server running on another host -- which does not have updated software. So if I spawn a client there it doesn't know about the new restart_rssi command.

No changes are needed on the crossbar server. The crossbar server is a communication layer between the client you're spawning with the above command and the agent. So only the agent code needs to be updated as in my last post.

@tristpinsm
Copy link
Contributor Author

Thanks! That was very helpful and in the end I was able to test the new agent task and make some fixes.

I was able to run the command using ocs-client-cli and then confirm that the register had been updated in rogue.

@BrianJKoopman BrianJKoopman merged commit 4853d95 into main May 5, 2025
5 checks passed
@BrianJKoopman BrianJKoopman deleted the tpm/rssi branch May 5, 2025 14:27
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.

4 participants