Skip to content
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

Update agents.mdx #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

darrell-fashun
Copy link

Adding use case for agent single execution mode when runs are queued from the UI

What

Why

Screenshots


Merge Checklist

If items do not apply to your changes, add (N/A) and mark them as complete.

Pull Request

  • One or more labels describe the type of change (e.g. clarification) and associated product (e.g. tfc).
  • Description links to related pull requests or issues, if any.

Content

  • Redirects have been added for moved, renamed, or deleted pages. This requires a separate PR in the terraform-website repository redirects.next.js file.
  • API documentation and the API Changelog have been updated.
  • Links to related content where appropriate (e.g., API endpoints, permissions, etc.).
  • Pages with related content are updated and link to this content when appropriate.
  • Sidebar navigation files have been updated for added, deleted, reordered, or renamed pages.
  • New pages have metadata (page name and description) at the top.
  • New images are 2048 px wide. They have HashiCorp standard annotation color (#F92672) and format (rectangle with rounded corners), blurred sensitive details (e.g. credentials, usernames, user icons), and descriptive alt text in the markdown for accessibility.
  • New code blocks have the correct syntax and line breaks to eliminate horizontal scroll bars.
  • UI elements (button names, page names, etc.) are bolded.
  • The Vercel website preview successfully deployed.

Reviews

  • I or someone else reviewed the content for technical accuracy.
  • I or someone else reviewed the content for typos, punctuation, spelling, and grammar.

Adding use case for agent single execution mode when runs are queued from the UI
@vercel
Copy link

vercel bot commented Nov 18, 2022

@darrell-fashun is attempting to deploy a commit to the HashiCorp Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@tbehling tbehling left a comment

Choose a reason for hiding this comment

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

Thanks for doing this PR @darrell-fashun ! For context this is the slack thread that lead to this PR.

Darrell contributed this PR after noticing the docs opportunity as a TF support engineer. It would be great if someone from the main docs team could review this and ship it using the appropriate process.

Comment on lines +88 to +92
You can also configure the agent to run in single-execution mode, which ensures that the agent only runs a single workload, then terminates. You can use this configuration in combination with Docker and a process supervisor to ensure a clean working environment for every Terraform run. Agents in single -execution mode perform one operation at a time. Plan and apply are separate operations and would require an agent per operation.

~>**Important:** When an agent is placed in Single-Execution Mode, if the plan and apply operation is queued from the UI, after the plan has completed its part the agent (placed in single-execution mode) will exit, leaving the apply operation without a agent to process against. The apply operation will then enter in a queued state until an agent process is available. This is the expected behavior as agents in single mode perform one operation at a time.

~>To get around this you’d need to create two distinct agents in single execution mode, under the same agent pool that is configured for the associated workspace execution mode to work through a whole queue plan and apply run operation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can also configure the agent to run in single-execution mode, which ensures that the agent only runs a single workload, then terminates. You can use this configuration in combination with Docker and a process supervisor to ensure a clean working environment for every Terraform run. Agents in single -execution mode perform one operation at a time. Plan and apply are separate operations and would require an agent per operation.
~>**Important:** When an agent is placed in Single-Execution Mode, if the plan and apply operation is queued from the UI, after the plan has completed its part the agent (placed in single-execution mode) will exit, leaving the apply operation without a agent to process against. The apply operation will then enter in a queued state until an agent process is available. This is the expected behavior as agents in single mode perform one operation at a time.
~>To get around this you’d need to create two distinct agents in single execution mode, under the same agent pool that is configured for the associated workspace execution mode to work through a whole queue plan and apply run operation.
You can also configure the agent to run in single-execution mode, which ensures that the agent only runs a single workload, then terminates. You can use this configuration in combination with Docker and a process supervisor to ensure a clean working environment for every Terraform run.
Agents in single-execution mode perform one operation at a time. Plan and apply are separate operations, so they each require an agent. When you queue a plan and apply from the Terraform Cloud UI, agents in single-execution mode exit after the plan is complete. The apply operation then remains in a queued state until an agent process is available.
To change this behavior, create two agents in single-execution mode and add them to the same agent pool. Then, you configure the agent pool to handle the entire plan and apply run within workspaces.

Copy link
Member

Choose a reason for hiding this comment

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

I think this suggestion needs to be merged in prior to merging the PR 👌

Copy link
Contributor

@laurapacilio laurapacilio left a comment

Choose a reason for hiding this comment

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

Hi! Thank you so much for contributing to our docs! :)

I made a few edits to make things flow, and I am trying taking out the yellow bit. We really try to reserve those for like EMERGENCIES in the docs/times when we really need to grab users' attention. I'm hoping that the way it's written now will help users without the callout box. But let me know if you disagree!

@vercel
Copy link

vercel bot commented Nov 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
terraform-docs-agents ✅ Ready (Inspect) Visit Preview Nov 18, 2022 at 8:51PM (UTC)

@laurapacilio
Copy link
Contributor

Screen Shot 2022-11-18 at 5 07 09 PM

@darrell-fashun - here's a screenshot of the current preview, without my changes. The formatting for the yellow boxes isn't quite right, but you can actually see how it might all look as text! I can show you another preview once you add the changes in, if that's helpful. Thank you!

Copy link
Member

@ryanuber ryanuber left a comment

Choose a reason for hiding this comment

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

I'd love to see Laura's suggestion implemented, then I'd be ready to ✅

Comment on lines +88 to +92
You can also configure the agent to run in single-execution mode, which ensures that the agent only runs a single workload, then terminates. You can use this configuration in combination with Docker and a process supervisor to ensure a clean working environment for every Terraform run. Agents in single -execution mode perform one operation at a time. Plan and apply are separate operations and would require an agent per operation.

~>**Important:** When an agent is placed in Single-Execution Mode, if the plan and apply operation is queued from the UI, after the plan has completed its part the agent (placed in single-execution mode) will exit, leaving the apply operation without a agent to process against. The apply operation will then enter in a queued state until an agent process is available. This is the expected behavior as agents in single mode perform one operation at a time.

~>To get around this you’d need to create two distinct agents in single execution mode, under the same agent pool that is configured for the associated workspace execution mode to work through a whole queue plan and apply run operation.
Copy link
Member

Choose a reason for hiding this comment

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

I think this suggestion needs to be merged in prior to merging the PR 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants