Skip to content

Commit

Permalink
Merge pull request #473 from vitessio/remove-ghapp-server
Browse files Browse the repository at this point in the history
  • Loading branch information
frouioui authored Oct 24, 2023
2 parents 88ce5c8 + eee7173 commit 057d923
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 268 deletions.
38 changes: 0 additions & 38 deletions Dockerfile.ghapp

This file was deleted.

20 changes: 0 additions & 20 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ services:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.https.address=:443"
- "--entrypoints.https-ghapp.address=:8181"
- "--certificatesresolvers.tlsresolver.acme.tlschallenge=true"
- "--certificatesresolvers.tlsresolver.acme.email=cncf-vitess-project@cncf.io"
- "--certificatesresolvers.tlsresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "443:443"
- "8181:8181"
volumes:
- "/var/letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
Expand Down Expand Up @@ -71,21 +69,3 @@ services:
- "traefik.http.routers.api.tls.certresolver=tlsresolver"
- "traefik.http.services.api.loadbalancer.server.port=8080"
network_mode: bridge

ghapp:
restart: always
build:
context: .
dockerfile: Dockerfile.ghapp
image: "arewefastyet-ghapp"
container_name: "ghapp"
volumes:
- "./config/prod/config.yaml:/config/config.yaml"
- "./config/prod/secrets.yaml:/config/secrets.yaml"
labels:
- "traefik.enable=true"
- "traefik.http.routers.ghapp.rule=Host(`benchmark.vitess.io`)"
- "traefik.http.routers.ghapp.entrypoints=https-ghapp"
- "traefik.http.routers.ghapp.tls.certresolver=tlsresolver"
- "traefik.http.services.ghapp.loadbalancer.server.port=8181"
network_mode: bridge
18 changes: 0 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,6 @@ services:
- "traefik.http.services.api.loadbalancer.server.port=8080"
network_mode: bridge

ghapp:
restart: always
build:
context: .
dockerfile: Dockerfile.ghapp
image: "arewefastyet-ghapp"
container_name: "ghapp"
volumes:
- "./config/dev/config.yaml:/config/config.yaml"
- "./config/dev/secrets.yaml:/config/secrets.yaml"
labels:
- "traefik.enable=true"
- "traefik.http.routers.ghapp.rule=Host(`localhost`)"
- "traefik.http.routers.ghapp.rule=PathPrefix(`/ghapp`)"
- "traefik.http.routers.ghapp.entrypoints=http"
- "traefik.http.services.ghapp.loadbalancer.server.port=8181"
network_mode: bridge

frontend:
build:
context: ./website
Expand Down
1 change: 0 additions & 1 deletion docs/arewefastyet.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Vitess has to ensure it's delivering flawless performance to its users. In order
* [arewefastyet completion](arewefastyet_completion.md) - Generate the autocompletion script for the specified shell
* [arewefastyet exec](arewefastyet_exec.md) - Execute a task
* [arewefastyet gen](arewefastyet_gen.md) - Generate things
* [arewefastyet ghapp](arewefastyet_ghapp.md) - Starts the arewefastyet GitHub bot
* [arewefastyet macrobench](arewefastyet_macrobench.md) - Top level command to manage macrobenchmarks
* [arewefastyet microbench](arewefastyet_microbench.md) - Top level command to manage microbenchmarks

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/otiai10/copy v1.12.0
github.com/palantir/go-githubapp v0.18.0
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/robfig/cron/v3 v3.0.1
github.com/rs/zerolog v1.29.1
Expand Down Expand Up @@ -95,6 +94,7 @@ require (
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
Expand Down
45 changes: 0 additions & 45 deletions go/cmd/ghapp/ghapp.go

This file was deleted.

2 changes: 0 additions & 2 deletions go/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/vitessio/arewefastyet/go/cmd/api"
"github.com/vitessio/arewefastyet/go/cmd/exec"
"github.com/vitessio/arewefastyet/go/cmd/gen"
"github.com/vitessio/arewefastyet/go/cmd/ghapp"
"github.com/vitessio/arewefastyet/go/cmd/macrobench"
"github.com/vitessio/arewefastyet/go/cmd/microbench"

Expand Down Expand Up @@ -68,7 +67,6 @@ func init() {
rootCmd.AddCommand(macrobench.MacroBenchCmd())
rootCmd.AddCommand(exec.ExecCmd())
rootCmd.AddCommand(gen.GenCmd())
rootCmd.AddCommand(ghapp.GHAppCmd())
}

// initConfig reads in config file and ENV variables if set.
Expand Down
24 changes: 0 additions & 24 deletions go/tools/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package github

import (
"context"
"net/http"
"os"
"time"

Expand Down Expand Up @@ -68,29 +67,6 @@ func (a *App) AddToCommand(cmd *cobra.Command) {
_ = viper.BindPFlag(flagInstallationID, cmd.Flags().Lookup(flagInstallationID))
}

func (a *App) Run() error {
prHandler := pullRequestHandler{
ClientCreator: a.cc,
}

webhookHandler := githubapp.NewEventDispatcher(
[]githubapp.EventHandler{prHandler},
a.webHookSecret,
githubapp.WithScheduler(
githubapp.AsyncScheduler(),
),
)

http.Handle("/ghapp"+githubapp.DefaultWebhookRoute, webhookHandler)

a.logger.Info().Msg("server running")
err := http.ListenAndServe(":"+a.port, webhookHandler)
if err != nil {
a.logger.Error().Err(err).Msg("failed to start server")
}
return err
}

func (a *App) Init() error {
// Create an authenticated client using go-githubapp
config := githubapp.Config{
Expand Down
119 changes: 0 additions & 119 deletions go/tools/github/pull_request.go

This file was deleted.

0 comments on commit 057d923

Please sign in to comment.