Creating an ssh based Coder Template

Basically, I want to be able to use coder with https://alliancecan.ca/en.

I am able to do this locally as follows:
Host narval
  HostName narval.computecanada.ca
  User amcarth1
  IdentityFile ~/.ssh/compute-canada.ssh
Host narval-node
  HostName [NODENAME]
  User amcarth1
  ProxyJump narval
  ForwardAgent yes
  IdentityFile ~/.ssh/compute-canada.ssh


ssh into narval and run salloc --time=0-3:0:0 --ntasks=1 --cpus-per-task=1 --mem=4G --account=def-jjaremko. this will eventually give:

salloc: Pending job allocation 22817831
salloc: job 22817831 queued and waiting for resources
salloc: job 22817831 has been allocated resources
salloc: Granted job allocation 22817831
salloc: Waiting for resource configuration
salloc: Nodes [NODENAME] are ready for job


I can then fill the node name out in the config file, and use vscode to connect. Ideally I would use coder to automate this process (Maybe with https://registry.terraform.io/providers/loafoe/ssh/latest?). Is anyone able to advise?

My previous attempt got as far as: https://github.com/Sharpz7/Sharpz7/blob/main/templates/cc-slurm/main.tf
GitHub
Contribute to Sharpz7/Sharpz7 development by creating an account on GitHub.
Was this page helpful?