Skip to content

Commit

Permalink
Merge branch 'master' into feat/dashboard-supports-random-port
Browse files Browse the repository at this point in the history
  • Loading branch information
imneov authored May 9, 2022
2 parents c7bd055 + 0c51481 commit 5f3f852
Show file tree
Hide file tree
Showing 69 changed files with 3,524 additions and 1,545 deletions.
66 changes: 66 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "Dapr CLI Dev Environment",
// Update the container version when you publish dev-container
"image": "docker.io/daprio/dapr-dev:0.1.7",
// Replace with uncommented line below to build your own local copy of the image
// "dockerFile": "../docker/Dockerfile-dev",
"containerEnv": {
// Uncomment to overwrite devcontainer .kube/config and .minikube certs with the localhost versions
// each time the devcontainer starts, if the respective .kube-localhost/config and .minikube-localhost
// folders respectively are bind mounted to the devcontainer.
// "SYNC_LOCALHOST_KUBECONFIG": "true",

// Uncomment to disable docker-in-docker and automatically proxy default /var/run/docker.sock to
// the localhost bind-mount /var/run/docker-host.sock.
// "BIND_LOCALHOST_DOCKER": "true"
},
"extensions": [
"davidanson.vscode-markdownlint",
"golang.go",
"ms-azuretools.vscode-dapr",
"ms-azuretools.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools"
],
"mounts": [
// Mount docker-in-docker library volume
"type=volume,source=dind-var-lib-docker,target=/var/lib/docker",

// Bind mount docker socket under an alias to support docker-from-docker
"type=bind,source=/var/run/docker.sock,target=/var/run/docker-host.sock",

// Uncomment to clone local .kube/config into devcontainer
// "type=bind,source=${env:HOME}${env:USERPROFILE}/.kube,target=/home/dapr/.kube-localhost",

// Uncomment to additionally clone minikube certs into devcontainer for use with .kube/config
// "type=bind,source=${env:HOME}${env:USERPROFILE}/.minikube,target=/home/dapr/.minikube-localhost"
],
// Always run image-defined default command
"overrideCommand": false,
// On Linux, this will prevent new files getting created as root, but you
// may need to update the USER_UID and USER_GID in docker/Dockerfile-dev
// to match your user if not 1000.
"remoteUser": "dapr",
"runArgs": [
// Enable ptrace-based debugging for go
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined",

// Uncomment to bind to host network for local devcontainer; this is necessary if using the
// bind-mounted /var/run/docker-host.sock directly.
// "--net=host",

// Enable docker-in-docker configuration. Comment out if not using for better security.
"--privileged",

// Run the entrypoint defined in container image.
"--init"
],
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go"
},
"workspaceFolder": "/workspaces/cli",
"workspaceMount": "type=bind,source=${localWorkspaceFolder},target=/workspaces/cli",
}
4 changes: 2 additions & 2 deletions .github/workflows/dapr_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
GOVER: 1.17
GOLANG_CI_LINT_VER: v1.31
GOLANG_CI_LINT_VER: v1.44.2
GOOS: ${{ matrix.target_os }}
GOARCH: ${{ matrix.target_arch }}
GOPROXY: https://proxy.golang.org
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
uses: actions/checkout@v2
- name: Run golangci-lint
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3.1.0
with:
version: ${{ env.GOLANG_CI_LINT_VER }}
only-new-issues: true
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Copyright 2021 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: fossa
on:
push:
branches:
- master
- release-*
- feature/*
tags:
- v*
pull_request:
branches:
- master
- release-*
- feature/*
workflow_dispatch: {}
jobs:
fossa-scan:
if: github.repository_owner == 'dapr' # FOSSA is not intended to run on forks.
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: b88e1f4287c3108c8751bf106fb46db6 # This is a push-only token that is safe to be exposed.
steps:
- name: "Checkout code"
uses: actions/checkout@v2

- name: "Run FOSSA Scan"
uses: fossas/fossa-action@v1.1.0 # Use a specific version if locking is preferred
with:
api-key: ${{ env.FOSSA_API_KEY }}

- name: "Run FOSSA Test"
uses: fossas/fossa-action@v1.1.0 # Use a specific version if locking is preferred
with:
api-key: ${{ env.FOSSA_API_KEY }}
run-tests: true
46 changes: 25 additions & 21 deletions .github/workflows/kind_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,43 @@ jobs:
runs-on: ubuntu-latest
env:
GOVER: 1.17
DAPR_RUNTIME_VERSION: 1.6.0
DAPR_DASHBOARD_VERSION: 0.9.0
DAPR_RUNTIME_VERSION: 1.7.0
DAPR_DASHBOARD_VERSION: 0.10.0
DAPR_TGZ: dapr-1.7.0.tgz
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.19.11
- v1.20.7
- v1.21.1
- v1.20.15
- v1.21.10
- v1.22.7
- v1.23.4
mode:
- ha
- non-ha
# Map between K8s and KinD versions.
# This is attempting to make it a bit clearer what's being tested.
# See: https://github.com/kubernetes-sigs/kind/releases/tag/v0.11.0
# See: https://github.com/kubernetes-sigs/kind/releases/tag/v0.12.0
include:
- k8s-version: v1.19.11
kind-version: v0.11.0
kind-image-sha: sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729
- k8s-version: v1.20.7
kind-version: v0.11.0
kind-image-sha: sha256:cbeaf907fc78ac97ce7b625e4bf0de16e3ea725daf6b04f930bd14c67c671ff9
- k8s-version: v1.21.1
kind-version: v0.11.0
kind-image-sha: sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
- k8s-version: v1.20.15
kind-version: v0.12.0
kind-image-sha: sha256:393bb9096c6c4d723bb17bceb0896407d7db581532d11ea2839c80b28e5d8deb
- k8s-version: v1.21.10
kind-version: v0.12.0
kind-image-sha: sha256:84709f09756ba4f863769bdcabe5edafc2ada72d3c8c44d6515fc581b66b029c
- k8s-version: v1.22.7
kind-version: v0.12.0
kind-image-sha: sha256:1dfd72d193bf7da64765fd2f2898f78663b9ba366c2aa74be1fd7498a1873166
- k8s-version: v1.23.4
kind-version: v0.12.0
kind-image-sha: sha256:0e34f0d0fd448aa2f2819cfd74e99fe5793a6e4938b328f657c8e3f81ee0dfb9
exclude:
- k8s-version: v1.19.11
- k8s-version: v1.20.15
mode: non-ha
- k8s-version: v1.20.7
- k8s-version: v1.21.10
mode: non-ha
- k8s-version: v1.22.7
mode: non-ha
steps:
- name: Set up Go ${{ env.GOVER }}
uses: actions/setup-go@v2
Expand Down Expand Up @@ -109,10 +116,8 @@ jobs:
- role: worker
image: kindest/node:${{ matrix.k8s-version }}@${{ matrix.kind-image-sha }}
EOF
# Log the generated kind.yaml for easy reference.
cat kind.yaml
- name: Create KinD Cluster
uses: helm/kind-action@v1.0.0
with:
Expand All @@ -127,7 +132,6 @@ jobs:
-lkubernetes.io/hostname!=kind-control-plane \
-ojsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
echo "MINIKUBE_NODE_IP=$NODE_IP" >> $GITHUB_ENV
- name: Free up some diskspace
run: |
docker image prune -a -f
Expand All @@ -141,7 +145,7 @@ jobs:
- name: Determine latest Dapr Dashboard version including Pre-releases
if: github.base_ref == 'master'
run: |
helm pull dapr/dapr --untar && export DASHBOARD_VERSION=$(cat ./dapr/charts/dapr_dashboard/Chart.yaml | grep version | awk '{ print $2; exit }') && rm -rf dapr
curl -L -o dapr.tgz https://github.com/dapr/helm-charts/raw/master/$DAPR_TGZ && tar -xzf dapr.tgz && export DASHBOARD_VERSION=$(cat ./dapr/charts/dapr_dashboard/Chart.yaml | grep version | awk '{ print $2; exit }') && rm -rf dapr
echo "DAPR_DASHBOARD_VERSION=$DASHBOARD_VERSION" >> $GITHUB_ENV
echo "Found $DASHBOARD_VERSION"
shell: bash
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/self_hosted_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- release-*
schedule:
- cron: '0 */3 * * *'
- cron: '0 0 * * *'
pull_request:
branches:
- master
Expand All @@ -35,9 +36,9 @@ jobs:
GOARCH: ${{ matrix.target_arch }}
GOPROXY: https://proxy.golang.org
ARCHIVE_OUTDIR: dist/archives
DAPR_RUNTIME_VERSION: "1.6.0"
DAPR_DASHBOARD_VERSION: 0.9.0
CUSTOM_IMAGE_REGISTRY: docker.io
DAPR_RUNTIME_VERSION: "1.7.0"
DAPR_DASHBOARD_VERSION: 0.10.0
DAPR_TGZ: dapr-1.7.0.tgz
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -58,7 +59,7 @@ jobs:
uses: actions/checkout@v2
- name: Install docker - MacOS
if: matrix.os == 'macos-latest'
uses: docker-practice/actions-setup-docker@v1
uses: docker-practice/actions-setup-docker@1.0.8
with:
docker_buildx: false
docker_version: 20.10
Expand All @@ -72,11 +73,23 @@ jobs:
- name: Determine latest Dapr Dashboard version including Pre-releases
if: github.base_ref == 'master'
run: |
helm pull dapr/dapr --untar && export DASHBOARD_VERSION=$(cat ./dapr/charts/dapr_dashboard/Chart.yaml | grep version | awk '{ print $2; exit }') && rm -rf dapr
curl -L -o dapr.tgz https://github.com/dapr/helm-charts/raw/master/$DAPR_TGZ && tar -xzf dapr.tgz && export DASHBOARD_VERSION=$(cat ./dapr/charts/dapr_dashboard/Chart.yaml | grep version | awk '{ print $2; exit }') && rm -rf dapr
echo "DAPR_DASHBOARD_VERSION=$DASHBOARD_VERSION" >> $GITHUB_ENV
echo "Found $DASHBOARD_VERSION"
shell: bash
- name: Run E2E tests
- name: Run E2E tests with GHCR
# only runs once in a day
if: github.event.schedule == '0 0 * * *'
env:
DAPR_DEFAULT_IMAGE_REGISTRY: ghcr
run: |
export TEST_OUTPUT_FILE=$GITHUB_WORKSPACE/test-e2e-standalone.json
echo "TEST_OUTPUT_FILE=$TEST_OUTPUT_FILE" >> $GITHUB_ENV
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
make e2e-build-run-sh
shell: bash
- name: Run E2E tests with Docker hub
if: github.event.schedule != '0 0 * * *'
run: |
export TEST_OUTPUT_FILE=$GITHUB_WORKSPACE/test-e2e-standalone.json
echo "TEST_OUTPUT_FILE=$TEST_OUTPUT_FILE" >> $GITHUB_ENV
Expand Down
36 changes: 21 additions & 15 deletions .github/workflows/upgrade_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,35 @@ jobs:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.19.11
- v1.20.7
- v1.21.1
- v1.20.15
- v1.21.10
- v1.22.7
- v1.23.4
mode:
- ha
- non-ha
# Map between K8s and KinD versions.
# This is attempting to make it a bit clearer what's being tested.
# See: https://github.com/kubernetes-sigs/kind/releases/tag/v0.11.0
# See: https://github.com/kubernetes-sigs/kind/releases/tag/v0.12.0
include:
- k8s-version: v1.19.11
kind-version: v0.11.0
kind-image-sha: sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729
- k8s-version: v1.20.7
kind-version: v0.11.0
kind-image-sha: sha256:cbeaf907fc78ac97ce7b625e4bf0de16e3ea725daf6b04f930bd14c67c671ff9
- k8s-version: v1.21.1
kind-version: v0.11.0
kind-image-sha: sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
- k8s-version: v1.20.15
kind-version: v0.12.0
kind-image-sha: sha256:393bb9096c6c4d723bb17bceb0896407d7db581532d11ea2839c80b28e5d8deb
- k8s-version: v1.21.10
kind-version: v0.12.0
kind-image-sha: sha256:84709f09756ba4f863769bdcabe5edafc2ada72d3c8c44d6515fc581b66b029c
- k8s-version: v1.22.7
kind-version: v0.12.0
kind-image-sha: sha256:1dfd72d193bf7da64765fd2f2898f78663b9ba366c2aa74be1fd7498a1873166
- k8s-version: v1.23.4
kind-version: v0.12.0
kind-image-sha: sha256:0e34f0d0fd448aa2f2819cfd74e99fe5793a6e4938b328f657c8e3f81ee0dfb9
exclude:
- k8s-version: v1.19.11
- k8s-version: v1.20.15
mode: non-ha
- k8s-version: v1.20.7
- k8s-version: v1.21.10
mode: non-ha
- k8s-version: v1.22.7
mode: non-ha
steps:
- name: Set up Go ${{ env.GOVER }}
Expand Down
28 changes: 21 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ run:
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
skip-files: []
# - ".*\\.my\\.go$"
# - lib/bad.go

Expand Down Expand Up @@ -63,7 +63,7 @@ linters-settings:

# path to a file containing a list of functions to exclude from checking
# see https://github.com/kisielk/errcheck#excluding-functions for details
exclude:
exclude-functions: []

funlen:
lines: 60
Expand All @@ -89,9 +89,9 @@ linters-settings:
disable:
- shadow
disable-all: false
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
revive:
# linting errors below this confidence will be ignored, default is 0.8
confidence: 0.8
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
Expand Down Expand Up @@ -128,7 +128,7 @@ linters-settings:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: default
# locale: US
ignore-words:
- someword
lll:
Expand Down Expand Up @@ -166,7 +166,7 @@ linters-settings:
# See https://go-critic.github.io/overview#checks-overview
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
# By default list of stable checks is used.
enabled-checks:
enabled-checks: []

# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
disabled-checks:
Expand Down Expand Up @@ -246,3 +246,17 @@ linters:
- exhaustive
- gci
- noctx
- exhaustivestruct
- gomoddirectives
- paralleltest
- tparallel
- wastedassign
- cyclop
- forbidigo
- tagliatelle
- thelper
- wrapcheck
- varnamelen
- forcetypeassert
- ireturn
- golint
Loading

0 comments on commit 5f3f852

Please sign in to comment.