Replies: 1 comment 2 replies
-
There is a simple solution, but it's probably not obvious, since it isn't documented yet. You can start the project using the API. Here's the endpoint for stopping a project: https://doc.cocalc.com/api2/stop.html There's also a start endpoint, but it's just not documented. https://github.com/sagemathinc/cocalc/blob/master/src/packages/next/pages/api/v2/projects/start.ts Basically get an api key, then do this:
and your project will start. You can also do a post API call pretty easily from Python (using requests) or anywhere else. So in your script where you might use ssh or rsync or whatever, just put a single call to the api first. You can actually do a frightening about on cocalc via the API, since all of cocalc is implemented using the api. However, the document lags. E.g., this endpoint https://github.com/sagemathinc/cocalc/blob/master/src/packages/next/pages/api/v2/jupyter/execute.ts lets you execute a chunk of code in a Jupyter kernel in an anonymous sandbox, or in a project of your choice, and keeps another kernel around at the ready so the next execution is fast.. -- William |
Beta Was this translation helpful? Give feedback.
-
I am trying to find a good solution for the following use case:
Use Case: A research group would like to share a set of "lab notebooks" - markdown files that we update and interact with heavily. The current limitation is that CoCalc does not provide a good way for users to synchronize or edit these files using their tools of choice.
Example: I want to use emacs running on my machine. I can do this using TRAMP, but this connects via SSH, and if the project is not running, then it will fail (after a long delay), requiring me to open a browser, trigger the project to launch, wait, then reconnect.
While this is not the end of the world, it is annoying enough that I often prefer to just edit a local file, promising to myself that I will update CoCalc later (but then inevitably forgetting). I want to make this as easy and transparent as possible (after an initial setup) so that there are no barriers. (It is hard enough to encourage people to keep rigorous lab notebooks even when there are no barriers!)
Any suggestions? I have a few ideas, but think they would require some modifications.
Am I missing an obvious solution?
Beta Was this translation helpful? Give feedback.
All reactions