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(scripts): create both docker and tasks-docker templates by default for develop.sh#21184

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

Open
bpmct wants to merge6 commits intomain
base:main
Choose a base branch
Loading
fromfeat/add-tasks-template-flag

Conversation

@bpmct
Copy link
Member

@bpmctbpmct commentedDec 9, 2025
edited
Loading

Remove the--with-tasks flag and always create both docker and tasks-docker templates in develop.sh. This provides a better developer experience by making the tasks-docker template available automatically without requiring a flag.

When docker is available, the script now:

  • Creates the docker template (existing behavior)
  • Creates the tasks-docker template fromexamples/templates/tasks-docker
  • Pulls the container image (codercom/example-universal:ubuntu) in the background to speed up workspace creation

🤖 Generated withClaude Code

Co-Authored-By: Claude Sonnet 4.5noreply@anthropic.com

@bpmctbpmct marked this pull request as ready for reviewDecember 9, 2025 01:46
@bpmctbpmct requested a review frommatifaliDecember 9, 2025 01:46
@bpmct
Copy link
MemberAuthor

I have confirmed this works!

@bpmctbpmct requested a review fromgeokatDecember 9, 2025 22:55
@bpmctbpmctforce-pushed thefeat/add-tasks-template-flag branch froma82d8b2 to34d30a5CompareDecember 10, 2025 15:11
@bpmctbpmct changed the titlefeat(scripts): add --with-tasks flag to develop.shfeat(scripts): create both docker and tasks-docker templates by defaultDec 10, 2025
@bpmctbpmct changed the titlefeat(scripts): create both docker and tasks-docker templates by defaultfeat(scripts): create both docker and tasks-docker templates by default for developer.shDec 10, 2025
bpmctand others added4 commitsDecember 10, 2025 15:16
Add a --with-tasks flag to develop.sh that automatically sets upa tasks-compatible development environment. When enabled, it createsthe tasks-docker template and pulls the required container image inthe background to speed up workspace creation.The flag also sets a blank access URL to enable tunnel mode, whichprovides automatic subdomain support for workspace apps withoutrequiring wildcard-access-url configuration.Updated the dogfood template to use this flag by default, making iteasier to develop Coder Tasks features using Tasks itself.🤖 Generated with [Claude Code](https://claude.com/claude-code)Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The DOCKER_HOST variable was being set but not passed to the template.This commit:- Creates params.yaml with docker_socket parameter- Passes params.yaml via --variables-file flag to both template pushes- Adds docker_socket variable to tasks-docker template matching docker template patternThis ensures the template can connect to non-default Docker sockets when needed.
Per Dean's feedback, remove the --with-tasks flag and always createboth the docker and tasks-docker templates in develop.sh. This providesa better developer experience by making the tasks-docker templateavailable without requiring a flag.Changes:- Remove --with-tasks flag and associated argument parsing- Always create both docker and tasks-docker templates when docker is available- Pull container image in background for tasks-docker to speed up workspace creation- Update dogfood template to remove --with-tasks usage (no longer needed)
The main.tf changes were unrelated to this PR. Reverting to match mainbranch exactly.
@bpmctbpmctforce-pushed thefeat/add-tasks-template-flag branch from4e115ea tof98cf44CompareDecember 10, 2025 15:16
Addresses Dean's code review feedback:- Remove redundant first_org_name variable in tasks-docker section (already  defined in docker section above)- Extract template pushing logic into a shared push_template() function to  reduce code duplication between docker and tasks-docker template creation
…lateThe tasks-docker example template doesn't need custom docker socketconfiguration - it works fine with the default docker provider configuration.Removed the docker_socket variable addition and updated push_template()function to optionally use params.yaml only when it exists.
@bpmctbpmct changed the titlefeat(scripts): create both docker and tasks-docker templates by default for developer.shfeat(scripts): create both docker and tasks-docker templates by default for develop.shDec 10, 2025

DOCKER_HOST="$(docker context inspect --format'{{ .Endpoints.docker.Host }}')"
printf'docker_arch: "%s"\ndocker_host: "%s"\n'"${GOARCH}""${DOCKER_HOST}">"${temp_template_dir}/params.yaml"
(
Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal but the parenthesis are not required anymore.

Comment on lines +277 to +300
if docker info>/dev/null2>&1&&!"${CODER_DEV_SHIM}" templates versions list"${template_name}">/dev/null2>&1;then
# sometimes terraform isn't installed yet when we go to create the
# template
echo"Waiting for terraform to be installed..."
sleep 5

echo"Initializing tasks-docker template..."

# Pull the container image in the background to speed up workspace creation
container_image="codercom/example-universal:ubuntu"
echo"Pulling container image${container_image} in background..."
docker pull"${container_image}">/dev/null2>&1&

# Create template from the examples directory
temp_template_dir="$(mktemp -d)"
cp -r"${PROJECT_ROOT}/examples/templates/tasks-docker/"*"${temp_template_dir}/"

# Run terraform init so we get a terraform.lock.hcl
pushd"${temp_template_dir}"&& terraform init&&popd

(
push_template"${template_name}""${temp_template_dir}""${first_org_name}""${another_org}"
)||echo"Failed to create tasks-docker template. The template files are in${temp_template_dir}"
fi
Copy link
Member

Choose a reason for hiding this comment

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

Can we not make the regulardocker template the same as this? It's missing the terraform check, the background pulling, theterraform init. It'd be nice if these could just be identical and just be ~two lines

# sometimes terraform isn't installed yet when we go to create the
# template
echo"Waiting for terraform to be installed..."
sleep 5
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be a (bounded) loop withcommand -v terraform or something to test for it being installed rather than a sleep

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

Reviewers

@deansheatherdeansheatherdeansheather left review comments

@matifalimatifaliAwaiting requested review from matifali

@DevelopmentCatsDevelopmentCatsAwaiting requested review from DevelopmentCats

@geokatgeokatAwaiting requested review from geokat

At least 1 approving review is required to merge this pull request.

Assignees

@bpmctbpmct

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@bpmct@geokat@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp