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

New Runtime #287

Merged
merged 42 commits into from
Jun 8, 2020
Merged

New Runtime #287

merged 42 commits into from
Jun 8, 2020

Conversation

refs
Copy link
Member

@refs refs commented May 22, 2020

The runtime itself lives here, and comments on its design can, and should, be appended to this pull request.

Rationale: micro/go-micro is based on running from sources, and we do not want that for the time being. We should also be in control of How We Run What We Run™, and therefore this approach fits better than using a third party process manager.

@update-docs
Copy link

update-docs bot commented May 22, 2020

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Left some minor comments for improvement. But essentially everything you did works great. 😍

Biggest question and chance for improvement I see is: would be even more awesome to spawn the extensions with pman, but still like this: ocis <extension>. Right now this starts the extension without using pman. Goal should be to have all extensions spawned and managable through pman, for both ocis server and ocis <extension>. Problem is, that the way pman spawns the process would cause a recursion... ideas?

args := []string{os.Args[0]}
all := append(Extensions, MicroServices...)
for i := range all {
arg0 := process.NewProcEntry(
Copy link
Member

Choose a reason for hiding this comment

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

Could be renamed to args to be in line with the callee's signature.

all[i],
[]string{all[i]}...,
)
var arg1 int
Copy link
Member

Choose a reason for hiding this comment

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

Could be renamed to reply to be in line with the callee's signature.

runtime.Start()
runtime.Trap()
}
runtime.Start()
Copy link
Member

Choose a reason for hiding this comment

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

Return the (possible) error from here, instead of nil two lines below.

Copy link
Member

Choose a reason for hiding this comment

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

server_simple seems to be broken... but looks like it already was before.

@kulmann
Copy link
Member

kulmann commented May 23, 2020

Oh and of course: changelog. ;-D

@refs
Copy link
Member Author

refs commented May 25, 2020

Left some minor comments for improvement. But essentially everything you did works great. 😍

Biggest question and chance for improvement I see is: would be even more awesome to spawn the extensions with pman, but still like this: ocis <extension>. Right now this starts the extension without using pman. Goal should be to have all extensions spawned and managable through pman, for both ocis server and ocis <extension>. Problem is, that the way pman spawns the process would cause a recursion... ideas?

the process manager will be included into the ocis toolchain indeed, resulting in, i.e when running ocis run phoenix, invoking the pman lib. It is in the pipeline :D

@dpakach
Copy link
Contributor

dpakach commented May 25, 2020

@refs looks like UI tests CI is broken right now in master. Please Merge and rebase on top of #288 for green CI.

@refs
Copy link
Member Author

refs commented May 25, 2020

@refs looks like UI tests CI is broken right now in master. Please Merge and rebase on top of #288 for green CI.

Thanks! I already rebased a while back, but encounter a race condition on reva. It finds out that reva-sharing depends on /var/tmp/reva dir to be present, as it attempts to read /var/tmp/reva/shares.json but the folder is not present, so it panics. You can see it in the logs of the ocis-server step.

Solved it for the new runtime on a hacky way, will have to tackle it on reva upstream.

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

🐙 ❤️

@refs refs mentioned this pull request Jun 5, 2020
@refs
Copy link
Member Author

refs commented Jun 8, 2020

This has some implications. Since micro/micro 2.4.0 with the addition of an Auth service, calls to either web (:8082) or api (:8080) are authenticated.

There is however a noop default implementation, but token Inspection returns the following

// Inspect a token
func (n *noop) Inspect(token string) (*Account, error) {
	return &Account{ID: uuid.New().String(), Issuer: n.Options().Namespace}, nil
}

Where Issuer, for whatever reason, is empty. By the time this field is checked, len(acc.Issuer) == 0 // true.

I submitted a PR upstream that, if merged, would allow to, again, call the micro api and web services.

@refs
Copy link
Member Author

refs commented Jun 8, 2020

cc @butonic , I believe this impacts the way you're currently testing the accounts queries through the micro/web

@refs refs self-assigned this Jun 8, 2020
@refs refs merged commit 5a6bb24 into master Jun 8, 2020
@refs refs deleted the feature/pacman-runtime branch June 8, 2020 08:12
refs pushed a commit that referenced this pull request Sep 18, 2020
[tests-only] skip tests that are tagged @skipOnOcis-OC-Storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants