coder / envbuilder

Build development environments from a Dockerfile on Docker, Kubernetes, and OpenShift. Enable developers to modify their development environment quickly.
Apache License 2.0
123 stars 24 forks source link

feat: fetch SSH key from Coder if required #174

Closed johnstcn closed 3 months ago

johnstcn commented 3 months ago

Relates to https://github.com/coder/envbuilder/issues/31

Depends on https://github.com/coder/envbuilder/pull/173

Modifies the SSH logic introduced in https://github.com/coder/envbuilder/pull/170 with an extra step to fetch the SSH key from Coder.

There is currently a race condition between envbuilder starting and the workspace build being marked as 'completed'. To work around this, I added some backoff to fetching the SSH key using the agent token.

Demo:

https://github.com/coder/envbuilder/assets/4949514/986fc223-c50c-47dc-afc1-a251268cf0a0

matifali commented 3 months ago

Is it related to #92?

nwrkbiz commented 3 months ago

Awesome, this is was I am waiting for since a while 🙏🏻

johnstcn commented 3 months ago

Thanks @mafredri @matifali for your excellent input and comments.

The overwhelming consensus here is to avoid a direct integration and instead allow injecting a Coder user's SSH private key into the envbuilder container. There should be no further changes in envbuilder required to support this. Closing this PR out in favour of https://github.com/coder/terraform-provider-coder/issues/219