-
Notifications
You must be signed in to change notification settings - Fork 22
feat: Add startup_script_timeout
and delay_login_until_ready
#84
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
feat: Add startup_script_timeout
and delay_login_until_ready
#84
Conversation
Type: schema.TypeString, | ||
ForceNew: true, | ||
Optional: true, | ||
Description: "A script to run before the agent is stopped. The script should exit when it is done to signal that the workspace can be stopped.", |
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 description here, I considered commenting it out or adding (NOT YET IMPLEMENTED.)
, but we'll likely do this soon after we get the startup script changes in.
docs/resources/agent.md
Outdated
@@ -46,13 +46,15 @@ resource "kubernetes_pod" "dev" { | |||
|
|||
### Optional | |||
|
|||
- `allow_login_before_ready` (Boolean) Allow users to login to the workspace before the agent is ready. Note that, when enabled, the agent could still be executing the startup script and the workspace in an incomplete state when logging in. |
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.
@kylecarbs does this match what you were suggesting in coder/coder#5749 (comment)?
I interpreted it as an option to allow/prevent it. Is that how you intended it? Or did you intend it to be the "default behavior for login before ready"? If it's the latter, we could rename this to be just login_before_ready
instead of allow.
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 might invert the naming scheme because, eventually we'll make this default to blocking login before ready, and ideally it'd be false by default.
Apart from that we're aligned!
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 was going a back and forth on the naming a bit:
wait_until_ready
stop_login_before_ready
delay_login_until_ready
block_login_until_ready
prevent_login_before_ready
disallow_login_before_ready
deny_login_before_ready
I think delay_login_until_ready
is most descriptive and flexible option. This would allow us to implement --skip-delay-login --confirm-i-really-want-to-log-in-to-my-partially-started-workspace
flag for users trying to SSH in. 😄
Likewise if admins want to truly block the behavior (i.e. startup script must complete before you can login), we can add a second boolean to actually prevent the behavior.
Alternatively we could have something like login_before_ready: delay
, login_before_ready: no_skip
, login_before_ready: yes
.
Edit: 163bba0
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, although it might be valuable to RFC/describe incoming changes. It will be definitely more complex than adding a single timeout.
Re: RFC, is there any specific questions you have after reading coder/coder#5749? I felt it adequately describes what will be implemented but I'm happy to answer any questions. IMO it won't be a very complex change since it's focused towards fixing the |
startup_script_timeout
and allow_login_before_ready
startup_script_timeout
and delay_login_until_ready
Yes, I have a feeling that we're missing a short paragraph mainly describing changes: It's hard to figure out from |
Ref: coder/coder#5749