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

Packaging #64

Merged
merged 36 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d119f51
added fpm config
jbsv Mar 8, 2022
6d89219
can build unikernel and memcoin
jbsv Mar 9, 2022
0b5d247
update fpm script to copy binaries
jbsv Mar 9, 2022
ae3193d
added packaging documentation
jbsv Mar 9, 2022
f52ed9d
start dvoting service
jbsv Mar 9, 2022
fe78c88
use ip instead of ifconfig in qemu-guest
jbsv Mar 9, 2022
ea5e677
setup dvoting service
jbsv Mar 10, 2022
2f84662
use root for now to start the dvoting service in systemd
jbsv Mar 10, 2022
d16e385
added separate dvoting node service
jbsv Mar 11, 2022
8d3d1b0
start-dvoting script
jbsv Mar 11, 2022
4075cfb
Can start unikernel
jbsv Mar 14, 2022
64e0864
can start services
jbsv Mar 15, 2022
d93b09d
roll back changes in qemu_guest
jbsv Mar 16, 2022
6916467
dvoting user as sudo
jbsv Mar 16, 2022
e6ff823
improved config
jbsv Mar 16, 2022
1666dd7
added unikernel into after/before scripts
jbsv Mar 16, 2022
a82ab09
can use vx.y.z versioning
jbsv Mar 17, 2022
da0e5de
added access ID file
jbsv Mar 17, 2022
fe0f591
added proxy and prometheus addresses
jbsv Mar 17, 2022
22f8625
remove daemon.sock before install
jbsv Mar 17, 2022
783a4d3
added make deb
jbsv Mar 17, 2022
0468c07
force remove of daemon.sock
jbsv Mar 17, 2022
7b55628
updates git module path
nkcr Mar 18, 2022
8d1e423
added symb link to memcoin
jbsv Mar 18, 2022
8535b76
Adds updates to make the setup run on detached VMs
nkcr Mar 18, 2022
5362a2c
Fixes the tests
nkcr Mar 18, 2022
a951ef5
Merge pull request #66 from dedis/updates-multiple-vm-checks
nkcr Mar 18, 2022
a7291d0
Addresses Pierluca's comment
nkcr Mar 21, 2022
5a80d0f
changes after review
jbsv Mar 21, 2022
cd58deb
more changes after review
jbsv Mar 21, 2022
04e5e85
fixed config.env
jbsv Mar 21, 2022
2c1fe16
tidy up config.env after review
jbsv Mar 22, 2022
684e812
can install deb with configs
jbsv Mar 22, 2022
7150e1e
update deployement doc
jbsv Mar 22, 2022
002dc1f
improved deployment doc
jbsv Mar 22, 2022
a73ad11
Merge remote-tracking branch 'origin/unikernel-combine-shares' into p…
jbsv Mar 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ web/app/node_modules
.idea

memcoin
deb-package/deb
deb-package/dist
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "contracts/evoting/unikernel/unikraft"]
path = contracts/evoting/unikernel/unikraft
url = https://github.com/unikraft/unikraft
[submodule "contracts/evoting/unikernel/libs/lwip"]
path = contracts/evoting/unikernel/libs/lwip
url = https://github.com/unikraft/lib-lwip
[submodule "contracts/evoting/unikernel/libs/newlib"]
path = contracts/evoting/unikernel/libs/newlib
url = https://github.com/unikraft/lib-newlib
[submodule "contracts/evoting/unikernel/libs/libsodium"]
path = contracts/evoting/unikernel/libs/libsodium
url = https://github.com/cs-pub-ro/lib-libsodium
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ test_integration:
go test ./integration

build:
go build -ldflags="-X $(versionFlag) -X $(timeFlag)" ./cli/memcoin
go build -ldflags="-X $(versionFlag) -X $(timeFlag)" ./cli/memcoin

deb:
GOOS=linux GOARCH=amd64 make build
cd deb-package; ./build-deb.sh; cd ..
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,8 @@ timeFlag="github.com/dedis/d-voting.BuildTime=`date +'%d/%m/%y_%H:%M'`"
go build -ldflags="-X $versionFlag -X $timeFlag" ./cli/memcoin
```

Note that `make build` will do that for you.
Note that `make build` will do that for you. You can also cross-compile with:

```sh
GOOS=linux GOARCH=amd64 make build
jbsv marked this conversation as resolved.
Show resolved Hide resolved
```
2 changes: 1 addition & 1 deletion cli/memcoin/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
shuffle "github.com/dedis/d-voting/services/shuffle/neff/controller"

cosipbft "github.com/dedis/d-voting/cli/cosipbftcontroller"
mino "github.com/dedis/d-voting/cli/minocontroller"
"github.com/dedis/d-voting/cli/postinstall"
evoting "github.com/dedis/d-voting/contracts/evoting/controller"
metrics "github.com/dedis/d-voting/metrics/controller"
Expand All @@ -44,7 +45,6 @@ import (
db "go.dedis.ch/dela/core/store/kv/controller"
pool "go.dedis.ch/dela/core/txn/pool/controller"
signed "go.dedis.ch/dela/core/txn/signed/controller"
mino "go.dedis.ch/dela/mino/minogrpc/controller"
proxy "go.dedis.ch/dela/mino/proxy/http/controller"

_ "github.com/dedis/d-voting/services/shuffle/neff/json"
Expand Down
102 changes: 102 additions & 0 deletions cli/minocontroller/actions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// This file contains the implementation of the controller actions.
//
// Documentation Last Review: 07.10.2020
nkcr marked this conversation as resolved.
Show resolved Hide resolved
//

package minocontroller

import (
"crypto/tls"
"encoding/base64"
"fmt"

"go.dedis.ch/dela/cli/node"
"go.dedis.ch/dela/mino"
"go.dedis.ch/dela/mino/minogrpc"
"golang.org/x/xerrors"
)

// CertAction is an action to list the certificates known by the server.
//
// - implements node.ActionTemplate
type certAction struct{}

// Execute implements node.ActionTemplate. It prints the list of certificates
// known by the server with the address associated and the expiration date.
func (a certAction) Execute(req node.Context) error {
var m minogrpc.Joinable

err := req.Injector.Resolve(&m)
if err != nil {
return xerrors.Errorf("couldn't resolve: %v", err)
}

m.GetCertificateStore().Range(func(addr mino.Address, cert *tls.Certificate) bool {
fmt.Fprintf(req.Out, "Address: %v Certificate: %v\n", addr, cert.Leaf.NotAfter)
return true
})

return nil
}

// TokenAction is an action to generate a token that will be valid for another
// server to join the network of participants.
//
// - implements node.ActionTemplate
type tokenAction struct{}

// Execute implements node.ActionTemplate. It generates a token that will be
// valid for the amount of time given in the request.
func (a tokenAction) Execute(req node.Context) error {
exp := req.Flags.Duration("expiration")

var m minogrpc.Joinable
err := req.Injector.Resolve(&m)
if err != nil {
return xerrors.Errorf("couldn't resolve: %v", err)
}

token := m.GenerateToken(exp)

digest, err := m.GetCertificateStore().Hash(m.GetCertificate())
if err != nil {
return xerrors.Errorf("couldn't hash certificate: %v", err)
}

fmt.Fprintf(req.Out, "--token %s --cert-hash %s\n",
token, base64.StdEncoding.EncodeToString(digest))

return nil
}

// JoinAction is an action to join a network of participants by providing a
// valid token and the certificate hash.
//
// - implements node.ActionTemplate
type joinAction struct{}

// Execute implements node.ActionTemplate. It parses the request and send the
// join request to the distant node.
func (a joinAction) Execute(req node.Context) error {
token := req.Flags.String("token")
addr := req.Flags.String("address")
certHash := req.Flags.String("cert-hash")

var m minogrpc.Joinable
err := req.Injector.Resolve(&m)
if err != nil {
return xerrors.Errorf("couldn't resolve: %v", err)
}

cert, err := base64.StdEncoding.DecodeString(certHash)
if err != nil {
return xerrors.Errorf("couldn't decode digest: %v", err)
}

err = m.Join(addr, token, cert)
if err != nil {
return xerrors.Errorf("couldn't join: %v", err)
}

return nil
}
Loading