Skip to content

Commit c1f3eaa

Browse files
committed
feat(flake.nix): switch dogfood dev image to buildNixShellImage from dockerTools
Change-Id: I4e011fe3a19d9a1375fbfd5223c910e59d66a5d9 Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent 75c899f commit c1f3eaa

File tree

22 files changed

+1742
-1725
lines changed

22 files changed

+1742
-1725
lines changed

.dockerignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/actions/setup-sqlc/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ runs:
77
- name: Setup sqlc
88
uses: sqlc-dev/setup-sqlc@c0209b9199cd1cce6a14fc27cabcec491b651761 # v4.0.0
99
with:
10-
sqlc-version: "1.25.0"
10+
sqlc-version: "1.27.0"

.github/workflows/dogfood.yaml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ permissions:
2424
jobs:
2525
build_image:
2626
if: github.actor != 'dependabot[bot]' # Skip Dependabot PRs
27-
runs-on: ubuntu-latest
27+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || 'ubuntu-latest' }}
2828
steps:
2929
- name: Harden Runner
3030
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
@@ -34,6 +34,12 @@ jobs:
3434
- name: Checkout
3535
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
3636

37+
- name: Setup Nix
38+
uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
39+
40+
- name: Setup GHA Nix cache
41+
uses: DeterminateSystems/magic-nix-cache-action@6221693898146dc97e38ad0e013488a16477a4c4 # v9
42+
3743
- name: Get branch name
3844
id: branch-name
3945
uses: tj-actions/branch-names@6871f53176ad61624f978536bbf089c574dc19a2 # v8.0.1
@@ -71,18 +77,21 @@ jobs:
7177
push: ${{ github.ref == 'refs/heads/main' }}
7278
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
7379

74-
- name: Build and push Nix image
75-
uses: depot/build-push-action@636daae76684e38c301daa0c5eca1c095b24e780 # v1.14.0
76-
with:
77-
project: b4q6ltmpzh
78-
token: ${{ secrets.DEPOT_TOKEN }}
79-
buildx-fallback: true
80-
context: "."
81-
file: "dogfood/contents/Dockerfile.nix"
82-
pull: true
83-
save: true
84-
push: ${{ github.ref == 'refs/heads/main' }}
85-
tags: "codercom/oss-dogfood-nix:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood-nix:latest"
80+
- name: Build Nix image
81+
run: nix build .#dev_image
82+
83+
- name: Push Nix image
84+
if: github.ref == 'refs/heads/main'
85+
run: |
86+
docker load -i result
87+
88+
CURRENT_SYSTEM=$(nix eval --impure --raw --expr 'builtins.currentSystem')
89+
90+
docker image tag codercom/oss-dogfood-nix:latest-$CURRENT_SYSTEM codercom/oss-dogfood-nix:${{ steps.docker-tag-name.outputs.tag }}
91+
docker image push codercom/oss-dogfood-nix:${{ steps.docker-tag-name.outputs.tag }}
92+
93+
docker image tag codercom/oss-dogfood-nix:latest-$CURRENT_SYSTEM codercom/oss-dogfood-nix:latest
94+
docker image push codercom/oss-dogfood-nix:latest
8695
8796
deploy_template:
8897
needs: build_image

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,3 +957,6 @@ else
957957
pnpm playwright:test
958958
endif
959959
.PHONY: test-e2e
960+
961+
dogfood/contents/nix.hash: flake.nix flake.lock
962+
sha256sum flake.nix flake.lock >./dogfood/contents/nix.hash

cli/testdata/TestProvisioners_Golden/list.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ID CREATED AT LAST SEEN AT NAME VERSION TAGS KEY NAME STATUS CURRENT JOB ID CURRENT JOB STATUS PREVIOUS JOB ID PREVIOUS JOB STATUS ORGANIZATION
1+
ID CREATED AT LAST SEEN AT NAME VERSION TAGS KEY NAME STATUS CURRENT JOB ID CURRENT JOB STATUS PREVIOUS JOB ID PREVIOUS JOB STATUS ORGANIZATION
22
00000000-0000-0000-aaaa-000000000000 ====[timestamp]===== ====[timestamp]===== default-provisioner v0.0.0-devel map[owner: scope:organization] built-in idle <nil> <nil> 00000000-0000-0000-bbbb-000000000001 succeeded Coder
33
00000000-0000-0000-aaaa-000000000001 ====[timestamp]===== ====[timestamp]===== provisioner-1 v0.0.0 map[foo:bar owner: scope:organization] built-in busy 00000000-0000-0000-bbbb-000000000002 running <nil> <nil> Coder
44
00000000-0000-0000-aaaa-000000000002 ====[timestamp]===== ====[timestamp]===== provisioner-2 v0.0.0 map[owner: scope:organization] built-in offline <nil> <nil> 00000000-0000-0000-bbbb-000000000003 succeeded Coder
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
CREATED AT LAST SEEN AT NAME VERSION TAGS KEY NAME STATUS ORGANIZATION
1+
CREATED AT LAST SEEN AT NAME VERSION TAGS KEY NAME STATUS ORGANIZATION
22
====[timestamp]===== ====[timestamp]===== test v0.0.0-devel map[owner: scope:organization] built-in idle Coder

0 commit comments

Comments
 (0)