Commit Graph

67 Commits

Author SHA1 Message Date
f4da5d4f3a feat: add lifecycle.Executor to manage autostart and autostop (#1183)
This PR adds a package lifecycle and an Executor implementation that attempts to schedule a build of workspaces with autostart configured.

- lifecycle.Executor takes a chan time.Time in its constructor (e.g. time.Tick(time.Minute))
- Whenever a value is received from this channel, it executes one iteration of looping through the workspaces and triggering lifecycle operations.
- When the context passed to the executor is Done, it exits.
- Only workspaces that meet the following criteria will have a lifecycle operation applied to them:
  - Workspace has a valid and non-empty autostart or autostop schedule (either)
  - Workspace's last build was successful
- The following transitions will be applied depending on the current workspace state:
  - If the workspace is currently running, it will be stopped.
  - If the workspace is currently stopped, it will be started.
  - Otherwise, nothing will be done.
- Workspace builds will be created with the same parameters and template version as the last successful build (for example, template version)
2022-05-11 23:03:02 +01:00
e6f1ce1fb2 fix: Allow coderd to exit on error channel (#1355)
coderd would fail silently if this was called, because connections
would never drain. HashiCorp's hc-install package broke today,
and we couldn't notice because this was hanging!
2022-05-10 02:19:20 +00:00
ddb9631d7a fix: Group subcommands for cognitive ease (#1351) 2022-05-09 17:42:02 -05:00
ad8d9dd71a feat: make it harder to skip graceful shutdown accidentally (#1327)
* feat: make it harder to skip graceful shutdown accidentally

Signed-off-by: Spike Curtis <spike@coder.com>

* fixup: don't use unbuffered signal channel

Signed-off-by: Spike Curtis <spike@coder.com>
2022-05-06 13:45:18 -07:00
9d2e788fea feat: allow verbose logging in coder server (#1280) 2022-05-03 16:13:30 -05:00
0f9e30e54f fix: use correct enable bool for pprof (#1279) 2022-05-03 19:54:10 +00:00
55ad97bbd7 feat: add pprof and prometheus metrics to coder server (#1266) 2022-05-03 12:48:02 +00:00
a79aa6418a fix: Use cliui.WorkspaceBuild to prevent cancel of builds jobs (#1255)
Build jobs cannot gracefully terminate because Terraform generally
cannot gracefully terminate.
2022-05-02 10:20:47 -05:00
9b37a0de31 fix: Disable ErrorLog in http.Server (#1244)
Vault does similarly: e2490059d0/command/server.go (L2714)

These messages have primarily been noise.
2022-05-01 20:31:12 -05:00
afc43fe95f feat: Generate random admin user password in dev mode (#1207)
* feat: Generate random admin user password in dev mode

* Add dev mode test with email/pass from env

* Set email/pass for playwright e2e test via cli flags
2022-04-28 19:13:44 +03:00
8661f92a10 feat: Output username and password for code server --dev (#1193)
Fixes #825
2022-04-27 17:59:37 +03:00
f9ce54a51e fix: Increase default provisioner daemons to 3 (#1180)
It's odd to only build one workspace at a time as a default.
2022-04-26 07:19:17 -05:00
877854a2f3 fix: Display proper access URL on server start (#1172)
Fixes #1170.
2022-04-25 23:30:22 +00:00
88669fd578 feat: Move workspaces under organizations (#1109)
This removes split ownership for workspaces. They are now
a resource of organizations and have a designated owner,
which is a user.

This enables simple administration for commands like:
- `coder stop ben/dev`
- `coder build logs colin/arch`

or if we decide to allow administrators to access workspaces,
they could even SSH using this syntax: `coder ssh colin/dev`.
2022-04-25 16:11:03 -05:00
4417dd5951 feat: Add STUN servers to enable P2P (#1126)
This exposes a `--stun-server` option for listing
STUN servers. By default it uses the Google STUN
server, but this is not required.
2022-04-25 04:52:07 +00:00
7496c3da81 feat: Add GitHub OAuth (#1050)
* Initial oauth

* Add Github authentication

* Add AuthMethods endpoint

* Add frontend

* Rename basic authentication to password

* Add flags for configuring GitHub auth

* Remove name from API keys

* Fix authmethods in test

* Add stories and display auth methods error
2022-04-23 22:58:57 +00:00
3976994781 chore: Rename "start" to "server" (#1110)
Workspace commands will be aliased at the top-level, so
"start" would easily be confused with starting a workspace.

Server seems like a more appropriate name too.
2022-04-23 12:19:20 -05:00