Skip to content
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

feat: Argo Rollouts api-server and UI #1015

Merged
merged 116 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from 109 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
2aaec17
Add scaffolding for api server
rbreeze Feb 27, 2021
1ec117a
Add stub for rollouts server command
rbreeze Feb 27, 2021
9b2a147
More work on server
rbreeze Mar 2, 2021
7ef81ac
Add working watch and get endpoints for rollout. Add UI stub.
rbreeze Mar 3, 2021
5352e39
Functional UI list. API streaming endpoints
rbreeze Mar 4, 2021
cd36f60
Fix streaming. More UI progress
rbreeze Mar 5, 2021
8795442
Replace RolloutInfo with API def. More UI progress, add restart endpoint
rbreeze Mar 6, 2021
0c1630b
Fix rollouts watch endpoint. UI watch is smarter. Light/dark mode in …
rbreeze Mar 9, 2021
c0e6c57
Add server action to promote rollout, add more info to rollout UI view
rbreeze Mar 10, 2021
45950d3
Add kubectl plugin dashboard command. Add ability to set image in UI.…
rbreeze Mar 11, 2021
73f3fc4
Remove static files
rbreeze Mar 11, 2021
75fcde9
Makefile modification for CI, replace replicasets with revisions
rbreeze Mar 11, 2021
04b6a28
Improve set image UX and other improvements suggested in standup
rbreeze Mar 12, 2021
58db5b2
UI improvements
rbreeze Mar 13, 2021
77c0b85
Add color coding to images
rbreeze Mar 13, 2021
41d4ea1
Address some feedback from standup
rbreeze Mar 16, 2021
6706c36
Address more feedback
rbreeze Mar 16, 2021
bea7616
Batch edit container images, tooltip for last restarted
rbreeze Mar 16, 2021
925b3a1
Add rollback to api-server and UI
rbreeze Mar 17, 2021
816b666
Begin adding analysis run UI. Lots more UI improvements
rbreeze Mar 22, 2021
58a6d69
Improve search for rollouts list. Add keyboard shortcuts for search a…
rbreeze Mar 23, 2021
246d42f
UI fixes. Add Dockerfile for kubectl plugin / UI
rbreeze Mar 25, 2021
db48b46
Fix rollouts list streaming in UI
rbreeze Mar 27, 2021
33180c7
Fix Dockerfile for kubectl plugin / UI
rbreeze Mar 29, 2021
de9db08
ui bug fixes
rbreeze Mar 30, 2021
4dfb130
Merge branch 'master' into ui
rbreeze Mar 30, 2021
944dea6
Add comment for linter to ignore static file import
rbreeze Mar 30, 2021
cbb2bdf
Merge branch 'ui' of github.com:rbreeze/argo-rollouts into ui
rbreeze Mar 30, 2021
1b5fb92
Add another comment for linter
rbreeze Mar 30, 2021
bb89f70
Fix golint comment
rbreeze Mar 30, 2021
24a3df1
Add static files folder for CI
rbreeze Mar 30, 2021
7f81d9b
Fix leftover reference to info.RolloutInfo
rbreeze Mar 30, 2021
b3c346f
Add version server endpoint. Fix linter errors
rbreeze Mar 30, 2021
f6b8796
Small ui fix and update GH workflow for verifying codegen
rbreeze Mar 30, 2021
4cbf4ae
Fix typo in workflow
rbreeze Mar 30, 2021
297920b
Add execute permissions to install codegen tools script
rbreeze Mar 30, 2021
4541664
Update yarn.lock
rbreeze Mar 30, 2021
d50713e
Remove dependency on scoped npm pkg
rbreeze Mar 30, 2021
b841ec2
Remove extraneous Dockerfile. Fix ViewController test
rbreeze Mar 30, 2021
f73b2a3
Fix linter errors
rbreeze Mar 30, 2021
714d415
Add UI build stage to Dockerfile
rbreeze Mar 30, 2021
6f745ea
Add SonarCloud config to exclude codegened files
rbreeze Mar 30, 2021
45c4812
Move up UI build stage and copy files to main build. Add more config …
rbreeze Mar 30, 2021
b54b39e
Fix typo in Dockerfile
rbreeze Mar 30, 2021
5f24470
Change destination directory for ui files
rbreeze Mar 30, 2021
7e54c1f
Remove ui/dist as dependency for plugin targets
rbreeze Mar 30, 2021
3917759
Fix Docker build
rbreeze Mar 30, 2021
036e01a
Make ui/dist/app directory in Docker build
rbreeze Mar 30, 2021
94970dc
Fix verify-codegen
rbreeze Mar 30, 2021
5365297
Add protoc env var to codegen runner
rbreeze Mar 31, 2021
13a0579
Run codegen and fix codegen workflow
rbreeze Mar 31, 2021
b616fd8
Update verify codegen workflow
rbreeze Mar 31, 2021
a66ac22
Add gopath env var to codegen wf
rbreeze Mar 31, 2021
2af9a5e
Switch order of mock and protogen
rbreeze Mar 31, 2021
9591c1d
Update protogen make target
rbreeze Mar 31, 2021
12a56f3
Update codegen wf
rbreeze Mar 31, 2021
4fbdea9
Move up proto binaries definition
rbreeze Mar 31, 2021
7d99a81
Add go_install alias for Makefile
rbreeze Mar 31, 2021
42213a3
Add codegen dependency on build step
rbreeze Mar 31, 2021
ca2521b
Remove go mod download step from codegen. Remove dependency on build …
rbreeze Mar 31, 2021
77a233f
Downgrade go version for codegen CI
rbreeze Mar 31, 2021
5b31cdb
Update codegen wf
rbreeze Mar 31, 2021
82c7010
Add vendoring step to codegen wf
rbreeze Mar 31, 2021
a1f8c69
Add tools file for dependencies
rbreeze Mar 31, 2021
dfa4804
Debug
rbreeze Mar 31, 2021
cea63e0
revert go.mod/go.sum
rbreeze Apr 1, 2021
f8f2e7a
update go.mod and go.sum
rbreeze Apr 1, 2021
c7bb19b
Fix go.mod
rbreeze Apr 1, 2021
284f71a
Add back dependency to hack/tools
rbreeze Apr 1, 2021
202ae01
Add more deps to hack/tools and remove debug from codegen wf
rbreeze Apr 1, 2021
2a56010
Fix tool in hack/tools
rbreeze Apr 1, 2021
53090c9
Add another tool
rbreeze Apr 1, 2021
41afc60
Add another tool
rbreeze Apr 1, 2021
939d9ff
Replace relative path in Makefile
rbreeze Apr 1, 2021
1f4ad89
Add download step
rbreeze Apr 1, 2021
cf13509
typo
rbreeze Apr 1, 2021
2a08976
Update grpc-gateway go.mod
rbreeze Apr 1, 2021
67fda0a
go.sum
rbreeze Apr 1, 2021
9d5ba8c
Remove bin/mockery Makefile target
rbreeze Apr 1, 2021
5b847f5
Remove go generate from Makefile
rbreeze Apr 1, 2021
45ed6d2
Install swagger-codegen before running codegen
rbreeze Apr 1, 2021
c50f3ea
Run npm as root
rbreeze Apr 1, 2021
9f45c36
Install UI code generator locally with yarn
rbreeze Apr 1, 2021
ea276e6
fix ui codegen
rbreeze Apr 1, 2021
3eca2b8
run install ui codegen as root
rbreeze Apr 1, 2021
9925910
Add java version
rbreeze Apr 1, 2021
139696e
Ignore codegened files in codecov
rbreeze Apr 1, 2021
173143f
Add execute permission to swagger-codegen binary
rbreeze Apr 1, 2021
4478121
Fix swagger-codegen install
rbreeze Apr 1, 2021
c416a83
typo
rbreeze Apr 1, 2021
0728767
generate manifests
rbreeze Apr 1, 2021
9ca44b4
Upgrade swagger-codegen version
rbreeze Apr 1, 2021
432e95a
fix swagger-codegen version
rbreeze Apr 1, 2021
c45f75d
Codegen
rbreeze Apr 1, 2021
71ceff9
Upgrade protoc
rbreeze Apr 1, 2021
cd60683
Add timeout flag and test for get rollout watch
rbreeze Apr 2, 2021
51cb2a2
lint
rbreeze Apr 2, 2021
84795e5
Rerun codegen
rbreeze Apr 2, 2021
8087816
Fix ui issues
rbreeze Apr 2, 2021
4fb95d5
Resolve merge conflicts
rbreeze Apr 2, 2021
518e81d
Remove standalone server make target and cmd stub
rbreeze Apr 7, 2021
55e2cda
Tweak rollouts list. Fix plugin make target
rbreeze Apr 7, 2021
51e1f5a
Add duration unit labels for steps
rbreeze Apr 7, 2021
cb2e6cb
Update mkdocs
rbreeze Apr 7, 2021
7d97df6
Update mkdocs
rbreeze Apr 7, 2021
c3efeb4
Replace v1alpha1.RolloutInfo with rollout.RolloutInfo (generated)... …
rbreeze Apr 7, 2021
d5484ca
Fix UI crash due to updated types
rbreeze Apr 7, 2021
44e0deb
Lint
rbreeze Apr 7, 2021
121c3a0
Add revision to replicasets on rollouts list page
rbreeze Apr 7, 2021
f0353a9
Add docs page for dashboard
rbreeze Apr 8, 2021
2667ce9
Address code review comments
rbreeze Apr 8, 2021
75eeb71
Resolve merge conflict
rbreeze Apr 8, 2021
fa2ba5f
Address code review comments
rbreeze Apr 8, 2021
c1333cd
lint
rbreeze Apr 8, 2021
51c53c4
Minor UI improvements and fixes
rbreeze Apr 8, 2021
f1b4800
More ui enhancements
rbreeze Apr 9, 2021
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
12 changes: 10 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@ coverage:
default:
threshold: 0.1
ignore:
- "pkg/apis/rollouts/v1alpha1"
- "test"
- "pkg/apis/rollouts/v1alpha1"
- "test"
- "**/*.pb.go"
- "**/*.pb.gw.go"
- "**/*generated.go"
- "**/*generated.deepcopy.go"
- "**/*_test.go"
- "pkg/apis/client/.*"
- "pkg/client/.*"
- "vendor/.*"
126 changes: 90 additions & 36 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Go
on:
push:
branches:
- 'master'
- 'release-*'
- "master"
- "release-*"
pull_request:
branches:
- 'master'
- "master"
jobs:
lint-go:
name: Lint Go code
Expand All @@ -23,58 +23,112 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
id: go

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Restore go build cache
uses: actions/cache@v2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
- name: Restore go build cache
uses: actions/cache@v2
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}

- name: Download all Go modules
run: |
go mod download
- name: Download all Go modules
run: |
go mod download

- name: Compile all packages
run: make controller plugin
- name: Compile all packages
run: make controller plugin

- name: Test
run: go test -failfast -covermode=count -coverprofile=coverage.out ./...
- name: Test
run: go test -failfast -covermode=count -coverprofile=coverage.out ./...

- name: Generate code coverage artifacts
uses: actions/upload-artifact@v2
with:
name: code-coverage
path: coverage.out
- name: Generate code coverage artifacts
uses: actions/upload-artifact@v2
with:
name: code-coverage
path: coverage.out

- name: Upload code coverage information to codecov.io
uses: codecov/codecov-action@v1
with:
file: coverage.out
- name: Upload code coverage information to codecov.io
uses: codecov/codecov-action@v1
with:
file: coverage.out

codegen:
name: Verify Codegen
runs-on: ubuntu-latest
env:
GOPATH: /home/runner/go
PROTOC_ZIP: protoc-3.12.3-linux-x86_64.zip
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Download & vendor dependencies
go-version: 1.16.2
- uses: actions/cache@v2
with:
path: /home/runner/.cache/go-build
key: GOCACHE-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v2
with:
path: /home/runner/go/pkg/mod
key: GOMODCACHE-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v2
with:
path: /home/runner/go/bin
key: go-bin-v1-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v2
with:
path: protoc-3.12.3-linux-x86_64.zip
key: protoc-3.12.3-linux-x86_64.zip
- name: Install protoc
run: |
set -eux -o pipefail
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
sudo chmod +x /usr/local/bin/protoc
sudo find /usr/local/include -type f | xargs sudo chmod a+r
sudo find /usr/local/include -type d | xargs sudo chmod a+rx
ls /usr/local/include/google/protobuf/

- name: Add ~/go/bin to PATH
run: |
echo "/home/runner/go/bin" >> $GITHUB_PATH
- name: Add /usr/local/bin to PATH
run: |
echo "/usr/local/bin" >> $GITHUB_PATH

- name: Create links
run: |
mkdir -p ~/go/src/github.com/argoproj
cp -a ../argo-rollouts ~/go/src/github.com/argoproj

- name: Vendor and Download
run: |
# We need to vendor go modules for codegen yet
go mod download
go mod vendor -v
go mod download

- name: Install UI code generator
run: |
wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.25/swagger-codegen-cli-3.0.25.jar -O swagger-codegen-cli.jar
echo "#!/usr/bin/java -jar" > swagger-codegen
cat swagger-codegen-cli.jar >> swagger-codegen
chmod +x swagger-codegen
sudo mv swagger-codegen /usr/local/bin/swagger-codegen
rm swagger-codegen-cli.jar

- uses: actions/setup-java@v1
with:
java-version: "9.0.4"

- name: Run codegen
run: |
make codegen
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ site/
vendor/
# generated
docs/generated
# static
server/static/*
!server/static/.gitkeep
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
run:
deadline: 1m
skip-files:
- ".*\\.pb\\.go"
skip-dirs:
- pkg/client
modules-download-mode: readonly
Expand Down
42 changes: 39 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image
# Also used as the image in CI jobs so needs all dependencies
####################################################################################################
FROM golang:1.15.8 as builder
FROM golang:1.16.1 as builder

RUN apt-get update && apt-get install -y \
wget \
Expand All @@ -24,21 +24,57 @@ RUN cd ${GOPATH}/src/dummy && \
golangci-lint run

####################################################################################################
# Rollout Controller Build stage which performs the actual build of argo-rollouts binaries
# UI build stage
####################################################################################################
FROM golang:1.15.8 as argo-rollouts-build
FROM docker.io/library/node:12.18.4 as argo-rollouts-ui

WORKDIR /src
ADD ["ui/package.json", "ui/yarn.lock", "./"]

RUN yarn install

ADD ["ui/", "."]

ARG ARGO_VERSION=latest
ENV ARGO_VERSION=$ARGO_VERSION
RUN NODE_ENV='production' yarn build

####################################################################################################
# Rollout Controller Build stage which performs the actual build of argo-rollouts binaries
####################################################################################################
FROM golang:1.16.1 as argo-rollouts-build

WORKDIR /go/src/github.com/argoproj/argo-rollouts

# Copy only go.mod and go.sum files. This way on subsequent docker builds if the
# dependencies didn't change it won't re-download the dependencies for nothing.
COPY go.mod go.sum ./
RUN go mod download

# Copy UI files for plugin build
COPY --from=argo-rollouts-ui ./src/dist/app ./ui/dist

# Perform the build
COPY . .

# stop make from trying to re-build this without yarn installed
RUN touch ui/dist/node_modules.marker
RUN mkdir ui/dist/app
RUN touch ui/dist/app/index.html

ARG MAKE_TARGET="controller plugin-linux plugin-darwin"
RUN make ${MAKE_TARGET}

####################################################################################################
# Kubectl plugin image
####################################################################################################
FROM scratch as kubectl-argo-rollouts

COPY --from=argo-rollouts-build /go/src/github.com/argoproj/argo-rollouts/dist/kubectl-argo-rollouts-linux-amd64 /bin/kubectl-argo-rollouts

WORKDIR /home/argo-rollouts

ENTRYPOINT ["/bin/kubectl-argo-rollouts", "dashboard"]

####################################################################################################
# Final image
Expand Down
Loading