Skip to content

spcs support #660

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

spcs support #660

wants to merge 5 commits into from

Conversation

edavidaja
Copy link
Collaborator

add support for deployments and administrative actions for Connect in SPCS

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change

Approach

  • Take optional dependency on snowflake-cli
  • Add support for passing a snowflake connection name to all commands that interact with Connect, and for storing a server nickname that is snowflake aware

Automated Tests

Added new tests covering new API class and snowflake-cli

Directions for Reviewers

One shot:

uvx --from git+https://github.com/posit-dev/rsconnect-python@spcs rsconnect deploy shiny my-shiny-app --server <SPCS-SERVER-ADDDRESS> --snowflake-connection-name <CONNECTION-NAME>

Realistic:

python -m pip install "git+https://github.com/posit-dev/rsconnect-python@spcs[snowflake]"
rsconnect add --server <SPCS-SERVER-ADDRESS> --snowflake-connection-name <CONNECTION-NAME> -n spcs
rsconnect details -n spcs
rsconnect deploy ...

Checklist

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.

add support for deployments and administrative actions for  Connect in SPCS
@mconflitti-pbc
Copy link

Where is the best place to document this optional dependency and how it works?

@mconflitti-pbc
Copy link

And for pip,

python -m pip install "rsconnect-python[snowflake] @ git+https://github.com/posit-dev/rsconnect-python@spcs"

@mconflitti-pbc
Copy link

I didn't see this on your previous branch but maybe a debug flag is turned on? Seeing all these logs when deploying. If that is expected now, then please ignore:

(rsconnect-python) ➜  rsconnect-python git:(spcs-support) ✗ rsconnect deploy shiny -n snowflake-connect-9 "/Users/mconflitti/Documents/repos/aws-integration-tester"                                               
    Warning: Python version constraint missing from pyproject.toml, setup.cfg or .python-version
             Connect will guess the version to use based on local environment.
             Consider specifying a Python version constraint.
Validating server...    [OK]
Validating app mode...  [OK]
Making bundle ...       [OK]
Deploying bundle ...    [OK]
Saving deployed information...  [OK]
Building Python Shiny application...
Bundle created with Python version 3.11.10 is compatible with environment Local with Python version 3.11.9 from /opt/python/3.11.9/bin/python3.11 
Bundle requested Python version 3.11.10; using /opt/python/3.11.9/bin/python3.11 from Local which has version 3.11.9
2025/04/25 15:21:44.193155205 [rsc-session] Content GUID: a07fcd44-14d1-4148-89d8-1caa336ef93d
2025/04/25 15:21:44.193178459 [rsc-session] Content ID: 1
2025/04/25 15:21:44.193182447 [rsc-session] Bundle ID: 27
2025/04/25 15:21:44.193185592 [rsc-session] Job Key: xU2UVRGLTolUy2zO
Determining session server location ...
Connecting to session server http://127.0.0.1:33159 ...
Connected to session server http://127.0.0.1:33159
2025/04/25 15:21:44.326141614 Running on host: statefulset-0
2025/04/25 15:21:44.326162698 Process ID: 6731
2025/04/25 15:21:44.371307192 Linux distribution: Ubuntu 22.04.5 LTS (jammy)
2025/04/25 15:21:44.373969921 Running as user: uid=999(rstudio-connect) gid=999(rstudio-connect) groups=999(rstudio-connect),1000(content-builders)
2025/04/25 15:21:44.373978815 Connect version: 2025.04.0-dev+160-g2abe867fce
2025/04/25 15:21:44.373999018 LANG: C.utf8
2025/04/25 15:21:44.373999887 Working directory: /data/connect/apps/1/27
2025/04/25 15:21:44.374005696 Building environment using Python 3.11.9 (main, Feb 25 2025, 22:24:00) [GCC 11.4.0] at /opt/python/3.11.9/bin/python3.11
2025/04/25 15:21:44.374006363 Requested packages: shiny==1.0.0, altair==5.3.0, requests, posit-sdk @ git+https://github.com/posit-dev/posit-sdk-py.git@163a9d43074796cee88441bdee281a84b8869fdd, boto3
2025/04/25 15:21:44.374012656 Using cached environment: kutIAd9wYX3JTZoqmWpqeA
2025/04/25 15:21:44.661377752 Packages in the environment: aiofiles==24.1.0, altair==5.3.0, anyio==4.9.0, appdirs==1.4.4, asgiref==3.8.1, attrs==25.3.0, boto3==1.37.38, botocore==1.37.38, certifi==2025.1.31, charset-normalizer==3.4.1, click==8.1.8, h11==0.14.0, htmltools==0.6.0, idna==3.10, Jinja2==3.1.6, jmespath==1.0.1, jsonschema==4.23.0, jsonschema-specifications==2024.10.1, linkify-it-py==2.0.3, markdown-it-py==3.0.0, MarkupSafe==3.0.2, mdit-py-plugins==0.4.2, mdurl==0.1.2, numpy==2.2.5, packaging==25.0, pandas==2.2.3, pip==25.0.1, posit-sdk @ git+https://github.com/posit-dev/posit-sdk-py.git@163a9d43074796cee88441bdee281a84b8869fdd, prompt_toolkit==3.0.51, python-dateutil==2.9.0.post0, python-multipart==0.0.20, pytz==2025.2, questionary==2.1.0, referencing==0.36.2, requests==2.32.3, rpds-py==0.24.0, s3transfer==0.11.5, setuptools==78.1.0, shiny==1.0.0, six==1.17.0, sniffio==1.3.1, starlette==0.46.2, toolz==1.0.0, typing_extensions==4.13.2, tzdata==2025.2, uc-micro-py==1.0.3, urllib3==2.4.0, uv==0.6.16, 
uvicorn==0.34.2, virtualenv==16.7.12, watchfiles==1.0.5, wcwidth==0.2.13, websockets==15.0.1, wheel==0.45.1, wsproto==1.2.0, 
2025/04/25 15:21:44.661406070 Creating lockfile: python/requirements.txt.lock
Completed Python build using Local against Python version: '3.11.9'
Launching Python Shiny application...
Deployment completed successfully.
         Dashboard content URL: https://nagoiaib-duloftf-posit-software-pbc-dev.snowflakecomputing.app/connect/#/apps/a07fcd44-14d1-4148-89d8-1caa336ef93d/access
         Direct content URL: https://nagoiaib-duloftf-posit-software-pbc-dev.snowflakecomputing.app/content/a07fcd44-14d1-4148-89d8-1caa336ef93d/

Copy link

@mconflitti-pbc mconflitti-pbc left a comment

Choose a reason for hiding this comment

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

A few comments but otherwise looks good!

@mconflitti-pbc
Copy link

In terms of testing, is it required to test deploying all types of content or are there existing tests that would cover those capabilities since that is downstream from authentication with the server?

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.

2 participants