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

feat: migrate runtime caches recipe #112

Merged
merged 2 commits into from
Jul 1, 2024
Merged

feat: migrate runtime caches recipe #112

merged 2 commits into from
Jul 1, 2024

Conversation

toph-allen
Copy link
Collaborator

This PR migrates the runtime caches recipe.

Addresses #54

Notes, which may require the creation of future issues

  • Import existing recipe: list and rebuild content runtime caches #54 called for adding information about rebuilding content caches. However, that wasn't in the old recipe, and has not been added in this new recipe. We should add a new issue to track that.
  • Neither of the SDK packages implement runtime cache deletion with task polling.
    • The original recipe includes a longer, more complex snippet to poll in a loop. I didn't add that, just a single API call to manually check. May be worthwhile preserving the old recipe's approach, but I was unsure how to present it in the format of the new notebook. The SDKs should add support for an interactive cache deletion operation that polls the tasks API to report success or failure.
    • rsconnect-python includes such a feature already, but I chose not to use it here.

@toph-allen toph-allen requested a review from tdstein as a code owner July 1, 2024 20:42
Copy link
Collaborator

@tdstein tdstein left a comment

Choose a reason for hiding this comment

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

Some minor stuff to change. Looks great overall!

10-server-management/10-viewing-runtime-caches/index.qmd Outdated Show resolved Hide resolved
10-server-management/11-deleting-runtime-caches/index.qmd Outdated Show resolved Hide resolved
Comment on lines +101 to +117
## Python

```{.python}
task_id = response.json()["task_id"]
task_status = client.get(f"/v1/tasks/{task_id}")
```

```{.python}
>>> task_status.json()
{'id': 'lFvijYN16kjCoal6',
'output': ['Deleting runtime cache...', 'Successfully deleted runtime cache'],
'result': None,
'finished': True,
'code': 0,
'error': '',
'last': 2}
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Theres a simple way to do this in the SDK ,but this is fine for now. Also, we can split this information out into separate page and link to it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that way we could have slightly more complex code that actually polls and prints updates as status changes.

Co-authored-by: Taylor Steinberg <[email protected]>
@toph-allen toph-allen merged commit e180473 into main Jul 1, 2024
1 check passed
@toph-allen toph-allen deleted the toph/runtime-caches branch July 1, 2024 21:01
tdstein added a commit that referenced this pull request Jul 2, 2024
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.

None yet

2 participants