Skip to content

Conversation

michelvocks
Copy link
Member

@michelvocks michelvocks commented Jul 23, 2018

Fixes #53.
This will be a breaking change. Once this is merged we have to update the SDK immediately otherwise create pipeline will fail.
For now implemented first version of CA generation and key pair generation which will be signed for mutual Auth.

@codecov-io
Copy link

codecov-io commented Jul 23, 2018

Codecov Report

Merging #54 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
+ Coverage   56.13%   56.16%   +0.03%     
==========================================
  Files          16       16              
  Lines        1418     1419       +1     
==========================================
+ Hits          796      797       +1     
  Misses        529      529              
  Partials       93       93
Impacted Files Coverage Δ
scheduler/scheduler.go 65.71% <100%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 70b3dd5...9e5610e. Read the comment docs.

@Skarlso
Copy link
Member

Skarlso commented Jul 23, 2018

Can you put it behind a feature flag of it's breaking everyone? And the flag is off by default and on for anyone opting in? Would it make sense?

@michelvocks
Copy link
Member Author

@Skarlso I think I can do that. I just think when we wait longer more users will be pissed at the end. I think now is the perfect time to do changes like these when everyone expects bugs/problems. 😄

@michelvocks michelvocks force-pushed the unix_socket_to_port branch from 43fcbd6 to 17b7873 Compare July 23, 2018 18:20
@michelvocks michelvocks reopened this Jul 23, 2018
@Skarlso
Copy link
Member

Skarlso commented Jul 23, 2018

@michelvocks Agreed. :D

@michelvocks michelvocks force-pushed the unix_socket_to_port branch from 228a34b to 7fd6bbe Compare July 25, 2018 15:04
@michelvocks
Copy link
Member Author

This is now working as intended and make Gaia a bit more secure and flexibe. 🎉 🎊
I will rebase it after #58 has been merged.

@michelvocks michelvocks force-pushed the unix_socket_to_port branch from 7fd6bbe to 765e03d Compare July 25, 2018 20:23
@michelvocks michelvocks self-assigned this Jul 27, 2018
@Skarlso
Copy link
Member

Skarlso commented Jul 30, 2018

@michelvocks Yo what's up with this guy? :) The corresponding 58 was merged. :)

@michelvocks
Copy link
Member Author

michelvocks commented Jul 30, 2018

@Skarlso if I merge this, it's not possible to build pipelines anymore when you are running gaia from master branch. It will work again if I merge this: gaia-pipeline/gosdk#1

But then it's not possible to build pipelines in version V0.1.2 which is currently latest released version.

Maybe it's fine to just merge this and if someone uses master and can just tell him to use my fork. This should actually work.

@michelvocks michelvocks force-pushed the unix_socket_to_port branch 2 times, most recently from deeeb3b to ee4dc9a Compare July 30, 2018 18:02
@michelvocks
Copy link
Member Author

Ping @Skarlso please have a look and merge if you think so 🤗

@michelvocks michelvocks changed the title [WIP] Unix sockets to port communication Unix sockets to port communication Jul 30, 2018
@michelvocks michelvocks requested a review from Skarlso July 30, 2018 19:01
@michelvocks michelvocks added the Ready To Merge PR is ready to be merged into master label Jul 30, 2018
@Skarlso
Copy link
Member

Skarlso commented Jul 30, 2018

I fixed the merge conflict. 👍 Hope you don't mind. :)

@Skarlso
Copy link
Member

Skarlso commented Jul 31, 2018

@michelvocks Race error on the new scheduler test here:

	err = os.Remove(filepath.Join(os.TempDir(), "gaia.db"))

:(

@Skarlso
Copy link
Member

Skarlso commented Jul 31, 2018

Oh I see why... Interesting. why are we removing a temp directory?

I'll fix it. :)

EDIT: Ah, I see why. I'll put it into a defer.

@Skarlso
Copy link
Member

Skarlso commented Jul 31, 2018

Interesting. Something new introduced a race condition after merging master. :/

@Skarlso
Copy link
Member

Skarlso commented Jul 31, 2018

I tested this on master and it looks okay. So it's this new code plus the new schedule test that's failing.

@michelvocks michelvocks force-pushed the unix_socket_to_port branch from 428b4bc to aeb27ae Compare July 31, 2018 06:00
@michelvocks michelvocks force-pushed the unix_socket_to_port branch from aeb27ae to 9e5610e Compare July 31, 2018 06:07
@michelvocks
Copy link
Member Author

@Skarlso I fixed it. Somehow the init method was still in the specific test. No clue what happened there. 😄

@Skarlso
Copy link
Member

Skarlso commented Jul 31, 2018

Well done! Awesome.😁

Copy link
Member

@Skarlso Skarlso left a comment

Choose a reason for hiding this comment

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

Two small nits, otherwise LGTM! :)

func (p *PluginFake) Connect(cmd *exec.Cmd, logPath *string) error { return nil }
func (p *PluginFake) Execute(j *gaia.Job) error { return nil }
func (p *PluginFake) GetJobs() ([]gaia.Job, error) { return prepareJobs(), nil }
func (p *PluginFake) Close() {}

type CAFake struct{}

func (c *CAFake) CreateSignedCert() (string, string, error) { return "", "", nil }
Copy link
Member

Choose a reason for hiding this comment

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

Okay, so I know that this will be annoying, but... :D Could you please change the API of the CA to named values in the return statement? Because it's annoying that I don't know what "", "", nil is actually returning by looking at the pop up of the parameters. :D I don't which is which here. Path, or Cert or KeyPath or whatever, you see what I'm saying?

@@ -36,7 +45,9 @@ func TestInit(t *testing.T) {
if err := storeInstance.Init(); err != nil {
t.Fatal(err)
}
s := NewScheduler(storeInstance, &PluginFake{})
var ca security.CAAPI
Copy link
Member

Choose a reason for hiding this comment

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

you can remove this variable and change the below ca = &CAFake{} to simply ca := &CAFake{} and all will be well. Do this everywhere. :)

@Skarlso Skarlso merged commit 7a905f4 into gaia-pipeline:master Jul 31, 2018
@michelvocks michelvocks deleted the unix_socket_to_port branch July 31, 2018 19:12
michelvocks added a commit to michelvocks/gaia that referenced this pull request Aug 1, 2018
michelvocks added a commit to michelvocks/gaia that referenced this pull request Aug 2, 2018
michelvocks added a commit to michelvocks/gaia that referenced this pull request Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready To Merge PR is ready to be merged into master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants