From e6d16a0d54cbff86b4e9ac99cf7d8fc9b1a65929 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Thu, 10 Feb 2022 11:53:53 -0500 Subject: [PATCH 1/2] start troubleshooting the Linux artifact path for docker images run Docker steps on troubleshooting branch Add run_id suffix to upload/download artifact steps to avoid race condition between multiple runs of the same job only run ziti-ci if GITHUB_TOKEN is defined check for gh_ci_key, not GITHUB_TOKEN stop checking for gh_ci_key use a temp Docker tag for troubleshooting fixup workflow syntax disable Docker build cache so we can see what the builder sees despite prior runs recursively list contents of release/ innocuous modify of Dockerfile to miss cache list later try explicit artifacts dir use workspace ref revert to relative build dir Revert "revert to relative build dir" This reverts commit a72ae3ddaef207daf89bae6a4087f7b4979fd0f6. stop ignoring /release/ in Docker context to workaround BuildKit bug until https://github.com/docker/buildx/pull/955 becomes available in the build-push-buildx Action prune troubleshooting changes --- .dockerignore | 2 +- .github/workflows/main.yml | 31 ++++++++++--------- .github/workflows/mattermost-ziti-webhook.yml | 1 + 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.dockerignore b/.dockerignore index a2406ca96..2857032a5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1 @@ -/release/ +#/release/ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 567ede8b4..3cfcef039 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v2 with: - name: darwin-release + name: darwin-release-${{ github.run_id }} path: release/ retention-days: 5 @@ -73,12 +73,12 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v2 with: - name: windows-release + name: windows-release-${{ github.run_id }} path: release/ retention-days: 5 tag-and-publish: - name: Build Linux Binaries and Docker Image, Tag, and Publish + name: Build and Publish Linux Binaries and Docker Image runs-on: ubuntu-18.04 needs: [ mac-os-build, windows-build ] steps: @@ -116,17 +116,18 @@ jobs: - name: Download darwin release artifact uses: actions/download-artifact@v2 with: - name: darwin-release + name: darwin-release-${{ github.run_id }} path: release/ - name: Download windows release artifact uses: actions/download-artifact@v2 with: - name: windows-release + name: windows-release-${{ github.run_id }} path: release/ + # remaining steps in job only run on the upstream repo, not forks - name: Publish - if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v')) && github.repository_owner == 'openziti' + if: github.repository_owner == 'openziti' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v')) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -146,25 +147,25 @@ jobs: $(go env GOPATH)/bin/ziti-ci trigger-jenkins-smoke-build - name: Set up QEMU - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v') + if: github.repository_owner == 'openziti' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v')) uses: docker/setup-qemu-action@master with: platforms: amd64,arm64,arm - name: Set up Docker BuildKit - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v') + if: github.repository_owner == 'openziti' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v')) id: buildx uses: docker/setup-buildx-action@master - name: Login to Docker Hub - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v') + if: github.repository_owner == 'openziti' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v')) uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_HUB_API_USER }} password: ${{ secrets.DOCKER_HUB_API_TOKEN }} - name: Set up Docker image tags - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v') + if: github.repository_owner == 'openziti' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v')) env: SNAPSHOT_REPO: openziti/ziti-tunnel RELEASE_REPO: netfoundry/ziti-tunnel @@ -173,7 +174,7 @@ jobs: # the Docker cross-build only runs on branches main or release-v* # where ziti-ci always computes and pushes a new release tag ZITI_VERSION="$($(go env GOPATH)/bin/ziti-ci -q get-current-version)" - # drop the leaving "v" char, if any + # drop the leading 'v', if any ZITI_VERSION=${ZITI_VERSION#v} DOCKER_TAGS="" if [[ "${ZITI_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then @@ -190,13 +191,13 @@ jobs: echo ::set-output name=tags::${DOCKER_TAGS} - name: Build & Push Multi-Platform Container Image to Hub - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v') + if: github.repository_owner == 'openziti' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-v')) uses: docker/build-push-action@v2 with: builder: ${{ steps.buildx.outputs.name }} - context: . # build context is workspace so we can copy artifacts from ./release - file: ./ziti-tunnel/docker/Dockerfile.copy # a Dockerfile that does copy instead of fetch - build-args: | # base dir for copy/add operations in Dockerfile + context: ${{ github.workspace }} # build context is workspace so we can copy artifacts from ./release + file: ${{ github.workspace }}/ziti-tunnel/docker/Dockerfile.copy # a Dockerfile that does copy instead of fetch + build-args: | # base dir for copy/add operations should be dir containing Dockerfile DOCKER_BUILD_DIR=./ziti-tunnel/docker platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true diff --git a/.github/workflows/mattermost-ziti-webhook.yml b/.github/workflows/mattermost-ziti-webhook.yml index 93205e9af..30b26c5c0 100644 --- a/.github/workflows/mattermost-ziti-webhook.yml +++ b/.github/workflows/mattermost-ziti-webhook.yml @@ -17,6 +17,7 @@ jobs: name: POST Webhook steps: - uses: openziti/ziti-webhook-action@main + if: github.repository_owner == 'openziti' with: ziti-id: ${{ secrets.ZITI_MATTERMOST_IDENTITY }} webhook-url: ${{ secrets.ZITI_MATTERMOST_WEBHOOK_URL }} From 430a480966c55888c9f0954a3cde0f5c63db66e6 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Tue, 1 Mar 2022 12:12:09 -0500 Subject: [PATCH 2/2] Update deps and changelog. Update for moved trace code --- CHANGELOG.md | 5 +++++ go.mod | 12 ++++++----- go.sum | 21 +++++++++++-------- .../subcmd/stream_toggle_pipe_traces.go | 2 +- ziti-fabric/subcmd/stream_traces.go | 2 +- ziti-fabric/subcmd/trace/dump.go | 4 ++-- ziti-fabric/subcmd/trace/merge.go | 10 ++++----- 7 files changed, 33 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b82a4fe24..c02359297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# Release 0.24.12 + +* Enhancement: Allow xgress proxy configuration in router config to accept service id or service name +* Build: Docker build process fixes + # Release 0.24.11 * Bug fix: Fix ziti CLI env. Config was getting set to current directory, instead of defaulting to under $HOME diff --git a/go.mod b/go.mod index 51f3a4948..56de406ff 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,8 @@ go 1.17 //replace github.com/openziti/foundation => ../foundation +//replace github.com/openziti/channel => ../channel + //replace github.com/openziti/dilithium => ../dilithium //replace github.com/openziti/fabric => ../fabric @@ -33,11 +35,9 @@ require ( github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 github.com/michaelquigley/pfxlog v0.6.3 - github.com/openziti/channel v0.18.6 - github.com/openziti/edge v0.21.102 - github.com/openziti/fabric v0.17.49 - github.com/openziti/foundation v0.17.5 - github.com/openziti/sdk-golang v0.16.8 + github.com/openziti/channel v0.18.8 + github.com/openziti/foundation v0.17.6 + github.com/openziti/sdk-golang v0.16.9 github.com/pborman/uuid v1.2.0 github.com/pkg/errors v0.9.1 github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 @@ -172,5 +172,7 @@ require ( require ( github.com/jedib0t/go-pretty/v6 v6.2.4 + github.com/openziti/edge v0.21.104 + github.com/openziti/fabric v0.17.51 github.com/rivo/uniseg v0.2.0 // indirect ) diff --git a/go.sum b/go.sum index 54c4a8d7e..54048e509 100644 --- a/go.sum +++ b/go.sum @@ -818,19 +818,22 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openziti/channel v0.18.6 h1:bakFjlNFfg5cuAMufQcBQ4XOz/ulWb0n5Hc/GMA05No= -github.com/openziti/channel v0.18.6/go.mod h1:pjoD6e9QgDGnaiakRA+s8YT/FzUHWDhJJF573oOJkXg= +github.com/openziti/channel v0.18.7/go.mod h1:pjoD6e9QgDGnaiakRA+s8YT/FzUHWDhJJF573oOJkXg= +github.com/openziti/channel v0.18.8 h1:0slgV2+2gYCxViiqeBZZiY+wj9r7DNbF0l6DGhu3P7o= +github.com/openziti/channel v0.18.8/go.mod h1:pjoD6e9QgDGnaiakRA+s8YT/FzUHWDhJJF573oOJkXg= github.com/openziti/dilithium v0.3.3 h1:PLgQ6PMNLSTzCFbX/h98cmudgz/cU6TmjdSv5NAPD8k= github.com/openziti/dilithium v0.3.3/go.mod h1:vsCjI2AU/hon9e+dLhUFbCNGesJDj2ASgkySOcpmvjo= -github.com/openziti/edge v0.21.102 h1:0ncIsi8fqjg52n7W5EoAtVWZhqt3NBEtcehvEqsEtpA= -github.com/openziti/edge v0.21.102/go.mod h1:A43aqLR7WvM5C338sTzXTJ5XfcrxpyByHofz7fs8PU0= -github.com/openziti/fabric v0.17.49 h1:GNyKs11G29TFpOrRsbMVbprU6MPhsriWLR3mOogTJ/c= -github.com/openziti/fabric v0.17.49/go.mod h1:HmXBDpElPJ8PkD9UbIm6kzhoA70OnXmqXTbq8MmppSk= +github.com/openziti/edge v0.21.104 h1:vI0hJ4H+VG97axb7VikIgTi7QcDepBCod/dKyTqdfJg= +github.com/openziti/edge v0.21.104/go.mod h1:EFo0HK4ncessHrivn9jCKfcPHTsyWzFIV4P8HOD9iMc= +github.com/openziti/fabric v0.17.50/go.mod h1:FxaGemsdNBI0mYevfF7BNeth5Ap/jKdMKLDdMRk9AQM= +github.com/openziti/fabric v0.17.51 h1:lJ6GBBn/Cu0FndVN1gE9TXmhwAn/EkqAHUW1xh7rUHM= +github.com/openziti/fabric v0.17.51/go.mod h1:3E2uMoRzC6vR+NmD8B5rz+m+MRCXfh2oqrMx1sLS6hs= github.com/openziti/foundation v0.17.1/go.mod h1:qzctNeCrOrPDQDr9g70IPHw+awal87qPqRe3UJLwNXw= -github.com/openziti/foundation v0.17.5 h1:OVmlpWQHPoCiRPSgXzexW2yJI74/5Y0a8/T/oWjb7MQ= github.com/openziti/foundation v0.17.5/go.mod h1:dTaJgdO5OqnKpV+0OPHpnTnqfPpqNGbhJv8O6pMot6o= -github.com/openziti/sdk-golang v0.16.8 h1:pVExmhcIwPc9pFDIpIQYP26RvlFpmhxVPf+LKWz5NO4= -github.com/openziti/sdk-golang v0.16.8/go.mod h1:gWIB38lK7Nnpj3xdUf3rqj9LG23hviYwlkDQfJBU8m4= +github.com/openziti/foundation v0.17.6 h1:M8TcL9HzsZBbu+g5m2jPO+hRRiOI1BK5olZmGjC36mY= +github.com/openziti/foundation v0.17.6/go.mod h1:dTaJgdO5OqnKpV+0OPHpnTnqfPpqNGbhJv8O6pMot6o= +github.com/openziti/sdk-golang v0.16.9 h1:LoFPd5aBjz3tfIsXRxD1Iu9ZyCFOzuQs19pmnDPsIM8= +github.com/openziti/sdk-golang v0.16.9/go.mod h1:Gb2i7GkCTjHr4gHAnM4493mM0BWidwAsli1AQ+6Y2r4= github.com/oracle/oci-go-sdk v24.2.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231 h1:fa50YL1pzKW+1SsBnJDOHppJN9stOEwS+CRWyUtyYGU= diff --git a/ziti-fabric/subcmd/stream_toggle_pipe_traces.go b/ziti-fabric/subcmd/stream_toggle_pipe_traces.go index 246746c21..cf0dbc88c 100644 --- a/ziti-fabric/subcmd/stream_toggle_pipe_traces.go +++ b/ziti-fabric/subcmd/stream_toggle_pipe_traces.go @@ -20,8 +20,8 @@ import ( "fmt" "github.com/golang/protobuf/proto" "github.com/openziti/channel" + "github.com/openziti/channel/trace/pb" "github.com/openziti/fabric/pb/mgmt_pb" - trace_pb "github.com/openziti/foundation/trace/pb" "github.com/spf13/cobra" "time" ) diff --git a/ziti-fabric/subcmd/stream_traces.go b/ziti-fabric/subcmd/stream_traces.go index 17df18a9f..2b26ebc59 100644 --- a/ziti-fabric/subcmd/stream_traces.go +++ b/ziti-fabric/subcmd/stream_traces.go @@ -21,10 +21,10 @@ import ( "fmt" "github.com/golang/protobuf/proto" "github.com/openziti/channel" + "github.com/openziti/channel/trace/pb" "github.com/openziti/fabric/pb/ctrl_pb" "github.com/openziti/fabric/pb/mgmt_pb" "github.com/openziti/fabric/router/xgress" - "github.com/openziti/foundation/trace/pb" "github.com/spf13/cobra" "reflect" "sort" diff --git a/ziti-fabric/subcmd/trace/dump.go b/ziti-fabric/subcmd/trace/dump.go index 83ab4a27f..1471c13dc 100644 --- a/ziti-fabric/subcmd/trace/dump.go +++ b/ziti-fabric/subcmd/trace/dump.go @@ -21,8 +21,8 @@ import ( "errors" "fmt" "github.com/openziti/channel" - "github.com/openziti/foundation/trace" - "github.com/openziti/foundation/trace/pb" + "github.com/openziti/channel/trace" + "github.com/openziti/channel/trace/pb" "github.com/openziti/ziti/ziti-fabric/subcmd" "github.com/spf13/cobra" ) diff --git a/ziti-fabric/subcmd/trace/merge.go b/ziti-fabric/subcmd/trace/merge.go index eb50baed0..f40c0a4ef 100644 --- a/ziti-fabric/subcmd/trace/merge.go +++ b/ziti-fabric/subcmd/trace/merge.go @@ -17,10 +17,10 @@ package trace import ( - "github.com/openziti/foundation/trace" - "github.com/openziti/foundation/trace/pb" "errors" "github.com/michaelquigley/pfxlog" + "github.com/openziti/channel/trace" + "github.com/openziti/channel/trace/pb" "github.com/spf13/cobra" "os" "sort" @@ -74,10 +74,10 @@ func merge(cmd *cobra.Command, args []string) { type mergeItem struct { timestamp int64 - msg interface{} + msg interface{} } -type mergeHandler struct{ +type mergeHandler struct { items []*mergeItem } @@ -94,4 +94,4 @@ func (h *mergeHandler) Handle(msg interface{}) error { } return nil -} \ No newline at end of file +}