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

Knlambert/2.14.0 rc #146

Closed
wants to merge 131 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
b4c68e4
Add the option make local and update the README file with instruction…
arturogonzalez58 Mar 31, 2021
9e14253
Remove the error handling at the frontend layer to be added by the us…
arturogonzalez58 Apr 1, 2021
79ba48b
UI is separated from the web service and now is served from a nginx c…
arturogonzalez58 Apr 5, 2021
f556028
Remove go code from html template
arturogonzalez58 Apr 7, 2021
4619a3d
- Disable cache from nginx server
arturogonzalez58 Apr 8, 2021
629550c
- Disable cache from nginx from webpack configuration
arturogonzalez58 Apr 9, 2021
56f6dc9
Create Vote-fixed.jsx
mattmcclure-dw Apr 13, 2021
ab225b8
remove namespace
mattmcclure-dw Apr 15, 2021
0d903dc
Merge pull request #1 from mattmcclure-dw/patch-1
mattmcclure-dw Apr 15, 2021
3f0e978
replace ns
mattmcclure-dw Apr 16, 2021
d06b0ae
Update Vote-fixed.jsx
mattmcclure-dw Apr 19, 2021
726e772
Create the manifests folder from kustomize
Jul 8, 2021
34428e3
Merge pull request #2 from datawire/leoluz/dev/manifests
leoluz Jul 9, 2021
1e10c87
fix nginx proxy
arturogonzalez58 Jul 12, 2021
2adf2ae
linter
arturogonzalez58 Jul 12, 2021
9c1cbab
remove nginx configuration
arturogonzalez58 Jul 13, 2021
0770ad8
configure emojivoto-web-app with rollout
Jul 12, 2021
1d77805
Merge pull request #3 from datawire/leoluz/dev/rollout
leoluz Jul 13, 2021
f38820c
Merge pull request #4 from datawire/aglez/dev/nginx-proxy
arturogonzalez58 Jul 13, 2021
4af326a
fix service annotations
Jul 15, 2021
251ba41
Merge pull request #5 from datawire/leoluz/dev/fix.mapping
leoluz Jul 15, 2021
98d7703
Disable https redirect
Jul 22, 2021
3b20242
Merge pull request #6 from datawire/maxlegault/dev/disable-https-redi…
maxlegault Jul 22, 2021
a7985bc
remove footer
arturogonzalez58 Jul 30, 2021
2efd104
Add emojivoto label to reload apps
Jul 30, 2021
47cdf70
Merge pull request #8 from datawire/maxlegault/dev/add-emojivoto-labe…
maxlegault Jul 30, 2021
8efa612
Merge pull request #7 from datawire/aglez/dev/remove_footer
arturogonzalez58 Jul 30, 2021
e040ff8
add error message
arturogonzalez58 Aug 25, 2021
19b66e5
update image to reload apps
arturogonzalez58 Aug 25, 2021
0c7d465
Merge pull request #9 from datawire/aglez/dev/better_error_display
arturogonzalez58 Aug 25, 2021
ca0875c
wip
Sep 23, 2021
d7a8674
Add logic to send intercept header
Sep 23, 2021
2a2454b
Change argo rollout revision
Sep 23, 2021
55d1ca9
Add telepresenceInterceptHeaderName
Sep 24, 2021
abeefc6
Pump v11 to v11.1
Sep 24, 2021
956b353
Add header propagation for all services
Sep 24, 2021
f5364db
update image to datawire
Sep 24, 2021
180db4e
Merge pull request #10 from datawire/maxlegault/wip/header-propagation
Sep 27, 2021
5ca2dfd
Add termination grace period to voting-service
ikanadev Sep 28, 2021
05ffabc
Merge pull request #12 from datawire/vmkevv/termination-period-in-vot…
ikanadev Sep 28, 2021
fa4ed63
🔊 Add logging to requests
Jan 13, 2022
17224ea
Add build-releases target
Jan 14, 2022
605131b
Add a github action to release binary on tag created
Jan 17, 2022
202fc56
Merge pull request #13 from datawire/pgranger/dev/add-logging
grangerp Jan 18, 2022
5722865
Add setup dev env for web-app
danielbryantuk Dec 7, 2021
2575886
Update API KEY messaging
danielbryantuk Dec 7, 2021
115e1b2
Update Amb Cloud messaging
danielbryantuk Dec 7, 2021
c50dc4b
Updated telepresence login and intercept
danielbryantuk Dec 9, 2021
a1235b0
🔨 adapt to run with linux or mac
Jan 25, 2022
068bae9
chore: add the namespace to the tp command and update the MOUNT_VOLUM…
Jan 25, 2022
b3c81bc
chore: fix sleep and update the MOUNT_VOLUME_PATH
Jan 26, 2022
1f7ae9f
Add a sleep of 2 to adress pr cpmment
Jan 26, 2022
1581d8d
🔀 Merge pull request #14 from datawire/pgranger/dev/copy-provision-sc…
grangerp Jan 26, 2022
826cf43
📈 Add telemetry to intermediate cloud tour script
Jan 26, 2022
148a477
Change ACTIVITY_REPORT_TYPE
Jan 27, 2022
e4835d2
Use system open command to open file
Jan 27, 2022
38d401c
🔀 Merge pull request #15 from datawire/pgranger/dev/add-telemetry
grangerp Jan 27, 2022
ba6b2b9
Add more output to setup dev script
Jan 31, 2022
3f1d07c
Indent outputs inside steps
Feb 1, 2022
683e7b2
Add *** before steps
Feb 1, 2022
f1f653a
Install telepresence before starting the container
Feb 2, 2022
d2a6a0d
Check that docker daemon is started
Feb 2, 2022
20611a1
Fix typ
Feb 2, 2022
27ed14d
🔀 Merge pull request #17 from datawire/pgranger/dev/add-output-to-script
grangerp Feb 2, 2022
3a3a2be
Silent the script when we check for the demo container running
Feb 3, 2022
f2fdedf
🔀 Merge pull request #18 from datawire/pgranger/dev/change-script-ver…
grangerp Feb 3, 2022
e59593b
Upgrade telepresence if older version detected
Feb 3, 2022
2bdb2e3
🔀 Merge pull request #19 from datawire/pgranger/dev/script-upgrade-te…
grangerp Feb 3, 2022
37b88c0
Add segment to setup_dev_env.sh script for metrics
Feb 8, 2022
e0761de
🔀 Merge pull request #20 from datawire/pgranger/dev/add-segment-to-sc…
grangerp Feb 8, 2022
fe98537
Change docker image to use
Feb 11, 2022
9726713
Merge pull request #21 from datawire/pgranger/dev/get-cluster-kubeconfig
Feb 16, 2022
a4a8825
chore: perform login before to connect
Feb 19, 2022
d9a43f1
Merge pull request #22 from datawire/joseldmc/dev/connect-2_5_0
Feb 19, 2022
e57b591
Replace beta-auth.datawire.io with staging-auth.datawire.io so demo a…
aosoriodw Apr 11, 2022
bcc483e
Merge pull request #23 from datawire/aosorio/migrate-staging
rhs Apr 12, 2022
bebd4fc
Ensure that running telepresence daemons are stopped
thallgren May 17, 2022
d30306f
Merge pull request #27 from datawire/thallgren/stop-daemons
richarddli May 17, 2022
b5f86db
chore: use tp 2.5.8 to avoid the tour to fail
May 18, 2022
35abfaa
Merge pull request #28 from datawire/joseldmc/dev/use-2-5-8-intermedi…
May 18, 2022
e6a081f
Add integration test workflow and action
DanieldeR May 18, 2022
60a4122
Merge pull request #29 from DanieldeR/add_actions
DanieldeR May 18, 2022
9f0b9fb
Revert "Add integration test workflow and action"
hojenkai May 18, 2022
5459254
Merge pull request #30 from datawire/revert-29-add_actions
May 18, 2022
f612056
chore: update TP version in script
Jul 7, 2022
1bd5e1a
Merge pull request #35 from datawire/joseldmc/dev/update-tp-version
Jul 8, 2022
a1955d9
Add support for edge stack clusters
knlambert Jul 26, 2022
c93d849
Merge pull request #37 from datawire/knlambert/support-edge-stack-setup
Jul 26, 2022
ac378f7
added the openapi spec on /api/openapi (#36)
jacoblbeck Jul 28, 2022
d8e1926
change web-app for intercept (#38)
jacoblbeck Jul 28, 2022
0f831c6
updated the description of the api contract (#39)
jacoblbeck Jul 28, 2022
e7e1d12
chore: add padding to bottom
ricardo-labarca Aug 11, 2022
a1de2c7
chore: upgrade telepresence version to 2.7.1
ricardo-labarca Aug 11, 2022
f3caece
Merge pull request #40 from datawire/ricardo/dev/upgrade-telepresence
ricardo-labarca Aug 11, 2022
174e744
upgrade tp version
JaquelineCaamal Sep 14, 2022
4b3e15e
update TP version to 2.7.5
JaquelineCaamal Sep 15, 2022
989563f
Merge pull request #43 from datawire/jaqueline/dev/upgrade-tp-version…
JaquelineCaamal Sep 22, 2022
1cb499f
upgrade telepresence to v2.7.6
Oct 6, 2022
99b9ec2
Merge pull request #44 from datawire/victor/dev/upgrade-tp-to-2.7.6
Oct 6, 2022
c8ebaab
chore: upgrade tp to 2.8.2
ricardo-labarca Oct 18, 2022
8174451
chore: change telepresence parameters
ricardo-labarca Oct 18, 2022
1425823
Merge pull request #45 from datawire/ricardo/dev/upgrade-tp-282
ricardo-labarca Oct 19, 2022
45908ad
updated tp version to 2.10.3 (#48)
jacoblbeck Jan 18, 2023
010135b
changed intercept to personal (#49)
jacoblbeck Jan 18, 2023
e87e506
update tele version to 2.11.0 (#50)
jacoblbeck Feb 23, 2023
4ddecbd
Update tp version to 2.12.1
Mar 23, 2023
349523d
Merge pull request #51 from datawire/shepz/update-tel-2.12.1
shepz Mar 23, 2023
0d6ecb7
Tweak the demo script to make it run in docker mode only
knlambert Mar 23, 2023
c1e5022
Ensure the intercept runs in docker
knlambert Mar 23, 2023
7815847
Update steps
knlambert Mar 23, 2023
5d6d886
Fix typo in context
knlambert Mar 23, 2023
3bef0e6
Merge pull request #52 from datawire/knlambert/run-demo-with-docker
Mar 27, 2023
3de2add
Upgrade telepresence to 2.12.2
knlambert Apr 5, 2023
14674bb
Merge pull request #53 from datawire/knlambert/bump-tp-2.12.2
Apr 5, 2023
6a9859c
Upgrade telepresence to 2.13.0
knlambert Apr 19, 2023
ae7f346
Merge pull request #54 from datawire/knlambert/bump-tp-2.13.0
Apr 19, 2023
beafe69
bump tp version
jacoblbeck Apr 26, 2023
d630536
Merge pull request #55 from datawire/bump_tp_version_2.13.1
Apr 26, 2023
665e6d7
add powershell script
arturogonzalez58 May 9, 2023
2a8be46
Upgrade telepresence to 2.13.2
d6e-automaton May 12, 2023
f789449
Merge pull request #57 from datawire/upgrade-tp-to-2.13.2-build-1
shepz May 15, 2023
63f13f0
improve the script
arturogonzalez58 May 15, 2023
1980b9a
add telepresence-setup.exe installation
arturogonzalez58 May 16, 2023
fad0f93
fix send metrics
arturogonzalez58 May 16, 2023
85b760a
update the script
arturogonzalez58 May 25, 2023
6c2b269
Upgrade telepresence to 2.13.3
d6e-automaton May 25, 2023
fc571e2
Merge pull request #58 from datawire/upgrade-tp-to-2.13.3-build-2
thallgren May 26, 2023
3e3e2d6
fixes some comments
arturogonzalez58 May 29, 2023
f400895
fix comments
arturogonzalez58 May 30, 2023
0f3153a
Merge pull request #56 from datawire/agv/dev/windows_script
arturogonzalez58 May 31, 2023
c31b6a0
Upgrade to 2.14.0-rc.11
knlambert Jun 12, 2023
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
56 changes: 56 additions & 0 deletions .ambassador-internal/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
openapi: 3.0.0
info:
title: Emojivoto API
description: Endpoints for the Emojivoto backend.
version: 0.1.0
paths:
/vote:
get:
parameters:
- in: query
name: choice
schema:
type: string
required: true
description: The emoji to vote for
responses:
'200':
description: The resource was deleted successfully.
/list:
get:
summary: Returns a list of available emojies
responses:
'200':
description: A JSON object with a quote and some additional metadata.
content:
application/json:
schema:
items:
type: "array"
items:
type: "object"
properties:
shortcode:
type: string
unicode:
type: string
/leaderboard:
get:
summary: Returns a leaderboard of the best emojies
responses:
'200':
description: A JSON object with a quote and some additional metadata.
content:
application/json:
schema:
items:
type: "array"
items:
type: "object"
properties:
shortcode:
type: string
unicode:
type: string
votes:
type: number
32 changes: 32 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: publish

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: install protobuf compiler
run: sudo apt install -y protobuf-compiler
- uses: actions/setup-go@v2
with:
go-version: '1.17.5'
- name: install protoc
run: |
go get -u github.com/golang/protobuf/proto && \
go get -u github.com/golang/protobuf/protoc-gen-go && \
go get google.golang.org/protobuf/reflect/protoreflect && \
go get google.golang.org/protobuf/runtime/protoimpl && \
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc
- name: Build release
run: make -C emojivoto-web build-releases
- name: Release
uses: softprops/action-gh-release@v0.1.14
with:
files: ./emojivoto-web/bin/*
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM buoyantio/emojivoto-svc-base:v11
FROM datawire/emojivoto-svc-base:v11.1

ARG svc_name

COPY $svc_name/target/ /usr/local/bin/

COPY .ambassador-internal/openapi.yaml /.ambassador-internal/openapi.yaml

# ARG variables arent available for ENTRYPOINT
ENV SVC_NAME $svc_name
ENTRYPOINT cd /usr/local/bin && $SVC_NAME
8 changes: 8 additions & 0 deletions Dockerfile-ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM nginx:latest

ARG svc_name

COPY $svc_name/dist/index.html /usr/share/nginx/html/index.html
COPY $svc_name/dist/index_bundle.js /usr/share/nginx/html/
COPY web-app-nginx.conf /etc/nginx/conf.d/default.conf
RUN chown -R nginx:nginx /var/cache/nginx
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,37 @@ include ./common.mk
all: build integration-tests

build-base-docker-image:
docker build . -f Dockerfile-base -t "buoyantio/emojivoto-svc-base:$(IMAGE_TAG)"
docker build . -f Dockerfile-base -t "datawire/emojivoto-svc-base:$(IMAGE_TAG)"

web:
$(MAKE) -C emojivoto-web

web-app:
$(MAKE) -C emojivoto-web-app

emoji-svc:
$(MAKE) -C emojivoto-emoji-svc

voting-svc:
$(MAKE) -C emojivoto-voting-svc

build: web emoji-svc voting-svc
emoji-svc-local:
$(MAKE) -C emojivoto-emoji-svc local

voting-svc-local:
$(MAKE) -C emojivoto-voting-svc local

web-local:
$(MAKE) -C emojivoto-web local

web-app-local:
$(MAKE) -C emojivoto-web-app local

build: web web-app emoji-svc voting-svc

build-ui: build-container-ui

local: web-local web-app-local emoji-svc-local voting-svc-local

multi-arch:
$(MAKE) -C emojivoto-web build-multi-arch
Expand All @@ -39,6 +58,6 @@ deploy-to-docker-compose:
docker-compose -f ./docker-compose.yml up -d

push-%:
docker push buoyantio/emojivoto-$*:$(IMAGE_TAG)
docker push datawire/emojivoto-$*:$(IMAGE_TAG)

push: push-svc-base push-emoji-svc push-voting-svc push-web
push: push-svc-base push-emoji-svc push-voting-svc push-web push-web-app
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,31 @@ This can be disabled by unsetting the `PROM_PORT` environment variable.

### Emojivoto webapp

#### Requirements
1. Set your `GOPATH`
```shell
export GOPATH=/path/to/go
```
2. Add your `GOPATH/bin` to the `PATH`
```shell
export PATH=$PATH:$GOPATH/bin
```
3. Install protobuf compiler: https://grpc.io/docs/protoc-installation/
4. Install go packages
```shell
go get -u github.com/golang/protobuf/protoc-gen-go
go get google.golang.org/protobuf/reflect/protoreflect@v1.26.0
go get google.golang.org/protobuf/runtime/protoimpl@v1.26.0
```
5. Install yarn: https://classic.yarnpkg.com/en/docs/install/
#### Building process
This app is written with React and bundled with webpack.
Use the following to run the emojivoto go services and develop on the frontend.

Set up proto files, build apps

```bash
make build
make local
```

Start the voting service
Expand Down
149 changes: 149 additions & 0 deletions assets/Vote-fixed.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import React from 'react';
import _ from 'lodash';
import { Link } from 'react-router-dom';
import 'whatwg-fetch';

const EmojiVotoPage = ({headline, contents, containerClass, preHeadline}) => {
return (
<div className={containerClass}>
<div className="page-content container-fluid">
<div className="row">
<div className="col-md-12">
{!preHeadline ? null : preHeadline}
<h1 className="headline">{headline}</h1>

{contents}
</div>
</div>
</div>
</div>
);
}
export default class Vote extends React.Component {
constructor(props) {
super(props);
this.resetState = this.resetState.bind(this);
this.state = {
emojiList: [],
selectedEmoji: null,
error: null
}
}

loadFromServer() {
fetch('/api/list').then(rsp => {
rsp.json().then(r => {
this.setState({ emojiList: r })
}).catch(e => {
this.setState( {error: e.statusText });
}).catch(e => {
this.setState( {error: e.statusText });
});
});
}

componentDidMount() {
this.loadFromServer();
}

vote(emoji) {
fetch(`/api/vote?choice=${emoji.shortcode}`).then(rsp => {
if (rsp.ok) {
this.setState({ selectedEmoji: emoji, error: null });
} else {
throw new Error("Unable to Register Vote");
}
}).catch(e => {
this.setState({ selectedEmoji: emoji, error: e.toString() });
});
}

resetState() {
this.setState({ selectedEmoji: null, error: null });
}

renderEmojiList(emojis) {
return _.map(emojis, (emoji, i) => {
return (
<div
className="emoji emoji-votable"
key={`emoji-${i}`}
onClick={e => this.vote(emoji)}
>
{emoji.unicode}
</div>
);
});
}

renderLeaderboardLink() {
return <Link to="/leaderboard"><div className="btn btn-blue">View the leaderboard</div></Link>;
}

render() {
if (this.state.error) {
let errorMessage = <p>We couldn't process your request.</p>;
if(this.state.selectedEmoji.shortcode === ":doughnut:") {
errorMessage = (<div>
<p className="doughnut-explanation">Sorry, currently unable to vote for 🍩.<br />
Please go back and choose another emoji.
</p>
<p><Link to="/" onClick={this.resetState}>Pick another</Link>!</p>
</div>);
}

let contents = (
<div>
{errorMessage}
<Link to="/" onClick={this.resetState}><div className="btn btn-blue">Select again</div></Link>
</div>
);

return <EmojiVotoPage
preHeadline={<h1 className="title">404</h1>}
headline="🚧"
contents={contents}
containerClass="background-500"
/>;
} else if (!this.state.selectedEmoji) {
let emojiList = this.state.emojiList;
let contents = (
<div>
<h1>EMOJI VOTE</h1>
<p>Tap to vote for your favorite emoji below</p>
{this.renderLeaderboardLink()}
{!_.isEmpty(emojiList) ? null : <div>Loading emoji...</div>}

<div className="emoji-list">
{this.renderEmojiList(emojiList)}

<div className="footer-text">
<p>A <a href='https://buoyant.io'>Buoyant</a> social experiment</p>
<p>© 2017 Buoyant, Inc. All Rights Reserved.</p>
</div>
</div>
</div>
);

return <EmojiVotoPage
headline="🗳"
contents={contents}
containerClass="background"
/>;
} else {
let contents = (
<div>
<p>See how you stack up against others</p>
{this.renderLeaderboardLink()}
<Link to="/" onClick={this.resetState}><div className="btn btn-white">Pick another one</div></Link>
</div>
);
return <EmojiVotoPage
preHeadline={<h1>You picked:</h1>}
headline={this.state.selectedEmoji.unicode}
contents={contents}
containerClass ="background"
/>;
}
}
}
21 changes: 13 additions & 8 deletions common.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export IMAGE_TAG := v11
export IMAGE_TAG := v11.6

.PHONY: package protoc test

Expand All @@ -10,23 +10,28 @@ clean:
mkdir -p $(target_dir)
mkdir -p gen

protoc:
protoc -I .. ../proto/*.proto --go_out=plugins=grpc:gen
protoc:
protoc -I .. ../proto/*.proto --go_out=paths=source_relative:./gen --go-grpc_out=paths=source_relative:./gen

package: protoc compile build-container

package-ui: build-container-ui

build-container:
docker build .. -t "buoyantio/$(svc_name):$(IMAGE_TAG)" --build-arg svc_name=$(svc_name)
docker build .. --platform linux/amd64 -t "datawire/$(svc_name):$(IMAGE_TAG)" --build-arg svc_name=$(svc_name)

build-multi-arch:
docker buildx build .. -t "buoyantio/$(svc_name):$(IMAGE_TAG)" --build-arg svc_name=$(svc_name) \
-f ../Dockerfile-multi-arch --platform linux/amd64,linux/arm64,linux/arm/v7 --push
docker buildx build .. -t "datawire/$(svc_name):$(IMAGE_TAG)" --build-arg svc_name=$(svc_name) \
-f ../Dockerfile-multi-arch --platform linux/amd64,linux/arm64 --push

build-container-ui:
docker build .. -t "datawire/emojivoto-web-app:$(IMAGE_TAG)" --build-arg svc_name=emojivoto-web-app -f ../Dockerfile-ui

compile:
GOOS=linux go build -v -o $(target_dir)/$(svc_name) cmd/server.go
GOOS=linux GOARCH=amd64 go build -v -o $(target_dir)/$(svc_name) cmd/server.go

test:
go test ./...

run:
go run cmd/server.go
go run cmd/server.go
Loading