-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[local-preview] Warn and Confirm from user before proceeding #13123
Conversation
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.
LGTM (did not test or review the implementation), but suggested a content change that would be good to add.
@@ -38,6 +38,20 @@ var ( | |||
) | |||
|
|||
func main() { | |||
// Warn and wait for user approval | |||
pterm.FgBlue.Println(` | |||
Welcome to the local preview of Gitpod. Please note the following limitations: |
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.
I'd suggest we change this to:
Welcome to the local preview of Gitpod. Please note the following limitations:
- Performance is limited by the capabilities of your machine - a minimum of 4 cores and 6GB of RAM are required
- ARM CPUs including Macs with Apple Silicon (e.g. M1) are currently not supported
For more information about these limitation, please visit the [local preview documentation](https://www.gitpod.io/docs/self-hosted/latest/local-preview).
--> This adds a link & removes the periods at the end of the bullet points.
--> I am assuming we can do links in the CLI output here, but not sure how / if this works.
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.
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.
In that case we should likely not try to make the http link a clickable link (with the ... ) like on the web but instead have the link as full text:
Welcome to the local preview of Gitpod. Please note the following limitations:
- Performance is limited by the capabilities of your machine - a minimum of 4 cores and 6GB of RAM are required
- ARM CPUs including Macs with Apple Silicon (e.g. M1) are currently not supported
For more information about these limitation, please visit the local preview documentation: https://www.gitpod.io/docs/self-hosted/latest/local-preview
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.
Updated. Will mark it ready once I test the final command out!
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.
While the input works with go run .
, It does not seem to work as expected when we run it inside docker. So, Trying to make that work now!
425a4f8
to
389afa8
Compare
02ef87e
to
0f9b73b
Compare
/werft run with-local-preview 👍 started the job as gitpod-build-tar-lp-warn-confirm.8 |
f57610b
to
87d8eb8
Compare
started the job as gitpod-build-tar-lp-warn-confirm.12 because the annotations in the pull request description changed |
874072d
to
e3b964a
Compare
/werft run with-local-preview 👍 started the job as gitpod-build-tar-lp-warn-confirm.16 |
06edf01
to
a5f5645
Compare
|
||
r := io.TeeReader(os.Stdin, dmp) | ||
file, err := tail.TailFile("logs.txt", tail.Config{Follow: true}) |
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.
@mrsimonemms Like we discussed in our call. This was because while logs.txt
gets updated, We just read at a point and are exiting prettylog as there is EOF.
Instead we need a way to continuously read logs.txt
as it gets updated, and this is where the tail
package comes in . By using that we are continuously reading from the latest updates, and thus updating status based on that. There seems to be a bunch of projects that are already using tail, so feels pretty standard. 👍🏼
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.
Was also able to test that this works as expected!
7e318f1
to
da6248d
Compare
Currently, For Users with ARM CPU's, `local-preview` does not really work and its hard for the script to know as it runs inside docker (which could be a x86 VM). This Updates the script to warn the users on the requirements before starting and running `local-preview`. Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
da6248d
to
d59c3e5
Compare
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.
wORKS AS EXPECTED
Description
Currently, For Users with ARM CPU's,
local-preview
does not really work and its hard for the script to know as it runs inside docker (which could be a x86 VM).This Updates the script to warn the users on the requirements before starting and running
local-preview
.The default value is also
YES
which means even when the user presses enter, we proceed forward.Signed-off-by: Tarun Pothulapati tarun@gitpod.io
Related Issue(s)
Fixes #11792
How to test
Run
Release Notes
Documentation
Werft options:
Valid options are
all
,workspace
,webapp
,ide