-
Notifications
You must be signed in to change notification settings - Fork 318
[WIP] Add additional platform page for third-party vendor #2072
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
Draft
can-gaa-hou
wants to merge
10
commits into
pytorch:site
Choose a base branch
from
can-gaa-hou:site
base: site
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
323f25f
Add ecosystem platform page for third-party vendor
can-gaa-hou 72924bf
Add additional platform quick start module and update related workflows
can-gaa-hou 24cbcd4
Refactor additional platform quick start module: update UI elements a…
can-gaa-hou 27506b6
Enhance additional platform quick start module: integrate dynamic con…
can-gaa-hou f3e4f90
Merge branch 'site' into site
can-gaa-hou 9ad8a2d
Update text for clarity in local start guide and adjust padding in na…
can-gaa-hou 14e4a12
Remove unused script reference and add ID to stable option in additio…
can-gaa-hou e23fc65
Add note about platform-specific installation instructions in quick s…
can-gaa-hou 70685e7
Update additional platforms quick start module and add support channel
can-gaa-hou 410b924
Add Additional Platforms Integration Guide for third-party vendors
can-gaa-hou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| layout: get_started | ||
| title: Additional Platforms | ||
| permalink: /get-started/additional-platforms/ | ||
| background-class: get-started-background | ||
| body-class: get-started | ||
| order: 1 | ||
| published: true | ||
| get-started-additional: true | ||
| --- | ||
|
|
||
| <div class="container-fluid quick-start-module quick-starts"> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| {% include quick_start_additional_platforms.html %} | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| --- | ||
| <div id="additional-platforms-installation"> | ||
| <!-- Platform content divs will be dynamically created by JavaScript --> | ||
| </div> | ||
|
|
||
| <script page-id="get-started-additional-platforms" src="{{ site.baseurl }}/assets/menu-tab-selection.js"></script> | ||
| <script src="{{ site.baseurl }}/assets/quick-start-additional-platforms.js"></script> | ||
| <script src="{{ site.baseurl }}/assets/get-started-sidebar.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,279 @@ | ||
| // ===================================================== | ||
| // Additional Platforms Quick Start Module | ||
| // ===================================================== | ||
|
|
||
| // Platform data loaded from JSON files (generated by gen_additional_platforms.py) | ||
| var ecosystemPlatformData = {{ platformData }}; | ||
|
|
||
| // HTML content loaded from _get_started/additional_platforms/ directory | ||
| // (pre-converted by Python script with syntax highlighting) | ||
| var ecosystemHtmlContent = {{ markdownContent }}; | ||
|
|
||
| // Get platform IDs from loaded data | ||
| var ecosystemPlatformIds = Object.keys(ecosystemPlatformData); | ||
|
|
||
| // Ecosystem platform selections - simplified (no pm, no version) | ||
| var ecosystemOpts = { | ||
| build: 'stable', | ||
| os: 'linux', | ||
| platform: null | ||
| }; | ||
|
|
||
| // Parse URL parameters for pre-selection | ||
| function parseUrlParams() { | ||
| var params = new URLSearchParams(window.location.search); | ||
| var platform = params.get('platform'); | ||
| var build = params.get('build') || 'stable'; | ||
| var os = params.get('os') || 'linux'; | ||
|
|
||
| return { | ||
| platform: platform, | ||
| build: build, | ||
| os: os | ||
| }; | ||
| } | ||
|
|
||
| // Apply URL parameter selections | ||
| function applyUrlSelections() { | ||
| var urlParams = parseUrlParams(); | ||
|
|
||
| // Apply build selection | ||
| if (urlParams.build && ecosystemOpts.build !== urlParams.build) { | ||
| ecosystemOpts.build = urlParams.build; | ||
| $('.pytorch-build > .option').removeClass('selected'); | ||
| $('.pytorch-build > .option#' + urlParams.build).addClass('selected'); | ||
| } | ||
|
|
||
| // Apply OS selection | ||
| if (urlParams.os && ecosystemOpts.os !== urlParams.os) { | ||
| ecosystemOpts.os = urlParams.os; | ||
| $('.os-ecosystem > .option').removeClass('selected'); | ||
| $('.os-ecosystem > .option#' + urlParams.os).addClass('selected'); | ||
| } | ||
|
|
||
| // Apply platform selection | ||
| if (urlParams.platform && ecosystemPlatformData[urlParams.platform]) { | ||
| ecosystemOpts.platform = urlParams.platform; | ||
| $('.compute-platform > .option').removeClass('selected'); | ||
| $('.compute-platform > .option#' + urlParams.platform).addClass('selected'); | ||
| updateEcosystemCommand(); | ||
| updatePlatformContentDisplay(); | ||
| } | ||
| } | ||
|
|
||
| // Initialize additional platforms when document is ready | ||
| $(function() { | ||
| initPlatformContentContainer(); | ||
| initAdditionalPlatforms(); | ||
| initAdditionalPlatformButtons(); | ||
| updatePlatformButtonStates(); | ||
| syncComputePlatformHeight(); | ||
| initPlatformContentDisplay(); | ||
|
|
||
| // Apply URL parameter selections after initialization | ||
| applyUrlSelections(); | ||
| }); | ||
|
|
||
| // Initialize platform content container - dynamically create divs for each platform | ||
| function initPlatformContentContainer() { | ||
| var container = $('#additional-platforms-installation'); | ||
| if (!container.length) return; | ||
|
|
||
| // Clear any existing static content | ||
| container.empty(); | ||
|
|
||
| // Create platform content divs dynamically based on HTML content | ||
| ecosystemPlatformIds.forEach(function(platformId) { | ||
| if (ecosystemHtmlContent[platformId]) { | ||
| var contentDiv = $('<div class="platform-content ' + platformId + '"></div>'); | ||
| // HTML content is already pre-converted with syntax highlighting | ||
| contentDiv.html(ecosystemHtmlContent[platformId]); | ||
| container.append(contentDiv); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| // Note: Markdown is pre-converted to HTML by Python script (gen_additional_platforms.py) | ||
| // using markdown library with codehilite extension for syntax highlighting. | ||
| // No need for client-side markdown parsing. | ||
|
|
||
| // Initialize platform content display - hide all initially | ||
| function initPlatformContentDisplay() { | ||
| $('#additional-platforms-installation .platform-content').hide(); | ||
| } | ||
|
|
||
| // Sync left heading height with right compute platform buttons height | ||
| function syncComputePlatformHeight() { | ||
| var rightHeight = $('.compute-platform').outerHeight(); | ||
| if (rightHeight > 0) { | ||
| $('.compute-platform-heading').css('min-height', rightHeight + 'px'); | ||
| } | ||
| } | ||
|
|
||
| // Populate compute platform buttons | ||
| function initAdditionalPlatformButtons() { | ||
| var platformRow = $('.compute-platform'); | ||
| if (!platformRow.length) return; | ||
|
|
||
| // Generate platform buttons | ||
| ecosystemPlatformIds.forEach(function(platformId) { | ||
| var platform = ecosystemPlatformData[platformId]; | ||
| if (!platform) return; | ||
| var displayName = platform.name; | ||
| var btn = $('<div class="col-md-3 option block" id="' + platformId + '"><div class="option-text">' + displayName + '</div></div>'); | ||
| platformRow.append(btn); | ||
| }); | ||
|
|
||
| // Sync height after buttons are generated | ||
| syncComputePlatformHeight(); | ||
|
|
||
| // Bind platform button click | ||
| $('.compute-platform > .option').on('click', function() { | ||
| var platformId = this.id; | ||
| var platform = ecosystemPlatformData[platformId]; | ||
| if (!platform) return; | ||
|
|
||
| // Check if supported on current OS | ||
| var supportedOS = getSupportedOS(platformId); | ||
| if (!supportedOS.includes(ecosystemOpts.os)) { | ||
| $('#command').html('<i>' + platform.name + ' is not supported on ' + ecosystemOpts.os + '</i>'); | ||
| return; | ||
| } | ||
|
|
||
| // Select this platform | ||
| $('.compute-platform > .option').removeClass('selected'); | ||
| $(this).addClass('selected'); | ||
| ecosystemOpts.platform = platformId; | ||
|
|
||
| updateEcosystemCommand(); | ||
| updatePlatformContentDisplay(); | ||
| }); | ||
| } | ||
|
|
||
| // Get supported OS list from platform data structure | ||
| function getSupportedOS(platformId) { | ||
| var platform = ecosystemPlatformData[platformId]; | ||
| if (!platform) return []; | ||
|
|
||
| var osSet = new Set(); | ||
| ['stable', 'preview'].forEach(function(build) { | ||
| if (platform[build]) { | ||
| Object.keys(platform[build]).forEach(function(os) { | ||
| osSet.add(os); | ||
| }); | ||
| } | ||
| }); | ||
| return Array.from(osSet); | ||
| } | ||
|
|
||
| // Update platform button states (disabled/enabled) based on OS | ||
| function updatePlatformButtonStates() { | ||
| $('.compute-platform > .option').each(function() { | ||
| var platformId = this.id; | ||
| if (!platformId) return; | ||
|
|
||
| var supportedOS = getSupportedOS(platformId); | ||
| var isSupported = supportedOS.includes(ecosystemOpts.os); | ||
|
|
||
| if (isSupported) { | ||
| $(this).css('text-decoration', ''); | ||
| } else { | ||
| $(this).css('text-decoration', 'line-through'); | ||
| } | ||
| }); | ||
|
|
||
| // If currently selected platform is not supported on new OS, deselect it | ||
| if (ecosystemOpts.platform) { | ||
| var supportedOS = getSupportedOS(ecosystemOpts.platform); | ||
| if (!supportedOS.includes(ecosystemOpts.os)) { | ||
| ecosystemOpts.platform = null; | ||
| $('.compute-platform > .option').removeClass('selected'); | ||
| $('#command').html('Select a compute platform to see the installation command.'); | ||
| updatePlatformContentDisplay(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Update platform content display based on selected platform | ||
| function updatePlatformContentDisplay() { | ||
| // Hide all platform content first | ||
| $('#additional-platforms-installation .platform-content').hide(); | ||
|
|
||
| // Show selected platform content | ||
| if (ecosystemOpts.platform) { | ||
| $('#additional-platforms-installation .platform-content.' + ecosystemOpts.platform).show(); | ||
| } | ||
| } | ||
|
|
||
| // Initialize all click events for build/os blocks | ||
| function initAdditionalPlatforms() { | ||
| // PyTorch Build | ||
| $('.pytorch-build > .option').on('click', function() { | ||
| $('.pytorch-build > .option').removeClass('selected'); | ||
| $(this).addClass('selected'); | ||
| ecosystemOpts.build = this.id; | ||
| updateEcosystemCommand(); | ||
| }); | ||
|
|
||
| // OS - with platform support check | ||
| $('.os-ecosystem > .option').on('click', function() { | ||
| $('.os-ecosystem > .option').removeClass('selected'); | ||
| $(this).addClass('selected'); | ||
| ecosystemOpts.os = this.id; | ||
|
|
||
| updatePlatformButtonStates(); | ||
| updateEcosystemCommand(); | ||
| }); | ||
| } | ||
|
|
||
| // Update ecosystem command based on selections - simplified | ||
| function updateEcosystemCommand() { | ||
| if (!ecosystemOpts.platform) { | ||
| $('#command').html('Select a compute platform to see the installation command.'); | ||
| $('#support-channel').html('Select a compute platform to see the support channel.'); | ||
| return; | ||
| } | ||
|
|
||
| var platform = ecosystemPlatformData[ecosystemOpts.platform]; | ||
| if (!platform) { | ||
| $('#command').html('Loading platform data...'); | ||
| $('#support-channel').html('Loading platform data...'); | ||
| return; | ||
| } | ||
|
|
||
| // Check if OS is supported | ||
| var supportedOS = getSupportedOS(ecosystemOpts.platform); | ||
| if (!supportedOS.includes(ecosystemOpts.os)) { | ||
| $('#command').html('<i>' + platform.name + ' is not supported on ' + ecosystemOpts.os + '</i>'); | ||
| $('#support-channel').html('<i>Select a supported platform to see the support channel.</i>'); | ||
| return; | ||
| } | ||
|
|
||
| // Get command directly from platform[build][os] | ||
| try { | ||
| var buildData = platform[ecosystemOpts.build]; | ||
| if (!buildData || !buildData[ecosystemOpts.os]) { | ||
| $('#command').html('<i>Configuration not available for this combination</i>'); | ||
| $('#support-channel').html('<i>Select a valid combination to see the support channel.</i>'); | ||
| return; | ||
| } | ||
|
|
||
| var cmd = buildData[ecosystemOpts.os]; | ||
|
|
||
| if (cmd) { | ||
| $('#command').html('<pre>' + cmd + '</pre>'); | ||
| } else { | ||
| $('#command').html('<i>Configuration not available for this combination</i>'); | ||
| } | ||
|
|
||
| // Update support channel | ||
| if (platform.support_channel) { | ||
| $('#support-channel').html('<a href="' + platform.support_channel + '" target="_blank">' + platform.support_channel + '</a>'); | ||
| } else { | ||
| $('#support-channel').html('<i>No support channel available for this platform.</i>'); | ||
| } | ||
| } catch (e) { | ||
| $('#command').html('<i>Configuration not available for this combination</i>'); | ||
| $('#support-channel').html('<i>Configuration not available</i>'); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.