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

remove olympus storage implementation and proxy worker #513

Merged
merged 4 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 0 additions & 47 deletions cmd/proxy/actions/app.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package actions

import (
"context"
"fmt"

"github.com/gobuffalo/buffalo"
Expand All @@ -10,30 +9,15 @@ import (
"github.com/gobuffalo/buffalo/middleware/i18n"
"github.com/gobuffalo/buffalo/middleware/ssl"
"github.com/gobuffalo/buffalo/render"
"github.com/gobuffalo/buffalo/worker"
"github.com/gobuffalo/gocraft-work-adapter"
"github.com/gobuffalo/packr"
"github.com/gocraft/work"
"github.com/gomods/athens/pkg/config/env"
"github.com/gomods/athens/pkg/log"
mw "github.com/gomods/athens/pkg/middleware"
"github.com/gomods/athens/pkg/module"
"github.com/gomods/athens/pkg/storage"
"github.com/gomodule/redigo/redis"
"github.com/rs/cors"
"github.com/unrolled/secure"
)

const (
// FetcherWorkerName is the name of the worker fetching sources from experienced cache misses
FetcherWorkerName = "olympusfetcher"
// ReporterWorkerName is the name of the worker reporting cache misses
ReporterWorkerName = "olympusreporter"
workerQueue = "default"
workerModuleKey = "module"
workerVersionKey = "version"
)

// ENV is used to help switch settings based on where the
// application is being run. Default is "development".
var ENV = env.GoEnvironmentWithDefault("development")
Expand All @@ -60,7 +44,6 @@ func init() {
// should be defined. This is the nerve center of your
// application.
func App() (*buffalo.App, error) {
ctx := context.Background()
store, err := GetStorage()
if err != nil {
err = fmt.Errorf("error getting storage configuration (%s)", err)
Expand All @@ -71,11 +54,6 @@ func App() (*buffalo.App, error) {
// to have access to private repos.
initializeNETRC()

worker, err := getWorker(ctx, store)
if err != nil {
return nil, err
}

lvl, err := env.LogLevel()
if err != nil {
return nil, err
Expand All @@ -94,8 +72,6 @@ func App() (*buffalo.App, error) {
cors.Default().Handler,
},
SessionName: "_athens_session",
Worker: worker,
WorkerOff: true, // TODO(marwan): turned off until worker is being used.
Logger: blggr,
})
if prefix := env.AthensPathPrefix(); prefix != "" {
Expand Down Expand Up @@ -156,26 +132,3 @@ func App() (*buffalo.App, error) {

return app, nil
}

func getWorker(ctx context.Context, s storage.Backend) (worker.Worker, error) {
port := env.RedisQueuePortWithDefault(":6379")
w := gwa.New(gwa.Options{
Pool: &redis.Pool{
MaxActive: 5,
MaxIdle: 5,
Wait: true,
Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", port)
},
},
Name: FetcherWorkerName,
MaxConcurrency: env.AthensMaxConcurrency(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to remove this as well from config package

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry still used in olympus

})

opts := work.JobOptions{
SkipDead: true,
MaxFails: env.WorkerMaxFails(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for WorkerMaxFails

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry still used in olympus

}

return w, w.RegisterWithOptions(FetcherWorkerName, opts, GetProcessCacheMissJob(ctx, s, w))
}
75 changes: 0 additions & 75 deletions cmd/proxy/actions/cache_miss_fetcher.go

This file was deleted.

82 changes: 0 additions & 82 deletions pkg/storage/olympus/getter.go

This file was deleted.

20 changes: 0 additions & 20 deletions pkg/storage/olympus/olympus.go

This file was deleted.

17 changes: 0 additions & 17 deletions pkg/storage/olympus/saver.go

This file was deleted.