Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 81 additions & 3 deletions .github/workflows/self_hosted_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ jobs:
echo "GOBIN=$HOME/bin" >> $GITHUB_ENV
mkdir -p $HOME/bin
- name: Check out code into the Go module directory
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v7
id: setup-go
with:
go-version-file: "go.mod"
Expand Down Expand Up @@ -141,7 +141,85 @@ jobs:
shell: bash
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.target_os }}_${{ matrix.target_arch }}_${{ matrix.dapr_install_mode }}_e2e_standalone.json
path: ${{ env.TEST_OUTPUT_FILE }}

# `dapr init` with containers on Windows, against Docker Desktop on the WSL2
# backend. The Windows leg above only covers slim mode, as the runner image's
# own Docker engine cannot run Linux containers.
windows-desktop-init:
name: Run Windows Docker Desktop init tests
# windows-2025 ships WSL2, which Docker Desktop's Linux engine runs on.
runs-on: windows-2025
timeout-minutes: 45
# Docker does not support Docker Desktop on Windows Server, which is what
# the runner is, so this job must not fail the workflow.
continue-on-error: true
env:
GOPROXY: https://proxy.golang.org
DAPR_RUNTIME_PINNED_VERSION: "1.19.0-rc.2"
# Run the test that makes dapr init shut WSL down.
DAPR_E2E_WSL_SHUTDOWN: "true"
defaults:
run:
shell: pwsh
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: "go.mod"
- name: Install Docker Desktop
timeout-minutes: 25
run: |
# The image's own Docker engine only runs Windows containers and owns
# the default engine pipe.
Stop-Service docker -Force -ErrorAction SilentlyContinue
Set-Service docker -StartupType Disabled -ErrorAction SilentlyContinue

$installer = Join-Path $env:RUNNER_TEMP 'DockerDesktopInstaller.exe'
curl.exe -fsSL --retry 3 -o $installer 'https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe'
if ($LASTEXITCODE -ne 0) { throw 'could not download the Docker Desktop installer' }

# --accept-license accepts the Docker Subscription Service Agreement.
$install = Start-Process $installer -Wait -PassThru -ArgumentList 'install', '--quiet', '--accept-license', '--backend=wsl-2'
if ($install.ExitCode -ne 0) { throw "the Docker Desktop installer exited with code $($install.ExitCode)" }

# Ahead of the image's docker.exe.
$bin = 'C:\Program Files\Docker\Docker\resources\bin'
$env:Path = "$bin;$env:Path"
Add-Content -Path $env:GITHUB_PATH -Value $bin

Start-Process 'C:\Program Files\Docker\Docker\Docker Desktop.exe'
$deadline = (Get-Date).AddMinutes(10)
do {
Start-Sleep -Seconds 5
$engine = docker info --format '{{.OSType}}' 2>$null
} until ($engine -eq 'linux' -or (Get-Date) -gt $deadline)
if ($engine -ne 'linux') { throw "Docker Desktop's Linux engine did not answer within 10 minutes" }
docker version
- name: Build CLI
run: go build -o dist/windows_amd64/release/dapr.exe .
- name: Run Windows init tests
run: go test -tags e2e -count=1 -timeout 30m -v -run '^TestStandaloneInit(AfterUninstallKeepsWSL|WSLHoldsSchedulerPort)$' ./tests/e2e/standalone/...
- name: Collect Docker Desktop logs
if: failure()
run: |
$ErrorActionPreference = 'Continue'
docker info
docker ps --all
wsl --list --verbose
netstat -ano | Select-String ':(6060|2379|58081|59091)\s'
netsh int ipv4 show excludedportrange protocol=tcp
Copy-Item (Join-Path $env:LOCALAPPDATA 'Docker\log') (Join-Path $env:RUNNER_TEMP 'docker-desktop-logs') -Recurse -ErrorAction SilentlyContinue
exit 0
- name: Upload Docker Desktop logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: docker-desktop-logs
path: ${{ runner.temp }}/docker-desktop-logs
if-no-files-found: ignore
8 changes: 4 additions & 4 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ dapr init --redis-stack
imageRegistryURI, err = kubernetes.GetImageRegistry()
}
if err != nil {
print.FailureStatusEvent(os.Stderr, err.Error())
print.FailureStatusEvent(os.Stderr, "%s", err.Error())
os.Exit(1)
}
if err = verifyCustomCertFlags(cmd); err != nil {
print.FailureStatusEvent(os.Stderr, err.Error())
print.FailureStatusEvent(os.Stderr, "%s", err.Error())
os.Exit(1)
}

Expand All @@ -156,7 +156,7 @@ dapr init --redis-stack
}
err = kubernetes.Init(config)
if err != nil {
print.FailureStatusEvent(os.Stderr, err.Error())
print.FailureStatusEvent(os.Stderr, "%s", err.Error())
os.Exit(1)
}
print.SuccessStatusEvent(os.Stdout, fmt.Sprintf("Success! Dapr has been installed to namespace %s. To verify, run `dapr status -k' in your terminal. To get started, go here: https://docs.dapr.io/getting-started", config.Namespace))
Expand Down Expand Up @@ -208,7 +208,7 @@ dapr init --redis-stack
RedisStack: redisStack,
})
if err != nil {
print.FailureStatusEvent(os.Stderr, err.Error())
print.FailureStatusEvent(os.Stderr, "%s", err.Error())
os.Exit(1)
}
print.SuccessStatusEvent(os.Stdout, "Success! Dapr is up and running. To get started, go here: https://docs.dapr.io/getting-started")
Expand Down
Loading
Loading