-
Notifications
You must be signed in to change notification settings - Fork 11
Enable code tab docs #629
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
Merged
Merged
Enable code tab docs #629
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
379f854
Enable code tab docs
EngHabu 95ffff9
wip
EngHabu ea46742
Move images to match doc path
EngHabu a6d6ab8
fix image path
EngHabu 7502ec4
Fix caption
EngHabu 34ad0fa
Add markdown blocks to fix rendering
ppiegaze a61ea01
rewording
EngHabu 8ec8075
Merge remote-tracking branch 'origin/enghabu/code-tab' into enghabu/c…
EngHabu a640c53
Merge branch 'main' into enghabu/code-tab
ppiegaze 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,97 @@ | ||
| --- | ||
| title: Code Viewer | ||
| weight: 1 | ||
| variants: -flyte -serverless -byoc +selfmanaged | ||
| --- | ||
|
|
||
| # Code Viewer | ||
| One of the powerful capabilities in the Union UI is the ability to view the exact code that ran a particular task. | ||
| Union Union implements a secure mechanism to transfer the [code bundle](../../user-guide/run-scaling/life-of-a-run.md/#phase-2-image-building) to the browser without passing through the control plane. | ||
|
|
||
|  | ||
|
|
||
| ## Enable CORS policy on your fast registration bucket | ||
| In order to support this functionality securely, your bucket must allow CORS access for Union. Depending on which cloud the bucket is located in, these configurations vary. | ||
|
|
||
| {{< tabs "bucket-cors-policy" >}} | ||
| {{< tab "AWS S3 Console" >}} | ||
| {{< markdown >}} | ||
| 1. Access AWS Console | ||
| 2. Access S3 dashboard | ||
| 3. Choose the fast registration bucket. Unless configured differently, this is the same as the metadata bucket configured when you first | ||
| deployed. | ||
| 4. Click on "Permissions" tab and scroll to "CORS Policy" | ||
| 5. Click on Edit and enter the policy below | ||
|  | ||
| ``` | ||
| [ | ||
| { | ||
| "AllowedHeaders": [ | ||
| "*" | ||
| ], | ||
| "AllowedMethods": [ | ||
| "GET", | ||
| "HEAD", | ||
| ], | ||
| "AllowedOrigins": [ | ||
| "https://*.unionai.cloud" | ||
| ], | ||
| "ExposeHeaders": [ | ||
| "ETag" | ||
| ], | ||
| "MaxAgeSeconds": 3600 | ||
| } | ||
| ] | ||
| ``` | ||
| Further reference: [AWS Guide on S3 CORS Policy](https://docs.aws.amazon.com/AmazonS3/latest/userguide/cors.html) | ||
| {{< /markdown >}} | ||
| {{< /tab >}} | ||
| {{< tab "Google GCS" >}} | ||
| {{< markdown >}} | ||
| Google GCS does not allow changing the bucket policy through the console. | ||
| 1. Create a cors.json configuration file and paste the content below | ||
| ```json | ||
| [ | ||
| { | ||
| "origin": ["https://*.unionai.cloud"], | ||
| "method": ["HEAD", "GET"], | ||
| "responseHeader": ["ETag"], | ||
| "maxAgeSeconds": 3600 | ||
| } | ||
| ] | ||
| ``` | ||
| 2. Apply the cors configuration: | ||
| ```bash | ||
| gcloud storage buckets update gs://<fast_registration_bucket> --cors-file=cors.json | ||
| ``` | ||
| 3. View configuration to confirm: | ||
| ```bash | ||
| gcloud storage buckets describe gs://<fast_registration_bucket> --format="default(cors_config)" | ||
|
|
||
| cors_config: | ||
| - maxAgeSeconds: 3600 | ||
| method: | ||
| - GET | ||
| - HEAD | ||
| origin: | ||
| - https://*.unionai.cloud | ||
| responseHeader: | ||
| - ETag | ||
| ``` | ||
| Further reference: [Google Guide on GCS CORS Policy](https://docs.cloud.google.com/storage/docs/using-cors#command-line) | ||
| {{< /markdown >}} | ||
| {{< /tab >}} | ||
| {{< tab "Azure Storage" >}} | ||
| {{< markdown >}} | ||
| Further reference: [Azure Guide on Storage CORS Policy](https://learn.microsoft.com/en-us/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) | ||
| {{< /markdown >}} | ||
| {{< /tab >}} | ||
| {{< /tabs >}} | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| | Error Message | Cause | Fix | | ||
| |---------------|-------|-----| | ||
| | `Not available: No code available for this action.` | The underlying task doesn't have a code bundle, this could be because all code is already in the underlying docker image or the task isn't a code task. | Expected behavior for non-code-bundled tasks | | ||
| | `Not Found: The code bundle file could not be found. This may be due to your organization's data retention policy.` | The task does use a code bundle but the underlying bundle isn't found in the bucket. | Check fast registration bucket retention policy | | ||
| | `Error: Code download is blocked by your storage bucket's configuration. Please contact your administrator to enable access.` | CORS isn't properly configured on the bucket | Refer to the above guide to enable CORS. | | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo "Union Union"