Skip to content

Commit 4a7c230

Browse files
committed
chore: enable SBOM and containerd support in Docker builds
Added SBOM (Software Bill of Materials) generation during Docker build to enhance traceability. Refer to Docker documentation on SBOM: docs.docker.com/build/metadata/attestations/sbom Updated Docker build scripts to use BuildKit for provenance and SBOM support: docs.docker.com/build/metadata/attestations Configured Docker daemon to support the Containerd snapshotter feature to improve performance: docs.docker.com/engine/storage/containerd
1 parent 26832cb commit 4a7c230

File tree

70 files changed

+361
-310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+361
-310
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ jobs:
361361
file: scripts/Dockerfile.base
362362
platforms: linux/amd64,linux/arm64,linux/arm/v7
363363
provenance: true
364+
sbom: true
364365
pull: true
365366
no-cache: true
366367
push: true
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"registry-mirrors": ["https://mirror.gcr.io"]
2+
"registry-mirrors": ["https://mirror.gcr.io"],
3+
"features": {
4+
"containerd-snapshotter": true
5+
}
36
}

dogfood/contents/zed/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ data "coder_workspace" "me" {}
2020

2121
resource "coder_app" "zed" {
2222
agent_id = var.agent_id
23-
display_name = "Zed Editor"
23+
display_name = "Zed"
2424
slug = "zed"
2525
icon = "/icon/zed.svg"
2626
external = true
27-
url = "zed://ssh/coder.${lower(data.coder_workspace.me.name)}/${var.folder}"
27+
url = "zed://ssh/${lower(data.coder_workspace.me.name)}.coder/${var.folder}"
2828
}

enterprise/coderd/groups.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ func (api *API) patchGroup(rw http.ResponseWriter, r *http.Request) {
167167
})
168168
return
169169
}
170-
// TODO: It would be nice to enforce this at the schema level
171-
// but unfortunately our org_members table does not have an ID.
172170
_, err := database.ExpectOne(api.Database.OrganizationMembers(ctx, database.OrganizationMembersParams{
173171
OrganizationID: group.OrganizationID,
174172
UserID: uuid.MustParse(id),

scripts/build_docker.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ export DOCKER_BUILDKIT=1
122122
base_image="$DEFAULT_BASE"
123123
if [[ "$build_base" != "" ]]; then
124124
log "--- Building base Docker image for $arch ($build_base)"
125-
docker build \
125+
docker buildx build \
126126
--platform "$arch" \
127127
--tag "$build_base" \
128+
--provenance true \
129+
--sbom true \
128130
--no-cache \
129131
-f Dockerfile.base \
130132
. 1>&2

site/e2e/constants.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export const defaultPassword = "SomeSecurePassword!";
2020

2121
// Credentials for users
2222
export const users = {
23-
admin: {
24-
username: "admin",
23+
owner: {
24+
username: "owner",
2525
password: defaultPassword,
26-
email: "admin@coder.com",
26+
email: "owner@coder.com",
2727
},
2828
templateAdmin: {
2929
username: "template-admin",
@@ -41,7 +41,7 @@ export const users = {
4141
username: "auditor",
4242
password: defaultPassword,
4343
email: "auditor@coder.com",
44-
roles: ["Template Admin", "Auditor"],
44+
roles: ["Auditor"],
4545
},
4646
member: {
4747
username: "member",

site/e2e/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export type LoginOptions = {
6767
password: string;
6868
};
6969

70-
export async function login(page: Page, options: LoginOptions = users.admin) {
70+
export async function login(page: Page, options: LoginOptions = users.owner) {
7171
const ctx = page.context();
7272
// biome-ignore lint/suspicious/noExplicitAny: reset the current user
7373
(ctx as any)[Symbol.for("currentUser")] = undefined;

site/e2e/setup/addUsersAndLicense.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ test("setup deployment", async ({ page }) => {
1616
}
1717

1818
// Setup first user
19-
await page.getByLabel(Language.emailLabel).fill(users.admin.email);
20-
await page.getByLabel(Language.passwordLabel).fill(users.admin.password);
19+
await page.getByLabel(Language.emailLabel).fill(users.owner.email);
20+
await page.getByLabel(Language.passwordLabel).fill(users.owner.password);
2121
await page.getByTestId("create").click();
2222

2323
await expectUrl(page).toHavePathName("/workspaces");
2424
await page.getByTestId("button-select-template").isVisible();
2525

2626
for (const user of Object.values(users)) {
2727
// Already created as first user
28-
if (user.username === "admin") {
28+
if (user.username === "owner") {
2929
continue;
3030
}
3131

site/e2e/tests/auditLogs.spec.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,62 +13,62 @@ test.describe.configure({ mode: "parallel" });
1313

1414
test.beforeEach(async ({ page }) => {
1515
beforeCoderTest(page);
16-
await login(page, users.auditor);
1716
});
1817

19-
async function resetSearch(page: Page) {
18+
async function resetSearch(page: Page, username: string) {
2019
const clearButton = page.getByLabel("Clear search");
2120
if (await clearButton.isVisible()) {
2221
await clearButton.click();
2322
}
2423

2524
// Filter by the auditor test user to prevent race conditions
26-
const user = currentUser(page);
2725
await expect(page.getByText("All users")).toBeVisible();
28-
await page.getByPlaceholder("Search...").fill(`username:${user.username}`);
26+
await page.getByPlaceholder("Search...").fill(`username:${username}`);
2927
await expect(page.getByText("All users")).not.toBeVisible();
3028
}
3129

3230
test("logins are logged", async ({ page }) => {
3331
requiresLicense();
3432

3533
// Go to the audit history
34+
await login(page, users.auditor);
3635
await page.goto("/audit");
36+
const username = users.auditor.username;
3737

38-
const user = currentUser(page);
39-
const loginMessage = `${user.username} logged in`;
38+
const loginMessage = `${username} logged in`;
4039
// Make sure those things we did all actually show up
41-
await resetSearch(page);
40+
await resetSearch(page, username);
4241
await expect(page.getByText(loginMessage).first()).toBeVisible();
4342
});
4443

4544
test("creating templates and workspaces is logged", async ({ page }) => {
4645
requiresLicense();
4746

4847
// Do some stuff that should show up in the audit logs
48+
await login(page, users.templateAdmin);
49+
const username = users.templateAdmin.username;
4950
const templateName = await createTemplate(page);
5051
const workspaceName = await createWorkspace(page, templateName);
5152

5253
// Go to the audit history
54+
await login(page, users.auditor);
5355
await page.goto("/audit");
5456

55-
const user = currentUser(page);
56-
5757
// Make sure those things we did all actually show up
58-
await resetSearch(page);
58+
await resetSearch(page, username);
5959
await expect(
60-
page.getByText(`${user.username} created template ${templateName}`),
60+
page.getByText(`${username} created template ${templateName}`),
6161
).toBeVisible();
6262
await expect(
63-
page.getByText(`${user.username} created workspace ${workspaceName}`),
63+
page.getByText(`${username} created workspace ${workspaceName}`),
6464
).toBeVisible();
6565
await expect(
66-
page.getByText(`${user.username} started workspace ${workspaceName}`),
66+
page.getByText(`${username} started workspace ${workspaceName}`),
6767
).toBeVisible();
6868

6969
// Make sure we can inspect the details of the log item
7070
const createdWorkspace = page.locator(".MuiTableRow-root", {
71-
hasText: `${user.username} created workspace ${workspaceName}`,
71+
hasText: `${username} created workspace ${workspaceName}`,
7272
});
7373
await createdWorkspace.getByLabel("open-dropdown").click();
7474
await expect(
@@ -83,18 +83,19 @@ test("inspecting and filtering audit logs", async ({ page }) => {
8383
requiresLicense();
8484

8585
// Do some stuff that should show up in the audit logs
86+
await login(page, users.templateAdmin);
87+
const username = users.templateAdmin.username;
8688
const templateName = await createTemplate(page);
8789
const workspaceName = await createWorkspace(page, templateName);
8890

8991
// Go to the audit history
92+
await login(page, users.auditor);
9093
await page.goto("/audit");
91-
92-
const user = currentUser(page);
93-
const loginMessage = `${user.username} logged in`;
94-
const startedWorkspaceMessage = `${user.username} started workspace ${workspaceName}`;
94+
const loginMessage = `${username} logged in`;
95+
const startedWorkspaceMessage = `${username} started workspace ${workspaceName}`;
9596

9697
// Filter by resource type
97-
await resetSearch(page);
98+
await resetSearch(page, username);
9899
await page.getByText("All resource types").click();
99100
const workspaceBuildsOption = page.getByText("Workspace Build");
100101
await workspaceBuildsOption.scrollIntoViewIfNeeded({ timeout: 5000 });
@@ -107,7 +108,7 @@ test("inspecting and filtering audit logs", async ({ page }) => {
107108
await expect(page.getByText("All resource types")).toBeVisible();
108109

109110
// Filter by action type
110-
await resetSearch(page);
111+
await resetSearch(page, username);
111112
await page.getByText("All actions").click();
112113
await page.getByText("Login", { exact: true }).click();
113114
// Logins should be visible

site/e2e/tests/deployment/general.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test("experiments", async ({ page }) => {
1616
const availableExperiments = await API.getAvailableExperiments();
1717

1818
// Verify if the site lists the same experiments
19-
await page.goto("/deployment/general", { waitUntil: "networkidle" });
19+
await page.goto("/deployment/overview", { waitUntil: "domcontentloaded" });
2020

2121
const experimentsLocator = page.locator(
2222
"div.options-table tr.option-experiments ul.option-array",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy