Commit Graph

2400 Commits

Author SHA1 Message Date
9dd9fedc12 Implement strict prebuilds eligibility
See https://github.com/coder/internal/issues/372

Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-18 09:39:04 +00:00
e9fdd86c45 Merge branch 'jjs/presets' of github.com:/coder/coder into dk/prebuilds 2025-02-18 08:32:25 +00:00
9df08f76d7 make lint; make fmt
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-18 08:20:27 +00:00
0a94405c3f Move prebuilds code to enterprise top-level package, refactor into agpl pointers
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-18 08:20:17 +00:00
7498980c5f Hide prebuilds behind premium license & experiment
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-17 13:03:56 +00:00
46e04c68e3 feat(provisioner): add support for presets to coder provisioners (#16574)
This pull request adds support for presets to coder provisioners.
If a template defines presets using a compatible version of the
provider, then this PR will allow those presets to be persisted to the
control plane database for use in workspace creation.
2025-02-17 13:00:44 +02:00
77306f3de1 feat(coderd): add filters and fix template for provisioner daemons (#16558)
This change adds provisioner daemon ID filter to the provisioner daemons
endpoint, and also implements the limiting to 50 results.

Test coverage is greatly improved and template information for jobs
associated to the daemon was also fixed.

Updates #15084
Updates #15192
Related #16532
2025-02-14 17:26:46 +02:00
c3f67f8169 Claim prebuild by preset ID
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 13:38:17 +00:00
2b296244a5 Taking presets into account when provisioning prebuilds
Fixing migrations

Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:54 +00:00
7e6a7d26a1 Basic implementation of preset ID tracking
Signed-off-by: Danny Kopping <danny@coder.com>

# Conflicts:
#	site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx
2025-02-14 12:17:52 +00:00
b32197937f Aborting tx if prebuild creation/deletion fails
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:12 +00:00
8cd6a6fb35 Prevent prebuild deletion from failing because old params were passed in
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:12 +00:00
8849ad3f03 Refactor
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:12 +00:00
b151e1b631 Last little bits to make everything work
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:11 +00:00
3a9f9c8453 Moving from streaming manifest approach to SSE + explicit full agent reinitialization
Signed-off-by: Danny Kopping <danny@coder.com>

# Conflicts:
#	agent/agent.go

# Conflicts:
#	cli/agent.go
2025-02-14 12:17:11 +00:00
b60f2f66c6 Persisting presets defined with prebuilds to DB
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:11 +00:00
0ba8f89df1 WIP: claim triggering manifest push to agent
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:10 +00:00
903f89694c WIP: very basic manifest stream from server to agent
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:10 +00:00
c741a08147 WIP CODER_AGENT_TOKEN reuse
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:09 +00:00
7e1abd141c Claim prebuild and rename
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:08 +00:00
eebbeb54bc Discrimination between "outdated" and "extraneous" prebuilds, hardening reconciliation
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:08 +00:00
fdabb8cf07 Very basic prebuild reassignment
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:08 +00:00
9d5c6633de Generating short ID for prebuilds
Also dropped unnecessary CASTs

Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:07 +00:00
c227bb842f Control loop now handles reconciliation of multiple prebuilds-configured template versions
Correctly calculates extraneous prebuilds and returns offending prebuild IDs

Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:07 +00:00
a59a03d5f4 Add provision job metadata to identify prebuilds
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:06 +00:00
b7c43f663e Fixed bug in state query relating to multiple template versions & workspaces in partially-deleted statuses
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:06 +00:00
41a9778af0 Improving control loop resilience, fixing calculations
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:06 +00:00
cffd63450d Add prebuilds user to default org
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:05 +00:00
815ecbc74b Specify progress type
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:05 +00:00
981f61e272 Incorporate in-progress jobs into state calculation
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:04 +00:00
4b5555e918 Preset tables, latest workspace view, state logic improved
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:04 +00:00
281a76aad9 WIP on control loop
Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:04 +00:00
1150e206e0 Migrations
Exclude system users from users.sql queries

Signed-off-by: Danny Kopping <danny@coder.com>
2025-02-14 12:17:01 +00:00
2838fb14bc Merge branch 'jjs/presets-fe' into jjs/presets 2025-02-14 09:45:08 +00:00
bc609d0056 feat: integrate agentAPI with resources monitoring logic (#16438)
As part of the new resources monitoring logic - more specifically for
OOM & OOD Notifications , we need to update the AgentAPI , and the
agents logic.

This PR aims to do it, and more specifically :  
We are updating the AgentAPI & TailnetAPI to version 24 to add two new
methods in the AgentAPI :
- One method to fetch the resources monitoring configuration
- One method to push the datapoints for the resources monitoring.

Also, this PR adds a new logic on the agent side, with a routine running
and ticking - fetching the resources usage each time , but also storing
it in a FIFO like queue.

Finally, this PR fixes a problem we had with RBAC logic on the resources
monitoring model, applying the same logic than we have for similar
entities.
2025-02-14 10:28:15 +01:00
8d08a644fd remove todos 2025-02-14 09:22:12 +00:00
b1aff3f94e Collect all todo testcases in a single file 2025-02-14 08:42:05 +00:00
d37c3a130e Merge remote-tracking branch 'origin/main' into jjs/presets 2025-02-14 08:34:48 +00:00
db767286b9 chore: change returned response for missing permissions to 403 from 404 (#16562) 2025-02-13 17:05:20 -05:00
e38bd27183 feat(coderd): add support for provisioner job id and tag filter (#16556)
This change adds to new filters to the provisionerjobs endpoint, id
(array) and tags (map).

Updates #15084
Updates #15192
Related #16532
2025-02-13 18:24:27 +02:00
6f24977566 Merge branch 'jjs/presets-api' into jjs/presets 2025-02-12 12:51:39 +00:00
71cbf735e5 feat(coderd): add support for presets to the coder API (#16526)
This pull request builds on the existing migrations and queries to add
support for presets to the coder API.
2025-02-12 14:41:14 +02:00
af4eb7f754 make -B gen 2025-02-12 12:29:07 +00:00
22eb048690 Merge remote-tracking branch 'origin/main' into jjs/presets-api 2025-02-12 12:11:52 +00:00
ce013a52aa improve test 2025-02-12 12:11:41 +00:00
63b57707eb fix test 2025-02-12 12:03:59 +00:00
ce2956d1a7 generate ids for presets by default 2025-02-12 10:13:43 +00:00
c31ee7b263 fix test 2025-02-12 08:39:17 +00:00
4fa66746ad make -B gen 2025-02-12 08:25:09 +00:00
b3964087c4 fix: handle urls with multiple slashes (#16527)
Fixes: https://github.com/coder/coder/issues/9877

This PR introduces another middleware to rewrite URLs when multiple
slashes are used.
2025-02-12 09:23:28 +01:00