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

Multiple core runnable #478

Merged
merged 23 commits into from
Sep 24, 2018
Merged

Multiple core runnable #478

merged 23 commits into from
Sep 24, 2018

Conversation

antho1404
Copy link
Member

@antho1404 antho1404 commented Sep 19, 2018

We can now sandbox the core in it's own context, the .mesg folder contains now a folder for each core based on the name. The core now has all the docker configurations (service, container, network) based on its name and we can now so run multiple core with some env variable.

./dev-core
MESG_CORE_NAME=core2 MESG_CORE_PATH=$(pwd)/xxx MESG_SERVER_ADDRESS=:50051 MESG_CLIENT_ADDRESS=localhost:50051 ./dev-core

and access with the cli

./dev-cli service list
MESG_CLIENT_ADDRESS=localhost:50051 ./dev-cli service list

Please merge #477 before

@antho1404 antho1404 changed the title Multiple core runnable WIP: Multiple core runnable Sep 19, 2018
@NicolasMahe
Copy link
Member

This close #457

@NicolasMahe
Copy link
Member

NicolasMahe commented Sep 20, 2018

To do:

Done in commit 462108b

@antho1404 antho1404 changed the title WIP: Multiple core runnable Multiple core runnable Sep 20, 2018
@antho1404 antho1404 requested review from ilgooz and krhubert and removed request for ilgooz September 20, 2018 05:09
krhubert
krhubert previously approved these changes Sep 20, 2018
@krhubert krhubert mentioned this pull request Sep 20, 2018
@mesg-bot
Copy link
Member

This pull request has been mentioned on MESG Community. There might be relevant details there:

https://forum.mesg.com/t/cores-name-in-config/47/3

NicolasMahe
NicolasMahe previously approved these changes Sep 21, 2018
daemon/logs.go Show resolved Hide resolved
config/config.go Outdated
@@ -37,8 +37,9 @@ type Config struct {
}

Core struct {
Image string
Path string
Image string
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get this part, why do we need name and rootpath?
What rootpath means - consider remaining it to ConfigPath as this is what you mean right?
Also when the path is explicit given the app shouldn't create new directories (.mesg) under it.

Copy link
Member Author

Choose a reason for hiding this comment

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

The goal of that is to have the database stored in it's own directory so the root path is the one that will store all the different "core" instances

Right now we have

~/.mesg/
├── database

And this change to

~/.mesg/
├── mesg-core/
|   ├── database

Like that we can now run different instances of the core with their own separated database

~/.mesg/
├── mesg-core1/
|   ├── database
├── mesg-core2/
|   ├── database
...

The RootPath is the one to store the .mesg and the CorePath() is the one to use to know where to write. This one returns the RootPath + Name.

ConfigPath is a bit ambiguous because it's the config of the core so this should be the ~/.mesg/mesg-core

Also when the path is explicit given the app shouldn't create new directories (.mesg) under it.

Why shouldn't we do that ? The goal of this property is to be the "namespace" for the folder

Copy link
Member Author

Choose a reason for hiding this comment

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

Based on the discussion on discord and the feedbacks of @krhubert we can remove the RootPath and just keep a CorePath that is customizable by the user and so we would just have the MESG_CORE_PATH to edit more

@antho1404
Copy link
Member Author

@mesg-foundation/core ready to review again, I added the MESG_CORE_PATH to run the core with different config/db repository like that we can run multiple core with their own database or even choose to run multiple core with the same database

@antho1404 antho1404 merged commit ab36dc1 into dev Sep 24, 2018
@antho1404 antho1404 deleted the feature/core-name-configuration branch September 24, 2018 15:11
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.

5 participants