Viewing Execution Environment Runtimes
Problem
You want to view the Python, R, and Quarto versions available in a given execution environment.
Solution
Use the GET /v1/environments
endpoint to get details on all environments. Then, filter the resulting data for your image of interest.
from posit import connect
= "ghcr.io/rstudio/content-pro:r4.1.3-py3.10.4-bionic"
IMAGE_NAME
= connect.Client()
client
= client.environments.find_by(name=IMAGE_NAME) environment
>>> environment
{"id": "3",
"guid": "5c47281b-d8ac-4386-b332-c9f78454440d",
"created_time": "2024-07-09T19:09:34Z",
"updated_time": "2024-07-09T19:09:34Z",
"title": "Ubuntu 18.04",
"description": "Ubuntu 18.04 - R 4.1.3 / Python 3.10.4",
"cluster_name": "Kubernetes",
"name": "ghcr.io/rstudio/content-pro:r4.1.3-py3.10.4-bionic",
"environment_type": "Kubernetes",
"matching": "exact",
"supervisor": None,
"python": {
"installations": [
{"version": "3.10.4",
"path": "/opt/python/3.10.4/bin/python"
}
]
},"quarto": {
"installations": None
},"r": {
"installations": [
{"version": "4.1.3",
"path": "/opt/R/4.1.3/bin/R"
}
]
},"tensorflow": {
"installations": None
}, }
library(connectapi)
library(purrr)
<- "ghcr.io/rstudio/content-pro:r4.1.3-py3.10.4-bionic"
IMAGE_NAME
<- connect()
client <- client$GET("/v1/environments")
all_images <- map_chr(all_images, ~ .$title)
image_names
<- all_images[[match(IMAGE_NAME, image_names)]]
image <- image[c("python", "quarto", "r")] image
> image
$python
$python$installations
$python$installations[[1]]
$python$installations[[1]]$version
1] "3.10.4"
[
$python$installations[[1]]$path
1] "/opt/python/3.10.4/bin/python3"
[
$quarto
$quarto$installations
$quarto$installations[[1]]
$quarto$installations[[1]]$version
1] "1.0.35"
[
$quarto$installations[[1]]$path
1] "/opt/quarto/bin/quarto"
[
$r
$r$installations
$r$installations[[1]]
$r$installations[[1]]$version
1] "4.1.3"
[
$r$installations[[1]]$path
1] "/opt/R/4.1.3/bin/R" [
See also
- Viewing Container Image Usage for viewing a list of image names in use and how many content items use each.