Skip to content

feat: Install Teradata driver on post-startup for v4.2#1264

Open
malyalaprateeprao wants to merge 1 commit into
aws:mainfrom
malyalaprateeprao:add-teradata-driver-install-v4.2
Open

feat: Install Teradata driver on post-startup for v4.2#1264
malyalaprateeprao wants to merge 1 commit into
aws:mainfrom
malyalaprateeprao:add-teradata-driver-install-v4.2

Conversation

@malyalaprateeprao

@malyalaprateeprao malyalaprateeprao commented Jul 13, 2026

Copy link
Copy Markdown

Description

Adds Teradata driver support to SageMaker Unified Studio by installing teradatasql and teradatasqlalchemy via pip during the v4.2 post-startup script, on JupyterLab space startup. This complements the Teradata connector code being added to MaxDomePythonSDK, enabling SMUS customers to run SQL cells against Teradata data sources.

These packages cannot be added as a conda-forge/SMD dependency because their license is not structured for inclusion in SMD (non-Apache/non-MIT) — confirmed with the SMD team. Installing them via pip at post-startup, non-blocking, is the recommended approach for this kind of dependency (per SMD team guidance).

Type of Change

  • Image update - New feature

Release Information

  • No (New feature or non-critical change)

How Has This Been Tested?

  • End-to-end BYOI test in a SMUS gamma domain: built a custom image combining this post-startup change with MaxDomePythonSDK's Teradata connector code (CR-250210917), launched a JupyterLab space, and confirmed sqlutils.sql_stream_with_display() successfully connects to and queries a live Teradata instance.
  • Verified the driver install succeeds normally in VpcOnly domains with a NAT Gateway (SMUS's default network configuration).
  • Verified behavior in a fully isolated VpcOnly VPC with no internet egress (no NAT Gateway/Internet Gateway): confirmed the unbounded pip install call takes several minutes to fail out via pip's default retry/backoff before the non-blocking fallback (|| echo "Warning: ...") kicks in. Added timeout 15 and --retries 1 to bound this to ~15 seconds instead, based on real measured successful-install times (3-5 seconds in working-egress environments).
  • Verified shell syntax (bash -n) on the modified script.

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Related Issues

Related to CR-250210917 (MaxDomePythonSDK Teradata connector support)

Additional Notes

This change only targets v4.2 (the current latest template at time of authoring). A v4.3 template did not yet exist in the repo when this was scoped; if v4.3's template is created as a fresh copy rather than inheriting from v4.2, this same change will need to be replicated there separately.

Add a non-blocking pip install step for teradatasql and
teradatasqlalchemy in the post-startup script, so the drivers are
available for SMUS notebook SQL cells against Teradata connections.

These packages are not published to conda-forge and cannot be added
as a bundled SDK/conda dependency, so they are installed here instead,
following the same non-blocking pattern used for sm-spark-cli-install.sh.

Bounded with 'timeout 15' and '--retries 1' so environments with no
internet egress (e.g. fully isolated VpcOnly VPCs) fail fast instead
of incurring pip's default multi-minute retry/backoff cycle on every
space start.

Validated end-to-end via BYOI in a SMUS gamma domain: combined with
MaxDomePythonSDK's Teradata connector code (CR-250210917), confirmed
sqlutils.sql_stream_with_display() successfully connects to and
queries a live Teradata instance. Also validated the driver install
succeeds in VpcOnly domains with a NAT Gateway, and fails fast (rather
than hanging) in a fully isolated VpcOnly VPC with no internet egress.
@malyalaprateeprao
malyalaprateeprao marked this pull request as ready for review July 13, 2026 22:29
@malyalaprateeprao
malyalaprateeprao requested a review from a team as a code owner July 13, 2026 22:29
# timeout + limited retries bound the delay for environments with no
# internet egress (e.g. fully isolated VpcOnly), where pip's default
# retry/backoff can otherwise take several minutes to fail out.
timeout 15 pip install --retries 1 teradatasql teradatasqlalchemy || echo "Warning: teradata driver installation failed or timed out, continuing..."

@djdax djdax Jul 14, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why "timeout" ? We should not block at all for this installation. Any time spent here will increase latency of launching JupyterLab. Send it straight to background and log a warning if it fails. "nohup pip install --retries 1 teradatasql teradatasqlalchemy &"

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