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

System service instance #1087

Merged
merged 14 commits into from
Jul 2, 2019
Merged

System service instance #1087

merged 14 commits into from
Jul 2, 2019

Conversation

antho1404
Copy link
Member

@antho1404 antho1404 commented Jun 24, 2019

Dependency: #1085

  • Load system services based on service definition
  • Use new service.Create and instance.Create functions
  • Update dev script
  • Inject full service definition
    • Add compiled version of the service in the sources
    • Load compiled version in the binary with go-assets or something like that
  • Fix Ethwallet with new API

fix #1115

@antho1404 antho1404 force-pushed the feature/system-service-instance branch from c381cb6 to fcf6f8e Compare June 24, 2019 07:50
@antho1404 antho1404 force-pushed the feature/system-service-instance branch from 9c2dbc0 to 085b8b7 Compare June 29, 2019 13:15
@antho1404 antho1404 force-pushed the feature/system-service-instance branch from 085b8b7 to ff3eb5d Compare June 29, 2019 13:18
@antho1404
Copy link
Member Author

@NicolasMahe can you take care of ethwallet service

config/services.go Outdated Show resolved Hide resolved
@antho1404 antho1404 marked this pull request as ready for review July 1, 2019 05:29
Copy link
Member

@NicolasMahe NicolasMahe left a comment

Choose a reason for hiding this comment

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

It's looking good!

I would suggest to simplify the override of the env of the system services. Instead of having to define one variable per env, we could pass ALL envs in one variable as a JSON encoded array. The Engine would have to decode it to start the instances.
Maybe we could go further and create a generic system based on JSON encoded string or a file that is transform to an asset during the compilation, that contains all info about the SystemService. Like this we will not have to update the config package to add or update system services. @krhubert suggested something like this on Discord.
This is definitely for another PR and it's not blocking for the next release.

dev Outdated
pushd $s > /dev/null
name=$(basename "$s")
varname="${name}"
LDFLAGS+=" -X 'github.com/mesg-foundation/core/config.${varname}Compiled=$(cat compiled.json)'"
Copy link
Member

@NicolasMahe NicolasMahe Jul 2, 2019

Choose a reason for hiding this comment

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

also, why not compiling the service also in this script? like scripts/build-engine.sh is doing? because of optimization?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes because of optimization but not only, we should only have the compiled version of the service and if we have the compiled version there is no need of having the sources of the system service in the engine and in that case, the compiled version is a snapshot of the exact version we want from this system service that we can manually update with something like

mesg-cli service:compile https://github.com/mesg-foundation/service-marketplace > systemservices/marketplace.json

dev Outdated Show resolved Hide resolved
scripts/build-core.sh Outdated Show resolved Hide resolved
sdk/instance/instance.go Outdated Show resolved Hide resolved
sdk/service/service.go Outdated Show resolved Hide resolved
Url: s.URL,
Sid: s.Definition.Sid,
Hash: s.Instance.Hash.String(),
Url: s.Definition.Source,
Copy link
Member

Choose a reason for hiding this comment

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

Is it useful to return the Source?
I think it will be nice to also have ServiceHash along side InstanceHash.
But anyway Hash = InstanceHash is the most important one 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

just didn't want to break the api and return what was initially returned. Let's remove it if needed in another PR

dev Outdated Show resolved Hide resolved
# Conflicts:
#	config/services.go
#	core/main.go
#	dev
#	scripts/build-core.sh
@NicolasMahe NicolasMahe force-pushed the feature/system-service-instance branch from eb9a5dc to 6ebc490 Compare July 2, 2019 08:07
NicolasMahe and others added 3 commits July 2, 2019 15:10
# Conflicts:
#	config/services.go
#	core/main.go
#	dev
#	scripts/build-engine.sh
Co-Authored-By: Nicolas Mahé <[email protected]>
Co-Authored-By: Nicolas Mahé <[email protected]>
sdk/service/service.go Outdated Show resolved Hide resolved
@NicolasMahe NicolasMahe merged commit 49df76e into dev Jul 2, 2019
@NicolasMahe NicolasMahe deleted the feature/system-service-instance branch July 2, 2019 09:50
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.

Add back start of system service
2 participants