Skip to content

Commit 0d37f91

Browse files
committed
Merge branch 'main' into 8193-order-parameters
2 parents 3e9964f + b83cdfe commit 0d37f91

File tree

10 files changed

+69
-11
lines changed

10 files changed

+69
-11
lines changed

.github/workflows/pr-cleanup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Get PR number
1919
id: pr_number
2020
run: |
21-
if [ -z "${{ github.event.pull_request.number }}" ]; then
21+
if [ -n "${{ github.event.pull_request.number }}" ]; then
2222
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
2323
else
2424
echo "PR_NUMBER=${{ github.event.inputs.pr_number }}" >> $GITHUB_OUTPUT

dogfood/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ RUN apt-get update --quiet && apt-get install --yes \
159159
terraform \
160160
fish \
161161
unzip \
162-
zstd && \
162+
zstd \
163+
gettext-base && \
163164
# Delete package cache to avoid consuming space in layer
164165
apt-get clean && \
165166
# Configure FIPS-compliant policies

enterprise/coderd/coderd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
417417
if enabled {
418418
var haCoordinator agpltailnet.Coordinator
419419
if api.AGPL.Experiments.Enabled(codersdk.ExperimentTailnetPGCoordinator) {
420-
haCoordinator, err = tailnet.NewPGCoord(ctx, api.Logger, api.Pubsub, api.Database)
420+
haCoordinator, err = tailnet.NewPGCoord(api.ctx, api.Logger, api.Pubsub, api.Database)
421421
} else {
422422
haCoordinator, err = tailnet.NewCoordinator(api.Logger, api.Pubsub)
423423
}

enterprise/tailnet/pgcoord.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import (
1818
"cdr.dev/slog"
1919

2020
"github.com/coder/coder/coderd/database"
21+
"github.com/coder/coder/coderd/database/dbauthz"
2122
"github.com/coder/coder/coderd/database/pubsub"
23+
"github.com/coder/coder/coderd/rbac"
2224
agpl "github.com/coder/coder/tailnet"
2325
)
2426

@@ -82,7 +84,21 @@ type pgCoord struct {
8284
// NewPGCoord creates a high-availability coordinator that stores state in the PostgreSQL database and
8385
// receives notifications of updates via the pubsub.
8486
func NewPGCoord(ctx context.Context, logger slog.Logger, ps pubsub.Pubsub, store database.Store) (agpl.Coordinator, error) {
85-
ctx, cancel := context.WithCancel(ctx)
87+
ctx, cancel := context.WithCancel(dbauthz.As(ctx, rbac.Subject{
88+
ID: uuid.Nil.String(),
89+
Roles: rbac.Roles([]rbac.Role{
90+
{
91+
Name: "tailnetcoordinator",
92+
DisplayName: "Tailnet Coordinator",
93+
Site: rbac.Permissions(map[string][]rbac.Action{
94+
rbac.ResourceTailnetCoordinator.Type: {rbac.WildcardSymbol},
95+
}),
96+
Org: map[string][]rbac.Permission{},
97+
User: []rbac.Permission{},
98+
},
99+
}),
100+
Scope: rbac.ScopeAll,
101+
}.WithCachedASTValue()))
86102
id := uuid.New()
87103
logger = logger.Named("pgcoord").With(slog.F("coordinator_id", id))
88104
bCh := make(chan binding)
@@ -103,6 +119,7 @@ func NewPGCoord(ctx context.Context, logger slog.Logger, ps pubsub.Pubsub, store
103119
querier: newQuerier(ctx, logger, ps, store, id, cCh, numQuerierWorkers, fHB),
104120
closed: make(chan struct{}),
105121
}
122+
logger.Info(ctx, "starting coordinator")
106123
return c, nil
107124
}
108125

@@ -171,6 +188,7 @@ func (c *pgCoord) ServeAgent(conn net.Conn, id uuid.UUID, name string) error {
171188
}
172189

173190
func (c *pgCoord) Close() error {
191+
c.logger.Info(c.ctx, "closing coordinator")
174192
c.cancel()
175193
c.closeOnce.Do(func() { close(c.closed) })
176194
return nil

flake.lock

Lines changed: 24 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scaletest/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@ All of the above arguments may be specified as environment variables. Consult th
4646

4747
### Prometheus Metrics
4848

49-
To capture Prometheus metrics from the loadtest, two environment
49+
To capture Prometheus metrics from the loadtest, two environment variables are required:
50+
51+
- `SCALETEST_PROMETHEUS_REMOTE_WRITE_USER`
52+
- `SCALETEST_PROMETHEUS_REMOTE_WRITE_PASSWORD`
53+
54+
### Enterprise License
55+
56+
To add an Enterprise license, set the `SCALETEST_CODER_LICENSE` environment variable to the JWT string
5057

5158
## Scenarios
5259

scaletest/scaletest.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ SCALETEST_SCENARIO="${SCALETEST_SCENARIO:-}"
1414
SCALETEST_PROJECT="${SCALETEST_PROJECT:-}"
1515
SCALETEST_PROMETHEUS_REMOTE_WRITE_USER="${SCALETEST_PROMETHEUS_REMOTE_WRITE_USER:-}"
1616
SCALETEST_PROMETHEUS_REMOTE_WRITE_PASSWORD="${SCALETEST_PROMETHEUS_REMOTE_WRITE_PASSWORD:-}"
17+
SCALETEST_CODER_LICENSE="${SCALETEST_CODER_LICENSE:-}"
1718
SCALETEST_SKIP_CLEANUP="${SCALETEST_SKIP_CLEANUP:-0}"
1819
SCALETEST_CREATE_CONCURRENCY="${SCALETEST_CREATE_CONCURRENCY:-10}"
1920
SCALETEST_TRAFFIC_BYTES_PER_TICK="${SCALETEST_TRAFFIC_BYTES_PER_TICK:-1024}"
@@ -155,6 +156,11 @@ maybedryrun "$DRY_RUN" kubectl --kubeconfig="${KUBECONFIG}" -n "coder-${SCALETES
155156
echo "Initializing Coder deployment."
156157
DRY_RUN="$DRY_RUN" "${PROJECT_ROOT}/scaletest/lib/coder_init.sh" "${SCALETEST_CODER_URL}"
157158

159+
if [[ -n "${SCALETEST_CODER_LICENSE}" ]]; then
160+
echo "Applying Coder Enterprise License"
161+
DRY_RUN="$DRY_RUN" "${PROJECT_ROOT}/scaletest/lib/coder_shim.sh" license add -l "${SCALETEST_CODER_LICENSE}"
162+
fi
163+
158164
echo "Creating ${SCALETEST_NUM_WORKSPACES} workspaces."
159165
DRY_RUN="$DRY_RUN" "${PROJECT_ROOT}/scaletest/lib/coder_shim.sh" scaletest create-workspaces \
160166
--count "${SCALETEST_NUM_WORKSPACES}" \

scaletest/terraform/coder.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ coder:
106106
value: "true"
107107
- name: "CODER_VERBOSE"
108108
value: "true"
109+
- name: "CODER_EXPERIMENTS"
110+
value: "${var.coder_experiments}"
109111
image:
110112
repo: ${var.coder_image_repo}
111113
tag: ${var.coder_image_tag}

scaletest/terraform/prometheus.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ resource "kubernetes_secret" "prometheus-postgres-password" {
112112

113113
# Install Prometheus Postgres exporter helm chart
114114
resource "helm_release" "prometheus-exporter-chart" {
115+
depends_on = [helm_release.prometheus-chart]
115116
repository = local.prometheus_exporter_helm_repo
116117
chart = local.prometheus_exporter_helm_chart
117118
name = local.prometheus_exporter_release_name

scaletest/terraform/vars.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,8 @@ variable "prometheus_remote_write_send_interval" {
157157
description = "Prometheus remote write interval."
158158
default = "15s"
159159
}
160+
161+
variable "coder_experiments" {
162+
description = "Coder Experiments to enable"
163+
default = ""
164+
}

0 commit comments

Comments
 (0)