Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: addcoder_script#154

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kylecarbs merged 3 commits intomainfromscript
Sep 13, 2023
Merged

feat: addcoder_script#154

kylecarbs merged 3 commits intomainfromscript
Sep 13, 2023

Conversation

kylecarbs
Copy link
Member

Seecoder/coder#9287

I decided to drop theagent portion from the name. It seemed inconsistent withcoder_app.

Wait for the PR intocoder/coder before thoroughly reviewing.

@kylecarbskylecarbs self-assigned thisSep 7, 2023
Seecoder/coder#9287I decided to drop the `agent` portion from the name. It seemed inconsistentwith `coder_app`.

### Optional

- `login_before_ready` (Boolean) This option defines whether or not the user can (by default) login to the workspace before it is ready. Ready means that e.g. the script is done and has exited. When enabled, users may see an incomplete workspace when logging in.
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Why do we have this? I guess we're replacingstartup_script_behavior?

Could we dobehavior=blocking?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It is replacing that. Thebehavior=blocking is kinda weird, because there's alsocron.

I could dologin_behavior=after_start, but I'd rather just have it as a bool with the key.

- `run_on_start` (Boolean) This option defines whether or not the script should run when the agent starts.
- `run_on_stop` (Boolean) This option defines whether or not the script should run when the agent stops.
- `schedule` (String) The schedule to run the script on. This is a cron expression.
- `timeout` (Number) Time in seconds until the agent lifecycle status is marked as timed out, this happens when the script has not completed (exited) in the given time.
Copy link
Member

Choose a reason for hiding this comment

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

Can you document what you set this to if it's a long-running process? Or I guess we want people to ampersand things&

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm going to allow long-running operations that consistently log, so I'll update this.

"icons here: https://github.com/coder/coder/tree/main/site/static/icon. Use a " +
"built-in icon with `data.coder_workspace.me.access_url + \"/icon/<path>\"`.",
},
"source": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The docs sayscripts but this sayssource. I preferscript tbh, especially if it's supposed to be an inline script as opposed to an existing file.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hmm, fair. Source could mean like GitHub or something wack, I'll change it back

### Optional

- `cron` (String) The cron schedule to run the script on. This is a cron expression.
- `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons here: https://github.com/coder/coder/tree/main/site/static/icon. Use a built-in icon with `data.coder_workspace.me.access_url + "/icon/<path>"`.
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have icon? Do we want to display all of them on the dashboard?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes. These scripts will be displayed in the dashboard.

matifali reacted with thumbs up emoji
Optional: true,
Description: "This option defines whether or not the script should run when the agent stops.",
},
"timeout": {
Copy link
Member

Choose a reason for hiding this comment

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

For cron jobs that userclone to do a backup every 5 minutes, will this timeout cancel them? Backup time is usually variable and is a function of activity in the workspace directory. e.g., number of files, size of files, etc.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes. You'd want to add a very lengthy timeout in that case, or not have one at all.

Right now, when two CRONs overlap, the prior process won't end.

matifali reacted with thumbs up emoji
Copy link
Member

@matifalimatifali left a comment

Choose a reason for hiding this comment

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

A few comments about displayingcoder_script resources in the dashboard.

### Required

- `agent_id` (String) The "id" property of a "coder_agent" resource to associate with.
- `display_name` (String) The display name of the script to display logs in the dashboard.
Copy link
Member

Choose a reason for hiding this comment

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

Same fordisplay_name. I am wondering how we will display them in a better way without overcrowding the dashboard.

IMO, acoder_app provides interactive access to a service, but acoder_script will not, so I am not convinced about how and if we should display them.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I have a nice UI mock that displays this!

matifali reacted with thumbs up emoji
@kylecarbskylecarbs merged commit9495777 intomainSep 13, 2023
@kylecarbskylecarbs deleted the script branchSeptember 13, 2023 14:27
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 13, 2023
@matifali
Copy link
Member

Closescoder/coder#9615

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@matifalimatifalimatifali left review comments

@sreyasreyasreya approved these changes

@bpmctbpmctbpmct approved these changes

Assignees

@kylecarbskylecarbs

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@kylecarbs@matifali@sreya@bpmct

[8]ページ先頭

©2009-2025 Movatter.jp