### Install Posit License Server as a Service (Windows) Source: https://docs.posit.co/ide/server-pro/admin/license_management/license_management Command to install and run the Posit License Server as a background service on Windows. This ensures the server starts automatically with the system. ```batch TurboFloatServer.exe -i ``` -------------------------------- ### Install Extension with PWB Code Server Binary Source: https://docs.posit.co/ide/server-pro/admin/vscode_sessions/pwb_code_server This example demonstrates how to install a VS Code extension using the PWB Code Server binary. It involves setting an environment variable for the PWB Code Server path and then executing the install command with a specified extensions directory. ```bash export PWB_CODE_SERVER=/usr/lib/rstudio-server/bin/pwb-code-server/bin/code-server $PWB_CODE_SERVER --extensions-dir=/opt/code-server/extensions --install-extension ``` -------------------------------- ### Install and Activate Posit License Server (Linux) Source: https://docs.posit.co/ide/server-pro/admin/license_management/license_management Commands to install the Posit License Server package, activate your product key, and start the server on a Linux system. This enables floating license distribution. ```bash sudo dpkg -i rsp-license-server-1.1.2-x86_64.deb sudo rsp-license-server activate sudo rsp-license-server start ``` -------------------------------- ### VS Code Session Configuration Example Source: https://docs.posit.co/ide/server-pro/admin/vscode_sessions/configuration An example of how to configure VS Code sessions in the `vscode.conf` file. This snippet demonstrates enabling sessions, specifying the code server executable, setting a default cluster, and defining a default container image. ```bash # /etc/rstudio-server/vscode.conf exe=/usr/lib/rstudio-server/bin/pwb-code-server/bin/code-server enabled=1 default-session-cluster=Kubernetes default-session-container-image=rstudio:vscode-session ``` -------------------------------- ### Start Posit Workbench Server Source: https://docs.posit.co/ide/server-pro/admin/server_management/backup_guide This command is used to start the Posit Workbench server after user state has been restored from a backup. It should be run after the restoration steps are complete. ```bash sudo rstudio-server start ``` -------------------------------- ### Run Uvicorn with Dynamic Root Path from Command Line Source: https://docs.posit.co/ide/server-pro/user/posit-workbench/guide/python This command-line example illustrates how to start a Uvicorn server with a dynamically generated root path. It uses command substitution `$()` to pass the output of `rserver-url -l 8050` directly to the `--root-path` argument, simplifying configuration. ```bash uvicorn main:app --port=8050 --root-path=$(rserver-url -l 8050) ``` -------------------------------- ### Nginx Reverse Proxy Configuration for Multiple Node Routing Source: https://docs.posit.co/ide/server-pro/admin/load_balancing/access_and_availability An example Nginx configuration to act as a reverse proxy for a Posit Workbench cluster. This setup routes traffic to multiple nodes, with one designated as primary and others as backups, enabling failover. It requires Nginx to be installed and configured on a separate host or one of the cluster nodes. ```nginx http { upstream rstudio-server { server rstudio1.example.com; server rstudio2.example.com backup; server rstudio3.example.com backup; } server { listen 80; location / { proxy_pass http://rstudio-server; proxy_redirect http://rstudio-server/ $scheme://$host/; } } } ``` -------------------------------- ### Launch Session Example Source: https://docs.posit.co/ide/server-pro/admin/workbench_api/workbench_api An example demonstrating how to launch a session using `curl` with the Workbench API. ```APIDOC ## Example: Launch Session ### Description Demonstrates how to launch a session using the `launch_session` API method via `curl`. ### Method `POST /api/launch_session` ### Request Example ```bash #!/bin/bash method="launch_session" # Replace with your 32 character API token apiToken= # Replace the username value with a valid user account on the system # Additional launch_parameters required for other session types. paramsJson=', "kwparams": {"launch_parameters":{"name":"Test RStudio Session","cluster":"Local"}, "username":"replace-this-user-name"}' # Replace with your Posit Workbench server URL workbenchServerUrl="http://localhost:8787" curl -H "Content-Type: application/json" \ -H "Authorization: Bearer $apiToken" \ -d "{\"method\":\"$method\" $paramsJson}" \ "$workbenchServerUrl/api/$method" ``` ### Parameters - **method** (string) - The API method to call (`launch_session`). - **kwparams** (object) - Key-value parameters for the method. - **launch_parameters** (object) - Parameters for launching the session. - **name** (string) - The name of the session. - **cluster** (string) - The cluster to launch the session on (e.g., `Local`). - **username** (string) - The username for whom to launch the session. ### Headers - **Content-Type**: `application/json` - **Authorization**: `Bearer ` ### Response Example (Success) ```json { "result": { "session_id": "some_session_id", "status": "running" } } ``` ### Response Example (Error) ```json { "error": { "code": 123, "message": "Failed to launch session for user." } } ``` ``` -------------------------------- ### Install Extension from Open VSX using Positron Server Source: https://docs.posit.co/ide/server-pro/admin/positron_sessions/extension_configuration Installs an extension from the Open VSX registry using the `positron-server` command-line tool. Requires write access to the specified extensions directory. The command takes the extensions directory and the publisher.extension name as arguments. ```bash positron-server --extensions-dir --install-extension . ``` ```bash /usr/lib/rstudio-server/bin/positron-server/bin/positron-server --extensions-dir=/opt/positron-server/extensions --install-extension streetsidesoftware.code-spell-checker ``` -------------------------------- ### Example: Launch Session API Request (Bash) Source: https://docs.posit.co/ide/server-pro/admin/workbench_api/workbench_api A bash script demonstrating how to make a `launch_session` API call to Posit Workbench using `curl`. It includes placeholders for the API token, username, and server URL. ```bash #!/bin/bash method="launch_session" # Replace with your 32 character API token apiToken= # Replace the username value with a valid user account on the system # Additional launch_parameters required for other session types. paramsJson=', "kwparams": {"launch_parameters":{"name":"Test RStudio Session","cluster":"Local"}, "username":"replace-this-user-name"}' # Replace with your Posit Workbench server URL workbenchServerUrl="http://localhost:8787" curl -H "Content-Type: application/json" \ -H "Authorization: Bearer $apiToken" \ -d "{\"method\":\"$method\" $paramsJson}" \ "$workbenchServerUrl/api/$method" ``` -------------------------------- ### Specify Custom R Installation Folders (JSON) Source: https://docs.posit.co/ide/server-pro/admin/positron_sessions/interpreter_settings Use `positron.r.customRootFolders` to provide additional directories where Positron Pro should search for R installations. This setting is searched in addition to the default system locations. Ensure the R executable exists at `bin/R` within the specified installation directories. ```json "positron.r.customRootFolders": [ "/custom/R/location", "/another/custom/R" ] ``` -------------------------------- ### Resource Profile Configuration Example Source: https://docs.posit.co/ide/server-pro/admin/job_launcher/kubernetes_plugin Example configuration for resource profiles in `/etc/rstudio/launcher.kubernetes.resources.conf`. This file defines presets for CPU, memory, and GPU allocations. ```properties [default] name = "Default" # optional, derived from the section name when absent cpus=1 mem-mb=4096 [small] cpus=1 mem-mb=512 [default-gpu] cpus=1 mem-mb=4096 nvidia-gpus=1 amd-gpus=0 [hugemem] name = "Huge Memory" cpus=8 mem-mb=262144 ``` -------------------------------- ### Override Available R Interpreters (JSON) Source: https://docs.posit.co/ide/server-pro/admin/positron_sessions/interpreter_settings Configure `positron.r.interpreters.override` to define an explicit list of R installations that Positron Pro should consider available. This setting takes precedence over all other discovery and exclusion settings. Paths can point to R binaries, R installation directories, or parent directories containing R installations. ```json "positron.r.interpreters.override": [ "/custom/R/location/4.3.0/bin/R" ] ``` -------------------------------- ### Tutorial API Source: https://docs.posit.co/ide/server-pro/admin/authenticating_users/customizing_signin Documentation for the Tutorial API, covering its overview, configuration, interface, methods, and callbacks. ```APIDOC ## Tutorial API ### Description Provides an overview, configuration details, interface specifications, available methods, and callback mechanisms for the Tutorial API. ### Endpoint `/admin/tutorial_api` (and related sub-paths) ### Parameters N/A (This section describes the API's capabilities, not specific endpoint parameters.) ### Request Example N/A ### Response N/A ``` -------------------------------- ### Test Posit Workbench with Kubernetes Integration Source: https://docs.posit.co/ide/server-pro/admin/integration/launcher-kubernetes Tests the installation and configuration of Posit Workbench with Launcher and Kubernetes by stopping, verifying, and starting the RStudio server. This command verifies that Workbench and Launcher can successfully communicate with Kubernetes and start sessions/jobs. ```bash sudo rstudio-server stop sudo rstudio-server verify-installation --verify-user= sudo rstudio-server start ``` -------------------------------- ### Slurm Profiles Configuration Example Source: https://docs.posit.co/ide/server-pro/admin/job_launcher/slurm_plugin This example demonstrates the structure and syntax for the `/etc/rstudio/launcher.slurm.profiles.conf` file. It showcases global, per-group, and per-user profile definitions with various resource and partition settings. ```configuration [*] default-cpus=1 default-mem-mb=512 max-cpus=2 max-mem-mb=1024 max-gpus-v100=1 max-gpus-tesla=1 allowed-partitions=mars,jupiter singularity-image-directory=/singularity-images [@posit-power-users] default-cpus=4 default-mem-mb=4096 max-cpus=20 max-mem-mb=20480 max-gpus-tesla=10 default-gpus-tesla=2 max-gpus-v100=8 default-gpus-v100=0 allowed-partitions=mars,jupiter,saturn,titan [jsmith] max-cpus=3 ``` -------------------------------- ### Customize Workbench Session Docker Image Source: https://docs.posit.co/ide/server-pro/admin/job_launcher/configuration Example Dockerfile to extend the official Posit Workbench session image. It installs system dependencies like gdebi-core. ```dockerfile FROM rstudio/workbench-session:ubuntu2204-r4.4.1_4.3.3-py3.12.6_3.11.10 ARG R_VERSION # install system dependencies RUN apt-get update && apt-get install -y gdebi-core ``` -------------------------------- ### Kubernetes Profile Configuration Example Source: https://docs.posit.co/ide/server-pro/admin/job_launcher/kubernetes_plugin An example configuration file for the Posit Workbench Kubernetes plugin, demonstrating global, per-group, and per-user profile settings. This file specifies resource constraints and allowed container images for different user and group scopes. ```ini [*] placement-constraints=node,region:us,region:eu default-cpus=1 default-cpus-request=0.5 default-mem-mb=512 default-mem-mb-request=256 max-cpus=2 max-mem-mb=1024 container-images=r-session:3.4.2,r-session:3.5.0 allow-unknown-images=0 [@posit-power-users] default-cpus=4 default-mem-mb=4096 default-nvidia-gpus=0 default-amd-gpus=0 max-nvidia-gpus=2 max-amd-gpus=3 max-cpus=20 max-mem-mb=20480 container-images=r-session:3.4.2,r-session:3.5.0,r-session:preview allow-unknown-images=1 [jsmith] max-cpus=3 ``` -------------------------------- ### Example NFS Mount Output Source: https://docs.posit.co/ide/server-pro/admin/job_launcher/troubleshooting/storage-server This is an example of the expected output when running the 'mount -l | grep nfs' command, indicating that the /home directory is successfully mounted via NFS. This confirms the NFS server is accessible and configured correctly. ```text 172.31.0.123:/home on /home type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.31.6.220,local_lock=none,addr=172.31.0.123) ``` -------------------------------- ### Set Manual Interpreter Startup - R Source: https://docs.posit.co/ide/server-pro/admin/positron_sessions/interpreter_settings Configures the R interpreter startup behavior to 'manual' in Positron Pro sessions. This prevents R from starting automatically but allows users to start an R interpreter manually when needed. This is useful for teams that primarily use Python. ```json { "[r]": { "interpreters.startupBehavior": "manual" } } ``` -------------------------------- ### Manually List R Versions - r-versions Source: https://docs.posit.co/ide/server-pro/admin/r/using_multiple_versions_of_r This configuration file allows administrators to manually specify the paths to R installations that should be recognized by Posit Workbench. This is an alternative to automatic scanning and is useful for custom R installations. Each R home path should be on a new line. ```plaintext /opt/R-4.1.2 /opt/R-devel-4.2 ``` -------------------------------- ### Example: Register Shiny Test Kernel Source: https://docs.posit.co/ide/server-pro/user/jupyter-lab/guide/jupyter-kernel-management Provides a concrete example of registering a Jupyter kernel with specific names for machine and display. This demonstrates the usage of the registration command. ```bash python -m ipykernel install --name shiny-test --display-name "Shiny Test" --user ``` -------------------------------- ### Example Workflow: Accessing S3 Bucket with R paws package Source: https://docs.posit.co/ide/server-pro/user/posit-workbench/managed-credentials/aws Demonstrates how to use the 'paws' package in R to interact with AWS S3 buckets after confirming credential availability. The example includes listing objects, uploading a file, and downloading a file from an S3 bucket. Ensure the 'paws' package is installed and the specified bucket exists. ```r library(paws) # create an S3 service object in the region you are working on s3 <- paws::s3(config = list(region = "us-east-2")) # locate the s3 bucket you want bucket = 'colorado-projects' s3$list_objects(Bucket = bucket) # upload data to s3 bucket s3$put_object( Bucket = bucket, Key = 'data.csv' ) # read data from s3 bucket s3_download <- s3$get_object( Bucket = bucket, Key = 1 ) ``` -------------------------------- ### Install Extension from Open VSX using CLI Source: https://docs.posit.co/ide/server-pro/admin/vscode_sessions/extension_configuration Installs an extension from the Open VSX registry using the `code-server --install-extension` command. Requires specifying the extensions directory and the extension publisher and name. Ensure the correct path to `code-server` is used. ```bash code-server --extensions-dir --install-extension . ``` ```bash /usr/lib/rstudio-server/bin/pwb-code-server/bin/code-server --extensions-dir=/opt/code-server/extensions --install-extension ms-python.python ``` -------------------------------- ### Install Extension from VSIX File using Positron Server Source: https://docs.posit.co/ide/server-pro/admin/positron_sessions/extension_configuration Installs an extension from a local VSIX file using the `positron-server` command-line tool. Requires write access to the specified extensions directory. The command takes the extensions directory and the path to the VSIX file as arguments. ```bash /usr/lib/rstudio-server/bin/positron-server/bin/positron-server --extensions-dir=/opt/positron-server/extensions --install-extension ./my-extension.vsix ``` -------------------------------- ### Override pip Index URL with Command-Line Option Source: https://docs.posit.co/ide/server-pro/admin/python/package_installation Overrides all other pip index URL configurations by specifying the index URL directly on the command line. This has the highest precedence. ```bash pip install --index-url https://example.index.site package_name ``` -------------------------------- ### Get RStudio Workbench Node Status (Shell) Source: https://docs.posit.co/ide/server-pro/admin/load_balancing/configuration Retrieves the status of online nodes and their allocated sessions from a specific RStudio Workbench node. The output is a JSON object used by the load balancing algorithm to determine where to start new sessions. ```shell rstudio-server node-status ``` -------------------------------- ### Configure Open VSX Extensions in positron.extensions.conf Source: https://docs.posit.co/ide/server-pro/admin/positron_sessions/extension_configuration Administrators can specify extensions to install from Open VSX by listing them in the `positron.extensions.conf` file. Each line should be in the format `${publisher}.${name}`. This requires network access to Open VSX and may increase initial session load times. ```plaintext databricks.databricks ``` -------------------------------- ### Configure uv Index URL via Configuration File Source: https://docs.posit.co/ide/server-pro/admin/python/package_installation Sets the index-url within the uv configuration file (/etc/uv/uv.toml). This method has lower precedence than environment variables and command-line options. ```toml [global] index-url = "https://packagemanager.posit.co/pypi/latest/simple" ``` -------------------------------- ### Configure pip Index URL via Configuration File Source: https://docs.posit.co/ide/server-pro/admin/python/package_installation Sets the index-url within the pip configuration file (/etc/pip.conf). This method has lower precedence than environment variables and command-line options. ```ini [global] index-url = https://packagemanager.posit.co/pypi/latest/simple ``` -------------------------------- ### Install NFS Client and Mount Shared Storage on Workbench Nodes Source: https://docs.posit.co/ide/server-pro/admin/getting_started/installation/multi_server_installation These commands install the necessary NFS client package and mount shared NFS directories on each Workbench node. It includes updating package lists, installing `nfs-common`, creating mount point directories, and mounting the NFS exports. Remember to replace the placeholder NFS_HOST with your actual NFS server IP address. ```shell # Install nfs-common sudo apt-get update sudo apt-get install -y nfs-common # Replace this value with the IP address for your NFS server NFS_HOST="" # Create the directories for the NFS mount sudo mkdir -p /nfs/workbench/home sudo mkdir -p /nfs/workbench/shared-storage # Mount the NFS directories (example for home directories) sudo mount -t nfs ${NFS_HOST}:/var/nfs/workbench/home /nfs/workbench/home sudo mount -t nfs ${NFS_HOST}:/var/nfs/workbench/shared-storage /nfs/workbench/shared-storage ``` -------------------------------- ### Set WORKBENCH_JUPYTER_PATH Environment Variable Source: https://docs.posit.co/ide/server-pro/admin/jupyter_sessions/configuration This example shows how to set the `WORKBENCH_JUPYTER_PATH` environment variable, typically within a container build or a `launcher-env` file. This variable dictates the priority for locating the `jupyter` executable, ensuring Workbench uses the desired installation. ```bash export WORKBENCH_JUPYTER_PATH=/path/to/your/jupyter/installation ``` -------------------------------- ### Configure PAM Profile for Kerberos Authentication Source: https://docs.posit.co/ide/server-pro/admin/access_and_security/pam_sessions This example shows the necessary directives for the `/etc/pam.d/rstudio-session` PAM profile to integrate with `pam_sss.so` for Kerberos authentication. ```pam /etc/pam.d/rstudio-session auth required pam_sss.so account [default=bad success=ok user_unknown=ignore] pam_sss.so password sufficient pam_sss.so use_authtok session requisite pam_sss.so ``` -------------------------------- ### Get Traefik Ingress Controller Service IP using kubectl Source: https://docs.posit.co/ide/server-pro/admin/getting_started/installation/kubernetes_installation This command retrieves the details of the Traefik service in Kubernetes, specifically focusing on identifying the `EXTERNAL-IP`. This IP address is essential for configuring DNS records to point to your Posit Workbench installation. ```bash kubectl get svc traefik ``` -------------------------------- ### Configure Global Extensions Directory in positron.conf Source: https://docs.posit.co/ide/server-pro/admin/positron_sessions/extension_configuration To set a global directory for Positron Pro extensions, add the `args=--extensions-dir=/opt/positron/extensions` line to the `positron.conf` file. Extensions should then be manually installed into the specified directory. ```ini args=--extensions-dir=/opt/positron/extensions ``` -------------------------------- ### Include Additional Python Interpreter Paths Source: https://docs.posit.co/ide/server-pro/admin/positron_sessions/interpreter_settings Adds Python installations to Positron Pro's discovery process when default strategies fail. Specify absolute paths to executables or directories containing Python installations. This setting is ignored if `python.interpreters.override` is configured and does not take effect for interpreters also listed in `python.interpreters.exclude`. The paths provided are searched in addition to default system locations. ```json { "python.interpreters.include": [ "/custom/python/location", "/another/custom/python/3.12.0/bin/python" ] } ```