Skip to content

System service instance#1087

Merged
NicolasMahe merged 14 commits intodevfrom
feature/system-service-instance
Jul 2, 2019
Merged

System service instance#1087
NicolasMahe merged 14 commits intodevfrom
feature/system-service-instance

Conversation

@antho1404
Copy link
Copy Markdown
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
Copy Markdown
Member Author

@NicolasMahe can you take care of ethwallet service

Comment thread config/services.go Outdated
@antho1404 antho1404 marked this pull request as ready for review July 1, 2019 05:29
Copy link
Copy Markdown
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.

Comment thread 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
Copy Markdown
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
Copy Markdown
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

Comment thread dev Outdated
Comment thread scripts/build-core.sh Outdated
Comment thread sdk/instance/instance.go Outdated
Comment thread sdk/service/service.go Outdated
Comment thread server/grpc/core/core.go
Url: s.URL,
Sid: s.Definition.Sid,
Hash: s.Instance.Hash.String(),
Url: s.Definition.Source,
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread dev Outdated
# 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é <nicolas@mesg.com>
Co-Authored-By: Nicolas Mahé <nicolas@mesg.com>
Comment thread sdk/instance/instance.go Outdated
Comment thread sdk/service/service.go Outdated
@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