Skip to content

allow SAGEMAKER_HUB_NAME env var override for HUB_NAME constant#5784

Merged
mollyheamazon merged 2 commits intoaws:masterfrom
mollyheamazon:feat/private-hub-env
Apr 21, 2026
Merged

allow SAGEMAKER_HUB_NAME env var override for HUB_NAME constant#5784
mollyheamazon merged 2 commits intoaws:masterfrom
mollyheamazon:feat/private-hub-env

Conversation

@mollyheamazon
Copy link
Copy Markdown
Contributor

Issue

Recipes and hub content for fine-tuning trainers (SFTTrainer, DPOTrainer,
RLVRTrainer, RLAIFTrainer) and evaluators (BenchMarkEvaluator,
CustomScorerEvaluator) can only be exercised end-to-end after they ship to
the public JumpStart hub. This blocks PySDK developers from validating
recipe-dependent fixes until a JumpStart release, and prevents Studio's
private-hub E2E suite from targeting the PySDK trainer path.

Description

Internal-only change. No user-facing API change.

Switches the HUB_NAME constant in sagemaker.train.constants to read from
the SAGEMAKER_HUB_NAME environment variable, falling back to
"SageMakerPublicHub" when unset:

HUB_NAME = os.environ.get("SAGEMAKER_HUB_NAME", "SageMakerPublicHub")

Intended consumers: PySDK developers validating recipe changes locally, and
Studio's private-hub E2E suite. Not intended as a public-facing configuration
knob — no docs or public API changes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mollyheamazon mollyheamazon marked this pull request as ready for review April 21, 2026 18:47
Comment on lines +11 to +13
from sagemaker.train import constants
importlib.reload(constants)
return constants.HUB_NAME
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use a function get_sagemaker_hub_name instead of constants so its fetched on runtime ?

@mollyheamazon
Copy link
Copy Markdown
Contributor Author

Flaky test failures not related to the code change.

@mollyheamazon mollyheamazon merged commit 736781b into aws:master Apr 21, 2026
14 of 20 checks passed
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.

3 participants