Skip to content

Support dependencies between modules #410

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

Closed
ffais opened this issue Feb 21, 2025 · 1 comment
Closed

Support dependencies between modules #410

ffais opened this issue Feb 21, 2025 · 1 comment

Comments

@ffais
Copy link
Contributor

ffais commented Feb 21, 2025

We are trying to use the depends_on property between modules but for some reason it doesn't seem to work.
In the example below the modules are executed in parallel despite the depends_on directive.

module "personalize" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/modules/personalize/coder"
  version  = "1.0.2"
  agent_id = coder_agent.jupyter.id
  path     = "/scripts/run.sh"
  log_path = "/tmp/personalize.log"
}

module "jupyterlab" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/modules/jupyterlab/coder"
  version  = "1.0.30"
  agent_id = coder_agent.jupyter.id
  port     = 8888
  depends_on = [
    module.personalize
  ]
}
@matifali
Copy link
Member

matifali commented Feb 21, 2025

This is because Terraform is an infrastructure tool; it respects the depends_on but only while creating the resources.

Unfortunately, the modules run coder_script inside the workspace after the infrastructure is complete.

We are tracking the module's execution ordering in #93

And the upstream issue to track coder_script execution ordering is coder/coder#10352

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

No branches or pull requests

2 participants