Skip to content

feat: Add external provisioner daemons #4935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge branch 'main' into provisionerdaemons
  • Loading branch information
kylecarbs committed Nov 16, 2022
commit 29f6f49bd19d3747560d6d7081244c59bc8cda68
9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/external_bug_report.md

This file was deleted.

22 changes: 9 additions & 13 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
style-lint-golangci:
name: style/lint/golangci
timeout-minutes: 5
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
gen:
name: "style/gen"
timeout-minutes: 8
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
needs: changes
if: needs.changes.outputs.docs-only == 'false'
steps:
Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:

test-go:
name: "test/go"
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || matrix.os }}
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }}
timeout-minutes: 20
strategy:
matrix:
Expand Down Expand Up @@ -315,7 +315,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo: gotestyourself/gotestsum
tag: v1.7.0
tag: v1.8.2

- uses: hashicorp/setup-terraform@v2
with:
Expand All @@ -336,11 +336,7 @@ jobs:
echo ::set-output name=cover::false
fi
set -x
test_timeout=5m
if [[ "${{ matrix.os }}" == windows* ]]; then
test_timeout=10m
fi
gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=$test_timeout -short -failfast $COVERAGE_FLAGS
gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS

- uses: codecov/codecov-action@v3
# This action has a tendency to error out unexpectedly, it has
Expand All @@ -356,7 +352,7 @@ jobs:

test-go-postgres:
name: "test/go/postgres"
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
# This timeout must be greater than the timeout set by `go test` in
# `make test-postgres` to ensure we receive a trace of running
# goroutines. Setting this to the timeout +5m should work quite well
Expand Down Expand Up @@ -393,7 +389,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo: gotestyourself/gotestsum
tag: v1.7.0
tag: v1.8.2

- uses: hashicorp/setup-terraform@v2
with:
Expand All @@ -417,7 +413,7 @@ jobs:

deploy:
name: "deploy"
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
timeout-minutes: 30
needs: changes
if: |
Expand Down Expand Up @@ -514,7 +510,7 @@ jobs:

test-js:
name: "test/js"
runs-on: ubuntu-latest
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Submit Packages
on:
release:
types: [published]

env:
CODER_VERSION: "${{ github.event.release.tag_name }}"

jobs:
winget:
runs-on: windows-latest
steps:
- name: Install wingetcreate
run: |
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe

# the package version is the same as the release tag without the leading
# "v", and with a trailing ".0" (e.g. "v1.2.3" -> "1.2.3.0")
- name: Calculate package version
id: version
run: |
$version = $env:CODER_VERSION -replace "^v", ""
$version += ".0"
echo "::set-output name=version::$version"

- name: Submit updated manifest to winget-pkgs
run: |
$release_assets = gh release view --repo coder/coder "$env:CODER_VERSION" --json assets | `
ConvertFrom-Json

$installer_url = $release_assets.assets | `
Where-Object name -Match ".*_windows_amd64_installer.exe$" | `
Select -ExpandProperty url

echo "Installer URL: $installer_url"

# version should be extracted from the installer
wingetcreate update Coder.Coder `
--submit `
--version "${{ steps.version.outputs.version }}" `
--urls "$installer_url" `
--token "${{ secrets.CDRCI_GITHUB_TOKEN }}"

- name: Comment on PR
run: |
# find the PR that wingetcreate just made
$pr_list = gh pr list --repo microsoft/winget-pkgs --search "author:cdrci Coder.Coder version ${{ steps.version.outputs.version }}" --limit 1 --json number | `
ConvertFrom-Json`
$pr_number = $pr_list[0].number

gh pr comment --repo microsoft/winget-pkgs "$pr_number" --body "🤖 cc: @deansheather"
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env:

jobs:
release:
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
env:
# Necessary for Docker manifest
DOCKER_CLI_EXPERIMENTAL: "enabled"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ jobs:
# https://github.com/actions/stale/pull/775
- uses: actions/stale@v6.0.0
with:
stale-issue-label: stale
stale-pr-label: stale
stale-issue-label: 'stale'
stale-pr-label: 'stale'
exempt-issue-labels: 'never stale'
exempt-pr-labels: 'never stale'
# Pull Requests become stale more quickly due to merge conflicts.
# Also, we promote minimizing WIP.
days-before-pr-stale: 7
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ site/out/
**/*.swp
.coderv2/*
**/__debug_bin

# direnv
.envrc
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ else
ZSTDFLAGS := -6
endif

# Source files used for make targets, evaluated on use.
GO_SRC_FILES = $(shell find . -not \( -path './.git/*' -o -path './build/*' -o -path './vendor/*' -o -path './.coderv2/*' -o -path './site/node_modules/*' -o -path './site/out/*' \) -type f -name '*.go')
# All the shell files in the repo, excluding ignored files.
SHELL_SRC_FILES = $(shell find . -not \( -path './.git/*' -o -path './build/*' -o -path './vendor/*' -o -path './.coderv2/*' -o -path './site/node_modules/*' -o -path './site/out/*' \) -type f -name '*.sh')

# All ${OS}_${ARCH} combos we build for. Windows binaries have the .exe suffix.
OS_ARCHES := \
linux_amd64 linux_arm64 linux_armv7 \
Expand Down Expand Up @@ -171,7 +176,7 @@ endef
# You should probably use the non-version targets above instead if you're
# calling this manually.
$(CODER_ALL_BINARIES): go.mod go.sum \
$(shell find . -not -path './vendor/*' -type f -name '*.go') \
$(GO_SRC_FILES) \
$(shell find ./examples/templates)

$(get-mode-os-arch-ext)
Expand Down Expand Up @@ -333,7 +338,7 @@ build/coder_helm_$(VERSION).tgz:
--version "$(VERSION)" \
--output "$@"

site/out/index.html: $(shell find ./site -not -path './site/node_modules/*' -type f -name '*.tsx') $(shell find ./site -not -path './site/node_modules/*' -type f -name '*.ts') site/package.json
site/out/index.html: site/package.json $(shell find ./site -not -path './site/node_modules/*' -type f \( -name '*.ts' -o -name '*.tsx' \))
./scripts/yarn_install.sh
cd site
yarn build
Expand Down Expand Up @@ -364,13 +369,13 @@ fmt/terraform: $(wildcard *.tf)
terraform fmt -recursive
.PHONY: fmt/terraform

fmt/shfmt: $(shell shfmt -f .)
fmt/shfmt: $(SHELL_SRC_FILES)
echo "--- shfmt"
# Only do diff check in CI, errors on diff.
ifdef CI
shfmt -d $(shell shfmt -f .)
shfmt -d $(SHELL_SRC_FILES)
else
shfmt -w $(shell shfmt -f .)
shfmt -w $(SHELL_SRC_FILES)
endif
.PHONY: fmt/shfmt

Expand All @@ -383,9 +388,9 @@ lint/go:
.PHONY: lint/go

# Use shfmt to determine the shell files, takes editorconfig into consideration.
lint/shellcheck: $(shell shfmt -f .)
lint/shellcheck: $(SHELL_SRC_FILES)
echo "--- shellcheck"
shellcheck --external-sources $(shell shfmt -f .)
shellcheck --external-sources $(SHELL_SRC_FILES)
.PHONY: lint/shellcheck

# all gen targets should be added here and to gen/mark-fresh
Expand Down Expand Up @@ -446,8 +451,7 @@ site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find codersdk
update-golden-files: cli/testdata/.gen-golden
.PHONY: update-golden-files

cli/testdata/.gen-golden: $(wildcard cli/testdata/*.golden) \
$(shell find . -not -path './vendor/*' -type f -name '*.go')
cli/testdata/.gen-golden: $(wildcard cli/testdata/*.golden) $(GO_SRC_FILES)

go test ./cli -run=TestCommandHelp -update
touch "$@"
Expand All @@ -459,8 +463,11 @@ test: test-clean
# When updating -timeout for this test, keep in sync with
# test-go-postgres (.github/workflows/coder.yaml).
test-postgres: test-clean test-postgres-docker
# The postgres test is prone to failure, so we limit parallelism for
# more consistent execution.
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." -- \
-covermode=atomic -coverprofile="gotests.coverage" -timeout=20m \
-parallel=4 \
-coverpkg=./... \
-count=1 -race -failfast
.PHONY: test-postgres
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.