feat: add boundary pprof server in claude-code module (#503)
This commit is contained in:
parent
f7c1be71f7
commit
30123e7ea3
@ -13,7 +13,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude
|
|||||||
```tf
|
```tf
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "3.2.2"
|
version = "3.3.0"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
claude_api_key = "xxxx-xxxxx-xxxx"
|
claude_api_key = "xxxx-xxxxx-xxxx"
|
||||||
@ -51,7 +51,7 @@ module "claude-code" {
|
|||||||
boundary_log_level = "WARN"
|
boundary_log_level = "WARN"
|
||||||
boundary_additional_allowed_urls = ["GET *google.com"]
|
boundary_additional_allowed_urls = ["GET *google.com"]
|
||||||
boundary_proxy_port = "8087"
|
boundary_proxy_port = "8087"
|
||||||
version = "3.2.1"
|
version = "3.3.0"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ data "coder_parameter" "ai_prompt" {
|
|||||||
|
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "3.2.2"
|
version = "3.3.0"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ Run and configure Claude Code as a standalone CLI in your workspace.
|
|||||||
```tf
|
```tf
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "3.2.2"
|
version = "3.3.0"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
workdir = "/home/coder"
|
workdir = "/home/coder"
|
||||||
install_claude_code = true
|
install_claude_code = true
|
||||||
@ -129,7 +129,7 @@ variable "claude_code_oauth_token" {
|
|||||||
|
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "3.2.2"
|
version = "3.3.0"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
claude_code_oauth_token = var.claude_code_oauth_token
|
claude_code_oauth_token = var.claude_code_oauth_token
|
||||||
@ -202,7 +202,7 @@ resource "coder_env" "bedrock_api_key" {
|
|||||||
|
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "3.2.2"
|
version = "3.3.0"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
||||||
@ -259,7 +259,7 @@ resource "coder_env" "google_application_credentials" {
|
|||||||
|
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "3.2.2"
|
version = "3.3.0"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
model = "claude-sonnet-4@20250514"
|
model = "claude-sonnet-4@20250514"
|
||||||
|
|||||||
@ -228,6 +228,18 @@ variable "boundary_proxy_port" {
|
|||||||
default = "8087"
|
default = "8087"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "enable_boundary_pprof" {
|
||||||
|
type = bool
|
||||||
|
description = "Whether to enable coder boundary pprof server"
|
||||||
|
default = false
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "boundary_pprof_port" {
|
||||||
|
type = string
|
||||||
|
description = "Port for pprof server used by Boundary"
|
||||||
|
default = "6067"
|
||||||
|
}
|
||||||
|
|
||||||
resource "coder_env" "claude_code_md_path" {
|
resource "coder_env" "claude_code_md_path" {
|
||||||
count = var.claude_md_path == "" ? 0 : 1
|
count = var.claude_md_path == "" ? 0 : 1
|
||||||
|
|
||||||
@ -343,6 +355,8 @@ module "agentapi" {
|
|||||||
ARG_BOUNDARY_LOG_LEVEL='${var.boundary_log_level}' \
|
ARG_BOUNDARY_LOG_LEVEL='${var.boundary_log_level}' \
|
||||||
ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS='${join(" ", var.boundary_additional_allowed_urls)}' \
|
ARG_BOUNDARY_ADDITIONAL_ALLOWED_URLS='${join(" ", var.boundary_additional_allowed_urls)}' \
|
||||||
ARG_BOUNDARY_PROXY_PORT='${var.boundary_proxy_port}' \
|
ARG_BOUNDARY_PROXY_PORT='${var.boundary_proxy_port}' \
|
||||||
|
ARG_ENABLE_BOUNDARY_PPROF='${var.enable_boundary_pprof}' \
|
||||||
|
ARG_BOUNDARY_PPROF_PORT='${var.boundary_pprof_port}' \
|
||||||
ARG_CODER_HOST='${local.coder_host}' \
|
ARG_CODER_HOST='${local.coder_host}' \
|
||||||
/tmp/start.sh
|
/tmp/start.sh
|
||||||
EOT
|
EOT
|
||||||
|
|||||||
@ -22,6 +22,8 @@ ARG_BOUNDARY_VERSION=${ARG_BOUNDARY_VERSION:-"main"}
|
|||||||
ARG_BOUNDARY_LOG_DIR=${ARG_BOUNDARY_LOG_DIR:-"/tmp/boundary_logs"}
|
ARG_BOUNDARY_LOG_DIR=${ARG_BOUNDARY_LOG_DIR:-"/tmp/boundary_logs"}
|
||||||
ARG_BOUNDARY_LOG_LEVEL=${ARG_BOUNDARY_LOG_LEVEL:-"WARN"}
|
ARG_BOUNDARY_LOG_LEVEL=${ARG_BOUNDARY_LOG_LEVEL:-"WARN"}
|
||||||
ARG_BOUNDARY_PROXY_PORT=${ARG_BOUNDARY_PROXY_PORT:-"8087"}
|
ARG_BOUNDARY_PROXY_PORT=${ARG_BOUNDARY_PROXY_PORT:-"8087"}
|
||||||
|
ARG_ENABLE_BOUNDARY_PPROF=${ARG_ENABLE_BOUNDARY_PPROF:-false}
|
||||||
|
ARG_BOUNDARY_PPROF_PORT=${ARG_BOUNDARY_PPROF_PORT:-"6067"}
|
||||||
ARG_CODER_HOST=${ARG_CODER_HOST:-}
|
ARG_CODER_HOST=${ARG_CODER_HOST:-}
|
||||||
|
|
||||||
echo "--------------------------------"
|
echo "--------------------------------"
|
||||||
@ -155,6 +157,12 @@ function start_agentapi() {
|
|||||||
# Set log level for boundary
|
# Set log level for boundary
|
||||||
BOUNDARY_ARGS+=(--log-level $ARG_BOUNDARY_LOG_LEVEL)
|
BOUNDARY_ARGS+=(--log-level $ARG_BOUNDARY_LOG_LEVEL)
|
||||||
|
|
||||||
|
if [ "${ARG_ENABLE_BOUNDARY_PPROF:-false}" = "true" ]; then
|
||||||
|
# Enable boundary pprof server on specified port
|
||||||
|
BOUNDARY_ARGS+=(--pprof)
|
||||||
|
BOUNDARY_ARGS+=(--pprof-port ${ARG_BOUNDARY_PPROF_PORT})
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove --dangerously-skip-permissions from ARGS when using boundary (it doesn't work with elevated permissions)
|
# Remove --dangerously-skip-permissions from ARGS when using boundary (it doesn't work with elevated permissions)
|
||||||
# Create a new array without the dangerous permissions flag
|
# Create a new array without the dangerous permissions flag
|
||||||
CLAUDE_ARGS=()
|
CLAUDE_ARGS=()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user