-
Notifications
You must be signed in to change notification settings - Fork 508
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 pop from Proxy & RDBMS storage getter #511
Conversation
- Not sourcing from cmd/proxy/.env, because that doesn't export any variables - Removing mysql support (I feel like 1 database is enough) - Pruning networks on teardown I'm happy to split these changes up into separate PRs - it's the end of the day for me so I wanted to get everything in 😄
951be21
to
1054f41
Compare
Codecov Report
@@ Coverage Diff @@
## master #511 +/- ##
========================================
+ Coverage 39.9% 40.91% +1%
========================================
Files 112 104 -8
Lines 3205 3065 -140
========================================
- Hits 1279 1254 -25
+ Misses 1799 1688 -111
+ Partials 127 123 -4
Continue to review full report at Codecov.
|
96f2939
to
4e036c8
Compare
cmd/proxy/models/models.go
Outdated
@@ -1,22 +1,5 @@ | |||
package models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need these 2 files at all after this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think so at all. I have kept it simply because I am coming from an RoR space where convention over configuration. Buffalo by default creates models.go and that is why I have kept it around.
If we want we can remove it!
cmd/olympus/actions/storage.go
Outdated
@@ -34,12 +33,6 @@ func GetStorage() (storage.Backend, error) { | |||
return nil, err | |||
} | |||
return mongo.NewStorage(mongoURI) | |||
case "postgres", "sqlite", "cockroach", "mysql": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are removing postgres support, is that right? we keep postgres image running and we have olympus database yaml saying dialect: "postgres"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to have Postgres image and the yml file on Olympus because we have a CDN RDBMS driver. This way, we can run tests for CDN but still remove RDBS storage support from pkg/
cmd/proxy/models/models.go
Outdated
// DB is a connection to your database to be used | ||
// throughout your application. | ||
var DB *pop.Connection | ||
|
||
func init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove init(), there's no point of having it
cmd/proxy/models/models_test.go
Outdated
func Test_ModelSuite(t *testing.T) { | ||
as := &ModelSuite{suite.NewModel()} | ||
suite.Run(t, as) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m: whitespace
@manugupt1 a have the nitpickey-ist of all nitpicks, sorry in advance! Instead of writing:
Can you write this:
This way, GitHub will properly close all 4 of those issues when this PR is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one tiny change about the Makefile.
And the rest are questions
@@ -20,8 +20,9 @@ before_script: | |||
- make setup-dev-env | |||
- wget "https://dl.minio.io/server/minio/release/linux-amd64/minio" | |||
- chmod +x minio && nohup ./minio server . & | |||
- buffalo db create | |||
- buffalo db migrate up | |||
- buffalo db create -e $GO_ENV -d -c $POP_PATH/database.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this if we're removing pop and rdbms storage?
Same thing for the line below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below!
@@ -7,8 +7,8 @@ go: | |||
env: | |||
global: | |||
- PATH=${PATH}:./bin | |||
- POP_PATH=$PWD/cmd/proxy | |||
- GO_ENV=test_postgres | |||
- POP_PATH=$PWD/cmd/olympus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need POP_PATH at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! because we still have the CDN rdbms driver which is dependent on Pop. So, I made sure that the proxy is independent of Pop
but olympus
is not.
Once, we have voted on CDN to be kicked out of olympus, the next step would be to create a PR that basically removes POP_PATH
from travis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manugupt1 so say we keep CDN, do we still need RDBMS in the CDN? can we not remove RDBMS and use another storage for CDN?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right on!
So, if we decide not to support the RDBMS driver for CDN, we do not need it at all.
For example,
https://github.com/gomods/athens/blob/master/pkg/cdn/metadata/cdn_metadata_entry.go#L14-L19
Supports both mongo and SQL based tags!
If we remove the rdbms driver that stores the metadata https://github.com/gomods/athens/tree/master/pkg/cdn/metadata/rdbms
Then, we can remove all the dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we decided to remove RDBMS from anything Athens related, but we can do it in another PR. @arschles correct me if im wrong :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool! I was not aware of of that! Let us wait for @arschles to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do believe that RDBMS in CDN is without use. there are no relationships there so any document db will do just fine. Let's get rid of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to address it in this or a separate PR @manugupt1
Makefile
Outdated
@@ -74,3 +73,4 @@ down: | |||
dev-teardown: | |||
docker-compose -p athensdev down | |||
docker volume prune | |||
docker network prune |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should already happen with docker-compose -p athensdev down
-- if not, let's do it in another PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
Perfect! I will update it later tonight
Cheers
Manu
________________________________
From: Michal Pristas <notifications@github.com>
Sent: Tuesday, August 21, 2018 3:55:29 AM
To: gomods/athens
Cc: Manu Gupta; Mention
Subject: Re: [gomods/athens] Remove pop from Proxy & RDBMS storage getter (#511)
@michalpristas commented on this pull request.
________________________________
In .travis.yml<#511 (comment)>:
@@ -7,8 +7,8 @@ go:
env:
global:
- PATH=${PATH}:./bin
- - POP_PATH=$PWD/cmd/proxy
- - GO_ENV=test_postgres
+ - POP_PATH=$PWD/cmd/olympus
I do believe that RDBMS in CDN is without use. there are no relationships there so any document db will do just fine. Let's get rid of it
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#511 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAYLj54gaGQ67U3E3C3y16VqnvcRe8bbks5uS7zxgaJpZM4WCVBv>.
|
@rchakra3 are your comments addressed? |
Based on the comments here I'm assuming we'll get rid of |
Yep! @rchakra3 |
This PR is huge. I did not really want it that way, however as I was making CI (Travis work), I was making changes and was in a complete rabbit hole. If required, I can always separate it out it in multiple ways and in the process.
postgres
andpostgres
which is the default and is used as most commonly for most systems that are not docker based, so it streamlines dev build using docker and otherwise when you look at database.yml.Fixes #496
Fixes #494
Fixes #450
Fixes #487